Commands by o6291408 (12)

  • You can use this on your session login.


    6
    VBoxManage startvm "name"
    o6291408 · 2009-05-05 13:23:26 6
  • You can use this in a script which rotates wallpapers from a directory at each login.


    2
    gconftool-2 -t string -s /desktop/gnome/background/picture_filename <path_to_image>
    o6291408 · 2009-04-29 11:19:29 9
  • Do you have an entire album in a unique file and want to split it in individual tracks? If you also have the cue file you can do it! Packages for Debian-based systems users: * cuetools shntool * FLAC (.flac): flac * WavPack (.wv): wavpack * Monkey's Audio (.ape): libmac2 monkeys-audio (deb http://www.debian-multimedia.org sid main) NOTE: "sid" packages are unstable, but I didn't have problems with them. If you prefer, use the "stable" version repository. To transfer the tags, you can use this (works with .flac, .ogg and .mp3): cuetag sample.cue split-track*.flac Show Sample Output


    5
    cuebreakpoints <cue file> | shnsplit -o <lossless audio type> <audio file>
    o6291408 · 2009-04-29 10:42:57 4
  • The title is optional. Options: -t: expire time in milliseconds. -u: urgency (low, normal, critical). -i: icon path. On Debian-based systems you may need to install the 'libnotify-bin' package. Useful to advise when a wget download or a simulation ends. Example: wget URL ; notify-send "Done"


    46
    notify-send ["<title>"] "<body>"
    o6291408 · 2009-04-29 10:05:20 20
  • Start screen in detached mode, i.e., already running on background. The command is optional, but what is the purpose on start a blank screen process that way? It's useful when invoking from a script (I manage to run many wget downloads in parallel, for example).


    16
    screen -d -m [<command>]
    o6291408 · 2009-04-28 12:35:25 22
  • Sometimes Firefox crashes or is bad finished and the message the process is still running appear while it's not. This also works when you sharing account from a NIS server and try to open the browser on multiple computers.


    7
    rm ~/.mozilla/firefox/<profile_dir>/.parentlock
    o6291408 · 2009-04-28 12:15:58 7
  • This command is useful when you want to install the same packages on another fresh OS install for example. To do that, use: sudo dpkg --set-selections < LIST_FILE Show Sample Output


    11
    dpkg --get-selections > LIST_FILE
    o6291408 · 2009-03-28 17:45:29 12
  • Packages: gmailfs fuse-utils libfuse2 gvfs-fuse Config files: /etc/gmailfs/gmailfs.conf; ~/.gmailfs.conf (make a copy from the another one) Unmount: fusermount -u /mount/path/ /etc/fstab (Optional): none /mount/path/ gmailfs noauto,user[,username=USERNAME,password=PASSWORD,fsname=VOLUME] 0 0 NOTES: - The options between [] are optional since they already setuped on the config files. - The '-p' flag shows a prompt for the password entry. - It's necessary to add the user to the 'fuse' group. You can do that with: sudo chgrp fuse /dev/fuse and sudo usermod -a -G fuse USER - The volume name is not needed but highly recommended to avoid file corruption. Also choose a non-trivial name. - Google doesn't approve the use of Gmail account other than e-mail purposes. So, I recommend the creation of a new account for this.


    5
    mount.gmailfs none /mount/path/ [-o username=USERNAME[,password=PASSWORD][,fsname=VOLUME]] [-p]
    o6291408 · 2009-03-28 13:00:47 5
  • To install a theme use: sudo firefox -install-global-theme /path/to/theme You can get the .xpi or .jar file from the versions history on the add-on/theme page. NOTE: may not work in your system (Debian-based is an example).


    17
    sudo firefox -install-global-extension /path/to/add-on
    o6291408 · 2009-03-28 11:11:12 9
  • Not so useful. Just a cool feature.


    7
    mplayer -vo aa <video file>
    o6291408 · 2009-03-28 10:01:56 9
  • The download content part. NOTE: the '-c' seems to not work very well and the download stuck at 99% sometimes. Just finish wget with no problem. Also, the download may restart after complete. You can also cancel. I don't know if it is a wget or Rapidshare glitch since I don't have problems with Megaupload, for example. UPDATE: as pointed by roebek the restart glitch can be solved by the "-t 1" option. Thanks a lot.


    6
    wget -c -t 1 --load-cookies ~/.cookies/rapidshare <URL>
    o6291408 · 2009-03-28 09:13:35 5
  • In order to do that, first you need to save a cookie file with your account info. These commands do it (maybe you need to create the '.cookies' dir before). Also, you need to check the "Direct downloads" option on the Premium Zone >> Settings tab. You need to do this once (as long you maintain the file or your Rapidshare Premium account).


    4
    wget --save-cookies ~/.cookies/rapidshare --post-data "login=USERNAME&password=PASSWORD" -O - https://ssl.rapidshare.com/cgi-bin/premiumzone.cgi > /dev/null
    o6291408 · 2009-03-28 09:12:02 7

What's this?

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.

Share Your Commands


Check These Out

Which processes are listening on a specific port (e.g. port 80)
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"

Rename files in batch

Download an Entire website with wget

Set laptop display brightness
Run as root. Path may vary depending on laptop model and video card (this was tested on an Acer laptop with ATI HD3200 video). $ cat /proc/acpi/video/VGA/LCD/brightness to discover the possible values for your display.

Get AWS temporary credentials ready to export based on a MFA virtual appliance
You might want to secure your AWS operations requiring to use a MFA token. But then to use API or tools, you need to pass credentials generated with a MFA token. This commands asks you for the MFA code and retrieves these credentials using AWS Cli. To print the exports, you can use: `awk '{ print "export AWS_ACCESS_KEY_ID=\"" $1 "\"\n" "export AWS_SECRET_ACCESS_KEY=\"" $2 "\"\n" "export AWS_SESSION_TOKEN=\"" $3 "\"" }'` You must adapt the command line to include: * $MFA_IDis ARN of the virtual MFA or serial number of the physical one * TTL for the credentials

a short counter
Maybe you know shorter ?

Log colorizer for OSX (ccze alternative)
Download colorizer by @raszi @ http://github.com/raszi/colorize

add all files not under version control to repository
This should handle whitespaces well and will not get confused if your filenames have "?" in them

Sort netflow packet capture
Sort netflow packet capture by unique connections excluding source port.

back ssh from firewalled hosts
host B (you) redirects a modem port (62220) to his local ssh. host A is a remote machine (the ones that issues the ssh cmd). once connected port 5497 is in listening mode on host B. host B just do a ssh 127.0.0.1 -p 5497 -l user and reaches the remote host'ssh. This can be used also for vnc and so on.


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: