commandlinefu.com is the place to record those command-line gems that you return to again and again.
You can sign-in using OpenID credentials, or register a traditional username and password.
Subscribe to the feed for:
Creates a temporary ram partition
to make a 3gb partition (Defaults to 1gb)
Replace KEY with GPG key. This command will load GPG key and add it to your system so you can use software from third party repos etc.
Kills all processes with a certain string. This was done to kill all ssh sessions openned by zenoss which look like: usr/bin/ssh /opt/zenoss/bin/zenmodeler
If you run dpkg --clear-selections or have otherwise selected installed packages for deinstall, but want to undo it, run this. It will set all installed packages back to installed status so that they won't be removed by commands like "dpkg -Pa"
Install all build dependencies for a given package
Back up /etc directory with a name based on the current date and the hostname of the machine, then chown the file for the current user for use.
bit of a contrived example and playing to my OCD but nice for quick scripted output of listening ports which is sorted by port, ip address and protocol.
..not guaranteed to always be accurate but fun to see how old you Linux installation is based on the root partitions file system creation date.
Assumes XP/2000/2003. For Server 2008+ try offset=105,906,176 You can find this number in the System Information utility under Partition Starting Offset. UEFI based boxes you want partition 2 since the first is just the boot files (and FAT). This works with (storage side) snapshots which is handy for single file restores on NFS mounted VMware systems
If you are an unlucky soul behind a corporate firewall you will likely find that downloading gpg keys is blocked. This is because the hkp protocol uses port 11371 by default to transfer the key.
By adding "hkp://" to the beginning of the hostname and ":80" to the end you are asking gpg to try using port 80 to connect (less likely to be blocked by a firewall). This relies on the remote server answering to requests over port 80.
Counts of messages by recipient, with frozen messages excluded.
Inner "ps...grep..." command searches for a process matching the specified .
"lsof -p lists all file descriptors owned by . Includes open files, sockets, devices, etc...
To do this, we?ll use nano to create a new configuration file called ?virtualbox.conf?. This file will go in the ?/etc/modules-load.d? directory, which contains files that need to be loaded when Arch boots up. Since adding a file to this directory requires administrative permissions, we?ll need to precede our command with ?sudo? once again.
When nano brings up the blank file, add these three lines to it:
As usual, when you?re finished entering text in nano, type Control-X to exit to the command line, and answer ?y? for yes when you?re asked whether you want to save your work, and then hit ?Return? to accept the filename. At this point, reboot your machine for the Guest Additions to take effect.