commandlinefu.com is the place to record those command-line gems that you return to again and again.
You can sign-in using OpenID credentials, or register a traditional username and password.
Subscribe to the feed for:
This takes a webcam picture every everytime the mouse is moved (waits 10 seconds between checking for movement) and stores the picture wherever you want it.
Use in conjunction with a dropbox type application to see who is using your computer
Use /dev/input/mice if /dev/input/mouse* doesn't work
Use the bones of this to make a simple screensaver
For instance, to add mongodb 10gen package
echo "deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen" | sudo tee -a /etc/apt/sources.list
Fix for ubuntu error:
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = "en_GB:en",
LC_ALL = (unset),
LANG = "en_GB.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
small update for this command to work with linux kernels 3.x
Bash snippet to force GNU/Linux keyboard settings, layout and configuration.
Usefull when some GNU/Linux distributions such as *Ubuntu's store only limited configation options due to demonstration purposes on LiveUSB or Live persistent devices.
Overcomes the English QWERTY to French AZERTY settings failure.
Code bash en ligne de commande pour forcer l'adoption du clavier AZERTY sur les cl? USB bootable en Ubuntu.
Like the original version except it does not include the parent apache process or the grep process and adds "sudo" so it can be run by user.
"That's it. Not much to see here. The first command writes any cache data that hasn't been written to the disk out to the disk. The second command tells the kernel to drop what's cached. Not much to it. This invalidates the write cache as well as the read cache, which is why we have the sync command first. Supposedly, it is possible to have some cached write data never make it to disk, so use it with caution, and NEVER do it on a production server. You could ... but why take the risk?
As long as you are running a post 2.6.16 kernel,..."
Mac install ssh-copy-id
From there on out, you would upload keys to a server like this:
(make sure to double quote the full path to your key)
ssh-copy-id -i "/PATH/TO/YOUR/PRIVATE/KEY" username@server
or, if your SSH server uses a different port (often, they will require that the port be '2222' or some other nonsense:
(note the double quotes on *both* the "/path/to/key" and "user@server -pXXXX"):
ssh-copy-id -i "/PATH/TO/YOUR/PRIVATE/KEY" "username@server -pXXXX"
...where XXXX is the ssh port on that server
similar to previous except this exports to a temporary file, opens that file with your default web browser, then deletes it.
first need to Edit the configuration file
and under the [tunnels] add this line
ciccio_diverso = /usr/bin/ssh -p 12345
Allows for manual set of the CPU's frequency. First look at "cpupower frequency-info" for all the available frequency steps your processor can be set at.
sudo cpupower frequency-set -f 1100MHz
Lets you change/set a governor to handle the frequency of your CPU.
Available governors are: "powersave", "conservative", "ondemand", "performance", and "userspace".
commandline for mac os x
echo '127.0.0.1 facebook.com' | sudo tee -a /etc/hosts
Do not execute this command if you don't know what you are doing.