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/
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.
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:
You need to install "sshpass" for this to work.
apt-get install sshpass
One time you logged in, you can prove these method just writing "firefox".
parallel can be installed on your central node and can be used to run a command multiple times.
In this example, multiple ssh connections are used to run commands. (-j is the number of jobs to run at the same time). The result can then be piped to commands to perform the "reduce" stage. (sort then uniq in this example).
This example assumes "keyless ssh login" has been set up between the central node and all machines in the cluster.
bashreduce may also do what you want.
Oneliner to run commands on multiple servers over ssh.
- First parameter "$1" is the command you want to execute remotely.
( It can be multiple commands e.g. "hostname;uptime")
- Second parameter "${@:2}" represents the remote host/s you want to run the command/s on.
This command will ask for remote sudo password before executing a remote command.
There must be no space between -p and the password
This is just a quick and dirty way to play remote audio files *locally* in your PC.
The best way is to mount the remote Music directory into the local FS, say by using sshfs:
sshfs user@remote:/remote/music/dir/ /mnt/other_pc/
cat didn't seem to work with binaries to well for me, the above command seemed to do the trick.
Opps should be pointed out its going through a "hop" box (which is why I was searching here in first place), only need the last bit (after the -t) if doing it directly from one box to another...
Alternative for machines without ssh-copy-id
Execute commands serially on a list of hosts. Each ssh connection is made in the background so that if, after five seconds, it hasn't closed, it will be killed and the script will go on to the next system.
Maybe there's an easier way to set a timeout in the ssh options...
Run this within a steady screen session.
You can get the approximate time when the remote server went down or other abnormal behavior.
Copies the complete root-dir of a linux server to another one, where the new harddisks formated and mountet. Very useful to migrate a root-server to another one.
This command adds your pem key to SSH so that you no longer have to manually specify it when connecting to EC2 instances.
# you can do this:
ssh ec2-instance.amazonaws.com
# instead of this:
ssh -i ~/.ssh/KEY_PAIR_NAME.pem ec2-instance.amazonaws.com
ssh compresion -C option ...
on slow connection VNC performs better but in local LAN native secure X protocol is an option
if you use tmux and wish to automatically reattach you previously detached sessions when logging in.