Hide

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again.

Delete that bloated snippets file you've been using and share your personal repository with the world. 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.


If you have a new feature suggestion or find a bug, please get in touch via http://commandlinefu.uservoice.com/

Get involved!

You can sign-in using OpenID credentials, or register a traditional username and password.

First-time OpenID users will be automatically assigned a username which can be changed after signing in.

Hide

Stay in the loop…

Follow the Tweets.

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

Subscribe to the feeds.

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:

Hide

News

2011-03-12 - Confoo 2011 presentation
Slides are available from the commandlinefu presentation at Confoo 2011: http://presentations.codeinthehole.com/confoo2011/
2011-01-04 - Moderation now required for new commands
To try and put and end to the spamming, new commands require moderation before they will appear on the site.
2010-12-27 - Apologies for not banning the trolls sooner
Have been away from the interwebs over Christmas. Will be more vigilant henceforth.
2010-09-24 - OAuth and pagination problems fixed
Apologies for the delay in getting Twitter's OAuth supported. Annoying pagination gremlin also fixed.
Hide

Tags

Hide

Functions

GRUB2: set Super Mario as startup tune

Terminal - GRUB2: set Super Mario as startup tune
echo "GRUB_INIT_TUNE=\"1000 334 1 334 1 0 1 334 1 0 1 261 1 334 1 0 1 392 2 0 4 196 2\"" | sudo tee -a /etc/default/grub > /dev/null && sudo update-grub
2011-04-12 12:47:04
User: stanix
Functions: echo sudo tee
22
GRUB2: set Super Mario as startup tune

Alternatives

There are 8 alternatives - vote for the best!

Terminal - Alternatives
sudo bash -c 'echo "GRUB_INIT_TUNE=\"480 165 2 165 2 165 3 554 1 587 1 554 2 370 1 554 1 523 2 349 1 523 1 494 3 165 2 165 2 165 2\"" >> /etc/default/grub && update-grub'
2011-05-02 12:06:49
User: slayer_ftw
Functions: bash sudo
3

I'll let Slayer handle that. Raining Blood for your pleasure.

Know a better way?

If you can do better, submit your command here.

What others think

untested, but if this works, the awesomeness could only be exceeded by changing the startup tune to the imperial death march

Comment by linuxrawkstar 178 weeks and 6 days ago

Can anyone confirm if this works?

Comment by leovailati 178 weeks and 6 days ago

This feature is documented at https://help.ubuntu.com/community/Grub2 , so it's for real. It is worth pointing out that the docs say that the Grub menu will not be displayed until after the music is done playing. Be aware of this when composing long into tunes.

Comment by smithadmin 178 weeks and 6 days ago

yes, it works!

Comment by cd1 178 weeks and 5 days ago

Does this work in Fedora14?

Comment by dtolj 178 weeks and 3 days ago

@dtoli if you hav grub2 installed then yes!

What I'm interested in knowing is, will it work in burg? I'm going to try it out later.

Comment by sinisterstuf 178 weeks and 2 days ago

@sinisterstuf: it works for burg

replace grub by burg and it will work

Comment by halohell 178 weeks and 1 day ago

Found elsewhere: GRUB_INIT_TUNE="480 900 2 1000 2 800 2 400 2 600 3" for the "Close Encounters" greeting message. Sure would be nice to cat /dev/dsp somehow to test these tunes without rebooting.

Comment by Mozai 177 weeks ago

"sure would be nice to ..." Ha! instead of waiting, I figured it out myself. Pity that the GRUB2 wiki is down, else I'd add it there. It's too long to be a one-liner; pity I can't use it to curry favour with this website.

tune="480 900 2 1000 2 800 2 400 2 600 3"; f="";tmpdir=$(mktemp -d);for d in $tune;do if [ ! "$t" ];then t=$d;elif [ ! "$f" ];then f=$d;else sox -U -r 8000 -n -t raw - synth $(echo "$d*(60/$t)"|bc -l) sine $f >>$tmpdir/grubtune.ul;f="";fi;done;sox -c1 -r 8000 $tmpdir/grubtune.ul $tmpdir/grubtune.au;play -q $tmpdir/grubtune.au;/bin/rm -r $tmpdir
Comment by Mozai 177 weeks ago

Hint: divide/multiply every second number by 2 to get a lower/higher octave :)

Comment by stanix 176 weeks and 4 days ago

Amazing. This worked like a charm

Comment by nssy 176 weeks ago

Star Wars Imperial Death March:

GRUB_INIT_TUNE="480 440 4 440 4 440 4 349 3 523 1 440 4 349 3 523 1 440 8 659 4 659 4 659 4 698 3 523 1 415 4 349 3 523 1 440 8"

Comment by Striek 171 weeks ago

:D

Comment by sputnick 170 weeks and 6 days ago

tee is used when you need to print to STDOUT _and_ a file. Using it with sudo like this just adds an unneeded program into the mix. The alternative, passing all the commands to sudo as a string to be execute by bash, is somewhat better but still awkward.

Comment by dbbolton 161 weeks and 1 day ago

Your point of view

You must be signed in to comment.

Related sites and podcasts