Change the value of p to match the path where you wish to create the profile. To run it again in the future, use the parameter --user-data-dir (which gets echoed to you when run): chromium-browser --user-data-dir=/path/to/your/ Quick Functions: # create a new chromium profile new-chromium-profile() { p=~/.config/chromium/$1; cp -r ~/.config/chromium/Default $p && echo "chromium-browser --user-data-dir=$p" && chromium-browser --user-data-dir=$p; } # runs a chromium profile run-chromium-profile() { chromium-browser --user-data-dir=~/.config/chromium/$1; } Show Sample Output
Create a progress dialog with custom title and text using zenity. Show Sample Output
using seq inside a subshell instead of a bash sequence to create increments. Show Sample Output
A more robust password creation utility
# Create passwords in batch
makepasswd --char=32 --count=10
# To learn more about the options you can use
man makepasswd
Show Sample Output
Changes your desktop background image in gnome. Update the directory to wherever you keep your wallpapers. I like to create a sub-directory in my Wallpaper folder called "cycle" that I use to define the wallpapers I wish to loop in cron. ex:
gconftool-2 -t str -s /desktop/gnome/background/picture_filename "$(find ~/Wallpapers/cycle -type f | shuf -n1)"
Show Sample Output
Take a screenshot of the focused window with a 4 second countdown
# shorten by adding to your .bashrc: alias sss='scrot -ucd4 && eog $(ls -tr | tail -n1)'
echo -e "\nalias sss='scrot -ucd4 && eog $(ls -tr | tail -n1)'" >> ~/.bashrc
-d 4 second delay
-c display countdown
-u focused window
man scrot for more flags
Show Sample Output
requires "youtube-dl" -- sure you can do this with wget and some more obscurity but why waste your time when this great tool is available?
the guts consist of mplayer converting a video to a gif -- study this command and read the man page for more information
mplayer video.flv -ss 00:23 -endpos 6 -vo gif89a:fps=5:output=output.gif -vf scale=400:300 -nosound
generates a 6 second gif starting at 23 seconds of play time at 5 fps and a scale of 400x300
start time (-ss)/end time (-endpos) formats: 00:00:00.000
end time should be relative to start time, not absolute. i.e. -endpos 5 == seconds after 0:42 = 0:47 end point
play with fps and scale for lower gif sizes
the subshell is a solution for the -b flag on youtube-dl which downloads the best quality video, sometimes, which can be various video formats $(ls ${url##*=}*| tail -n1)
Show Sample Output
The above is an example of grabbing only the first column. You can define the start and end points specifically by chacater position using the following command:
while read l; do echo ${l:10:40}; done < three-column-list.txt > column-c10-c40.txt
Of course, it doesn't have to be a column, or extraction, it can be replacement
while read l; do echo ${l/foo/bar}; done < list-with-foo.txt > list-with-bar.txt
Read more about parameter expansion here:
http://wiki.bash-hackers.org/syntax/pe
Think of this as an alternative to awk or sed for file operations
The above is just a prove of concept based around the nested bash substitution. This could be useful in situations where you're in a directory with many filetypes but you only want to convert a few.
for f in *.bmp *.jpg *.tga; do convert $f ${f%.*}.png; done
or you can use ls | egrep to get more specific... but be warned, files with spaces will cause a ruckus with expansion but the bash for loop uses a space delimited list.
for f in $(ls | egrep "bmp$|jpg$|tga$"); do convert $f ${f%.*}.png; done
I'm guessing some people will still prefer doing it the sed way but I thought the concept of this one was pretty neat. It will help me remember bash substitutions a little better :-P
Show Sample Output
You need to have fortune and cowsay installed. It uses a subshell to list cow files in you cow directory (this folder is default for debian based systems, others might use another folder). you can add it to your .bashrc file to have it great you with something interesting every time you start a new session. Show Sample Output
This will be seen through your system's visual notification system, notify-osd, notification-daemon, etc. --- sleep accepts s,m,h,d and floats (date; sleep .25m; date) --- notify-send (-t is in milliseconds && -u low / normal / critical) man notify-send for more information --- notification-daemon can use b/i/u/a HTML
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: