Commands by johnquail (3)

  • This command will: 1. open an SSH tunnel to 2. go to background 3. wait for 10 seconds for the connection 4. during the 10 seconds wait it will localy run 'rdesktop' to connect to the remote host through the created SSH tunnel. Password-less log in can be achieved (when server allows it) by adding '-p ' to the 'rdesktop' command

    ssh -f -L3389:<RDP_HOST>:3389 <SSH_PROXY> "sleep 10" && rdesktop -T'<WINDOW_TITLE>' -uAdministrator -g800x600 -a8 -rsound:off -rclipboard:PRIMARYCLIPBOARD -5 localhost
    johnquail · 2011-07-14 05:48:06 0
  • This command 1. SSH into a machine 2. Tunnels VNC port to your local computer ("-L 5900:localhost:5900") 3. Runs a single use vnc server ("x11vnc -safer -localhost -nopw -once -display :0") 4. Goes into the background ("-f") 5. Runs VNC viewer on the local computer connecting to the remote machine via the newly created SSH tunnel ("vinagre localhost:5900")

    ssh -f -L 5900:localhost:5900 your.ssh.server "x11vnc -safer -localhost -nopw -once -display :0"; vinagre localhost:5900
    johnquail · 2010-12-29 08:41:10 2
  • The linux package imagmagick is required for this command

    convert -adjoin -page A4 *.jpeg multipage.pdf
    johnquail · 2009-03-12 14:49:18 1

What's this? 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

Convert AVI to iPhone MP4

Socksify any program to avoid restrictive firwalls
Require: - tsocks (deb pkg) - A working SOCKS proxy. It's easy with ssh: $ ssh -N -D localhost:1080 your.home.pc -p 443 - tsocks configuration in your /etc/tsocks.conf (for the previous): server = server_port = 1080

Recursively execute command on directories (.svn, permissions, etc)
The above command will set the GID bit on all directories named .svn in the current directory recursively. This makes the group ownership of all .svn folders be the group ownership for all files created in that folder, no matter the user. This is useful for me as the subversion working directory on my server is also the live website and needs to be auto committed to subversion every so often via cron as well as worked on by multiple users. Setting the GID bit on the .svn folders makes sure we don't have a mix of .svn metadata created by a slew of different users.

Perform a reverse DNS lookup
Performs a reverse DNS lookup, variants include: $ nslookup or: $ host

Sort file greater than a specified size in human readeable format including their path and typed by color, running from current directory
1. find file greater than 10 MB 2. direct it to xargs 3. xargs pass them as argument to ls

a function to find the fastest DNS server gives a list of online dns servers. you need to change the country in url (br in this url) with your country code. this command need some time to ping all IP in list.

Find the package that installed a command

Test how well a web server handles concurrent connections and big load.
This command will execute 1000 requests to the http URL handlink 100 concurent connections at a time. Then it will display statistics about the time that have been taken.

Copy recursivelly files of specific filetypes
Copying only wmv and mpg files recursively from to

Remove multiple same rpm packages
If somehow if you get more than 1 same name rpm package install, then it cannot be removed by using simple rpm -e as it gives you more than one rpm matches error. The --matches will help to remove all the same name rpm packages.

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.


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: