Install Ksuperkey one command in Kubuntu. You must manually add ksuperkey to autostart in System Settings KDE.
Convert an SVG to PNG and then crush the filesize brutally with pngcrush. Good for icons and website junk that you want to keep small, expecially before base64 encoding.
Uses inkscape, not imagemagick, as IM doesn't always handle gradients well. This way also seems to sometime save some file size (eg. 619 with Inkscape compared to 695 with IM).
IM can do general images:
img2png(){ png="${1%.*}.png"; convert -background none "$1" "$png" && pngcrush -brute -rem alla -rem text "$png" "$png.new" && mv "$png.new" "$png"; }
For some reason split will not let you add extension to the files you split. Just add this to a .sh script and run with bash or sh and it will split your text file at 12000 lines for each file and then add a .sql extension to the file name.
This command will replace spaces in filename with number
Requires ImageMagick. Extracts date taken from image and renames it properly. Based on StackOverflow answer. Show Sample Output
A very simple command to toggle Chrome?s default style sheet. It uses the test command to see if the "Custom.css.off" file exists, if so, it will become "Custom.css", and if not, "Custom.css" is moved to "Custom.css.off" Thus, swapping. This is accomplished with "&&" and "||"
I wrote a script to make it a bit easier and more flexable: #!/bin/bash #By GrouchyGaijin # Hard part (lines 15 and 21) by Vaphell #Last Updated: 04-Oct-2013 (Friday - yes see what I do on Firday nights) @ 23:37 #Put this in path and call it by typing batchrename in the terminal #Version 0.3 echo "This script is for batch renaming files." read -p "Enter the path to the folder containing the files. " path cd $path read -p "Enter the file extension. " extension echo "Press N if you want to use a new name or D if you want to use the date" read x if [ "$x" = "D" ] then i=1; for f in *; do mv -- "$f" "$( printf "$( date +%d-%b-%Y )-%04d.$extension" $i )"; ((i++)); done fi if [ "$x" = "N" ] then read -p "Enter the new base name: " new_name i=1; for f in *; do mv -- "$f" "$( printf "$new_name-%04d.$extension" $i )"; ((i++)); done fi #OK S11 - change this to Thunar nautilus $path
If you want to test output, run it like this: for fn in *.epub; do echo mv \"$fn\" \"`echo "$fn" | sed -E 's/\.*\/*(.*)( - )(.*)(\.[^\.]+)$/\3\2\1\4/' | sed -E 's/(.*) ([^ ]+)( - )(.*)/\2, \1\3\4/' `\";done > rename.txt Show Sample Output
Renames all files in the following format xxxxxx - 34. yyyyy.mp4 to the following format xxxxxx S1E34 - yyyyy.mp4
Sometimes I get FLAC files that RhythmBox can't play but VLC can. So I re-encode them using GStreamer at highest compression.
Downloads this raw script https://github.com/git/git/blob/master/contrib/completion/git-completion.bash from Github, copies it to your home directory, autoloads it in ~/.bashrc and sources it.
Find all books on my systems and move them into folder. The -0 switches are to handle spaces etc. in the filenames. Why would you need this? Locate uses an index, so it's super quick, and xargs is more elegant than a for loop.
rename all dirs with "?" char in name, leave spaces and () in place Show Sample Output
https://www.magnatune.com depends on unp but does not need to but unp is the easiest way to unpack any archive. it's in Debian repo's. !note: it deletes flac zip when done, if successful. Show Sample Output
I still don't know why mutt (or offlineimap or whatever in between), is borking the encoding of my files, but this fixes it. Show Sample Output
Replace VM directory and file prefix with new prefix Once the the file names are updated the config files will need to be updated using command similar to the following: sed -i -- 's/original_/new_/g' *.vmx sed -i -- 's/original_/new_/g' *.vmxf sed -i -- 's/original_/new_/g' *.file.vmdk sed -i -- 's/original_/new_/g' *_file_1.vmdk
I had trouble with accent I could do a simple mv by hand but it is not efficient. I found this online http://www.unix.com/shell-programming-and-scripting/158635-remove-spanish-accent-file-name.html but I could not specify the accented letter direcly because it is not in the same encoding as my cli so I changed the char for their octal value. to add accent I use this table http://linux.about.com/library/cmd/blcmdl7_iso_8859-1.htm and add the values to the tr part. the other "duplicates" where not working for me. comment to help me better this script. :) Show Sample Output
Works with any file name: space, ', " and even \n is OK. The code in {= =} is a perl expression.
This oneliner will allow you to strip the part of names in a bunch of files. I needed this to rename songs names. Show Sample Output
This oneliner will remove the number which begins a filename.
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: