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:
Use it to send raw data to a networked device. Used to interact with relay controller board whose documentation is lost, so use wireshark to sniff the sent data and replayed using the command.
Sets the @ A record for your domain hosted by namecheap to your current internet-facing IP address, logs success or failure with syslog, and logs the data returned to /root/dnsupdate.
Change the XXX's as appropriate.
Really helpfull when play with files having spaces an other bad name. Easy to store and access names and path in just a field while saving it in a file.
This format (URL) is directly supported by nautilus and firefox (and other browsers)
xmas lights for your terminal - switching the $l value to something like 1200 and zooming out on your terminal gives a great view ...
one of the solutions from this stackexchange: http://unix.stackexchange.com/questions/71585/convert-ls-l-output-format-to-chmod-format
Sends log lines from murmur's (the mumble server's) logfile to syslog.
How much memory is chrome sucking?
`pwd` returns the current path
`grep -o` prints each slash on new line
perl generates the paths sequence: './.', './../.', ...
`readlink` canonicalizes paths (it makes the things more transparent)
`xargs -tn1` applies chmod for each of them. Each command applied is getting printed to STDERR.
The original command doesn't work for me - does something weird with sed (-r) and xargs (-i) with underscores all over...
This one works in OSX Lion. I haven't tested it anywhere else, but if you have bash, gpg and perl, it should work.
When you need a quick ref guide while troubleshooting Apache|NGINX error|access logs.
1.- Enter into the playlist path.
2.- Run the command.
3.- Playlists created!
Since none of the systems I work on have readlink, this works cross-platform (everywhere has perl, right?).
Note: This will resolve links.
This attempts to load a Perl Module (-M flag) and use version 9999, since no module has a version this high, Perl exits either a) telling you the version of the module installed or b) tells you it can't find the module.
This version uses a bash function and does not print the path to the module.
Will check if the given module is installed in the @INC. It will print the path and return 0 if found, or 1 otherwise.
Based on script from SharpyWarpy in http://www.linuxquestions.org/questions/linux-general-1/how-to-list-all-installed-perl-modules-216603/
find . = will set up your recursive search. You can narrow your search to certain file by adding -name "*.ext" or limit buy using the same but add prune like -name "*.ext" -prune
xargs =sets it up like a command line for each file find finds and will invoke the next command which is perl.
perl = invoke perl
-p sets up a while loop
-i in place and the .bak will create a backup file like filename.ext.bak
-e execute the following....
's/ / /;' your basic substitute and replace.
Using perl and tput, show all the colors with numbers that your actual $TERM can handle.
If want to remove the numbers at beginning of new line, it should be something like this:
perl -E 'say `tput setb $_`," "x `tput cols`, `tput sgr0` for 0 .. (`tput colors` - 1)'
Just another FizzBuzz in Perl.