Commands by Kysic (1)

  • Solution to activate (or deactivate with false instead of true) the global mandatory proxy under Ubuntu (not tested elsewhere). Others keys you can configure : gconftool-2 --set "/system/http_proxy/host" --type string " gconftool-2 --set "/system/http_proxy/port" --type int 8080 gconftool-2 --set "/system/http_proxy/ignore_hosts" --type list --list-type string ["localhost","","*.local"] gconftool-2 --set "/system/proxy/mode" --type string manual

    gconftool-2 --set "/system/http_proxy/use_http_proxy" --type boolean true
    Kysic · 2009-02-13 22:00:52 0

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

Are there any words in the English language that use at least half of the alphabet without repeating any letters?
This is the most straightforward approach: first regexp limits dictionary file to words with thirteen or more characters, second regexp discards any words that have a letter repeated. (Bonus challenge: Try doing it in a single regexp!)

cycle through a 256 colour palette
Rainbow, instead of greys

MSDOS command to check existance of command and exit batch if failed
This is a command to be used inside of MS-DOS batch files to check existence of commands as preconditions before actual batch processing can be started. If the command is found, batch script continues execution. If not, a message is printed on screen, script then waits for user pressing a key and exits. An error message of the command itself is suppressed for clarity purpose.

check open ports without netstat or lsof

Remove all old kernels

List open files that have no links to them on the filesystem
I have come across a situation in the past where someone has unlinked a file by running an 'rm' command against it while it was still being written to by a running process. The problem manifested itself when a 'df' command showed a filesystem at 100%, but this did not match the total value of a 'du -sk *'. When this happens, the process continues to write to the file but you can no longer see the file on the filesystem. Stopping and starting the process will, more often than not, get rid of the unlinked file, however this is not always possible on a live server. When you are in this situation you can use the 'lsof' command above to get the PID of the process that owns the file (in the sample output this is 23521). Run the following command to see a sym-link to the file (marked as deleted): $ cd /proc/23521/fd && ls -l Truncate the sym-link to regain your disk space: $ > /proc/23521/fd/3 I should point out that this is pretty brutal and *could* potentially destabilise your system depending on what process the file belongs to that you are truncating.

Check if you work on a virtual/physical machine in Linux
Command used to know if we are working on a virtual or physical machine. This command will use the dmidecode utility to retrieve hardware information of your computer via the BIOS. Run this command as root or with sudo.

Make anything more awesome
Pipe any command through figlet to make the output more awesome. Example: $ ls | figlet

Create a 5 MB blank file via a seek hole
Similar to the original, but is much faster since it only needs to write the last byte as zero. A diff on testfile and will return that they are the same.

list files recursively by size

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: