pipe into | sed "s/$/\/(1024\*1024\*1024)/" | bc to get size in GB
Depending on the installation only certain of these man pages are installed. 12 is left out on purpose because ISO/IEC 8859-12 does not exist. To also access those manpages that are not installed use opera (or any other browser that supports all the character sets involved) to display online versions of the manpages hosted at kernel.org:
for i in $(seq 1 11) 13 14 15 16; do opera http://www.kernel.org/doc/man-pages/online/pages/man7/iso_8859-$i.7.html; done
This takes quite a while on my system. You may want to test it out with /bin first, or background it and keep working.
If you want to get rid of the "No manual entry for [whatever]" and just have the [whatever], use the following sed command after this one finishes.
sed -n 's/^No manual entry for \(.*\)/\1/p' nomanlist.txt
Show Sample Output
this will dump a list of domains one per line into a text file
an extension of command 9986 by c3w, allows for link text. http://google.com,search engine will link the hyperlink with the text after the url instead of linking with the url as linktext Show Sample Output
xargs avoids having to remember the "{} \;" (although definitely a useful thing to know. Unfortunately I always forget it). xargs version runs 2x faster on my test fwiw. edit: fixed to handle spaces in filenames correctly.
Broken in two parts, first get the number of cores with cat /proc/cpuinfo |grep proc|wc -l and create a integer sequence with that number (xargs seq), then have GNU parallel loop that many times over the given command. Cheers! Show Sample Output
Imports a backed up or exported virtual machine into XenServer
You are probably aware that some percent of disk space on an ext2/ext3 file system is reserved for root (typically 5%). As documented elsewhere this can be reduced to 1% with
tune2fs -m 1 /dev/sdX (where X = drive/partition, like /dev/sda1)
but how do you check to see what the existing reserved block percentage actually is before making the change? You can find that with
dumpe2fs -h /dev/sdX
You get a raw block count and reserved block count, from which you can calculate the percentage. In the example here you can easily see that it's currently 1%, so you won't get any more available space by setting it to 1% again.
FYI If your disks are IDE instead of SCSI, your filesystems will be /dev/hdX instead of /dev/sdX.
Show Sample Output
This will allow you to mount a CD-ROM on Solaris SPARC 9 or lower. This will not work on Solaris 10 due to void and the volume management daemons. www.fir3net.com
Mount a Windows share. Usually the IP is needed for the $ip_or_host option. Getting hostnames working on a local network never seems to work.
wrap it in a function if you like...
lastfile () { ls -ltp | sed '1 d' | head -n1 }
Show Sample Output
Connect EC2 server with public keys "/root/.ec2/id_rsa-gsg-keypair" or "/root/.ec2/keypair.pem"
You know there 'cd -' to go to the previous directory you were standing before, but it will no record more than one. With these alias you can now record all your directory changes and go back whenever you need it. However you will have to get accustomed to use 'cd ~' from now on to go to your home directory.
full command:
for fn in xkcd*.png xkcd*.jpg; do; echo $fn; read xw xh <<<$(identify -format '%w %h' $fn); nn="$(echo $fn | sed 's/xkcd-\([0-9]\+\)-.*/\1/')"; wget -q -O xkcd-${nn}.json http://xkcd.com/$nn/info.0.json; tt="$(sed 's/.*"title": "\([^"]*\)", .*/\1/' xkcd-${nn}.json)"; at="$(sed 's/.*alt": "\(.*\)", .*/\1/' xkcd-${nn}.json)"; convert -background white -fill black -font /usr/share/fonts/truetype/freefont/FreeSansBold.ttf -pointsize 26 -size ${xw}x -gravity Center caption:"$tt" tt.png; convert -background '#FFF9BD' -border 1x1 -bordercolor black -fill black -font /usr/share/fonts/truetype/freefont/FreeSans.ttf -pointsize 16 -size $(($xw - 2))x -gravity Center caption:"$at" at.png; th=$(identify -format '%h' tt.png); ah=$(identify -format '%h' at.png); convert -size ${xw}x$(($xh+$th+$ah+5)) "xc:white" tt.png -geometry +0+0 -composite $fn -geometry +0+$th -composite at.png -geometry +0+$(($th+$xh+5)) -composite ${fn%\.*}_cmp.png; echo -e "$fn $nn $xw $xh $th $ah \n$tt \n$at\n"; done
this assumes that all comics are saved as xkcd-[number]-[title].{png|jpg}.
it will then download the title and alt-text, create pictures from them, and put everything together in a new png-file.
it's not perfect, but it worked for nearly all my comics.
it uses the xkcd-json-interface.
though it's poorly written, it doesn't completely break on http://xkcd.com/859/
Connect EC2 server with public keys "/root/.ec2/id_rsa-gsg-keypair" or "/root/.ec2/keypair.pem"
List all files in a directory in reverse order by modified timestamp. When piped through tail the user will see the most recent file name.
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: