This will print to the screen password for the user specified in "sys_users.login='xxxx';. This is for Plesk servers only. Show Sample Output
Alrighty, so I was really bored ;) Show Sample Output
Lifted from http://linux.spiney.org/remote_diff_with_vim_and_ssh which points out credits for the inspiration.
unsets variables used by the one-liner sets up the IFS bash variable to not be affected by whitespace and disables extra glob expansion uses read to slurp the results of the find command into an array selects an element of the array at random to be passed as an argument to mplayer
This command takes the output of the 'last' command, removes empty lines, gets just the first field ($USERNAME), sort the $USERNAMES in reverse order and then gives a summary count of unique matches. Show Sample Output
Insert a comma where necessary when counting large numbers. I needed to separate huge amounts of packets and after 12+ hours of looking in a terminal, I wanted it in readable form. Show Sample Output
(WARN) This will absolutely not work on all systems, unless you're running large, high speed, hardware RAID arrays. For example, systems using Dell PERC 5/i SAS/SATA arrays. If you have a hardware RAID array, try it. It certainly wont hurt.
You may be can test the speed disk with some large file in your system, before and after using this:
time dd if=/tmp/disk.iso of=/dev/null bs=256k
To know the value of block device parameter known as readahead.
blockdev --getra /dev/sdb
And set the a value 1024, 2048, 4096, 8192, and maybe 16384... it really depends on the number of hard disks, their speed, your RAID controller, etc. (see sample)
Show Sample Output
Sometimes, in a shell script, you need a random number bigger than the range of $RANDOM. This will print a random number made of four hex values extracted from /dev/urandom. Show Sample Output
I put this in a shell script called "svndiff", as it provides a handy decorated "svn diff" output that is colored (which you can't see here) and paged. The -r is required so less doesn't mangle the color codes. Show Sample Output
Blacklisted is a compiled list of all known dirty hosts (botnets, spammers, bruteforcers, etc.) which is updated on an hourly basis. This command will get the list and create the rules for you, if you want them automatically blocked, append |sh to the end of the command line. It's a more practical solution to block all and allow in specifics however, there are many who don't or can't do this which is where this script will come in handy. For those using ipfw, a quick fix would be {print "add deny ip from "$1" to any}. Posted in the sample output are the top two entries. Be advised the blacklisted file itself filters out RFC1918 addresses (10.x.x.x, 172.16-31.x.x, 192.168.x.x) however, it is advisable you check/parse the list before you implement the rules Show Sample Output
Searching for a String in Multiple Files With Grep Show Sample Output
Locate broken symlinks in the current directory. Also useful, to remove broken links:
find . -type l ! -exec test -e {} \; -print0 | xargs -0 rm
I used this to cut down the file size of a 1gb .avi to about 200mb without sacrificing much quality.
Test your XFS filesystem and Raptor hard drives for write performance.
Test your XFS filesystem and Raptor hard drives for write performance.
List only hidden files (or directories). You also can use:
ls -lad .*
Would be better if gnome-open would accept std in Should be doable in KDE - anyone?
Sees if two records differ in their entries, irrespective of order.
I've got this posted in one of my .bash_profiles for humor whenever I log in. Show Sample Output
This will give you the Dell Service tag number associated with your machine. Incredibly useful when you need that number for tech support or downloads. Show Sample Output
This command tar?s up a directory and sends the output to gzip, showing a rate of 223MB/s.
This may require you installing the pv command.
For debian based users out there:
sudo aptitude install pv
Show Sample Output
Sets the Open Firmware to ask for password when selecting a boot volume other then the hd
commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.
Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.
» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10
Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):
Subscribe to the feed for: