Useful when you need to write e.g. an INSERT for a table with a large number of columns. This command will retrieve the column names and comma-separate them ready for INSERT INTO(...), removing the last comma.
I have a custmer's Geovision DVR installed on a closed proxi (only logme-in reaches it). I have to check for reliability but logmein hangs and is too slow a process I made the Geovision software send e-mail every minute to the www.spam.la site. All this script does is to retrieve the e-mail header from spam.la ( no login!), filtering sender, stopping at the first occurrence of the word "secs" ( the age of the last e-mail ). The result is the age of the sender's last e-mail, tiny published on top of my screen once a minute. I can refresh www.spam.la via web browser, but have other things to do. I use it inside Kalarm ( kde task schedule ) set to 1 minute repeat. It can be done without kalarm, using Watch outside the script. Try it out now using my account = geo1 ( change sender by geo1 in this script) Needs curl , osd-bin
don't have to be that complicated
Same thing just a different way to get there. You will need lynx
Tested on Solaris.
same thing as the other
awk extract every nth line. Generic is: awk '{if (NR % LINE == POSITION) print $0}' foo where "last" position is always 0 (zero). Show Sample Output
open a new tab in active gnome-terminal instance needs sudo apt-get install xdotool and sudo apt-get install wmctrl
Problem: you want to output one line per file. you can't just 'tr -d' because you want one line per file and you don't want to use a loop. Solution: use awk to print each line without the record separator and a newline after each file. Show Sample Output
I found Flash eating one of my CPUs after resume, the command above will help with that. For optional kicks you can put it into a script in /etc/pm/sleep.d/ (aspect in #swhack wrote this for me)
the command will not include hidden files Show Sample Output
This alternative cleans HISTTIMEFORMAT environment variable and calls gnuplot just after /tmp/cmds is closed, to avoid some errors.
This is an easy way to quickly get a status for a device in multipath on SLES systems, as long as the server is configured based on Novell's standards, where multipathed disks are referred to by /dev/disk/by-... tree. Make sure to replace name_of_vg with your Volume Group name.
'ac' is included in the package 'acct', which is described as "The GNU Accounting utilities for process and login accounting". Other interesting flags are:
* print statistics for a specified user
ac -d username
* print statistics for all the users
ac -p
With my command, the output is also printed in a sexagesimal, more readable, style.
Show Sample Output
Find your default gateway and print it directly output. http://www.bayner.com/ kerim@bayner.com Show Sample Output
Tested on CentOS, Ubuntu, and MacOS.
This will look through file and print the data in between the pattern matches. It's great for restoring tables from a mysqldump backup. You can then import it back into your database with:
mysql -u <user> -h <host> <database> < restored_table.sql
Shorter version with curl and awk
Require wmctrl and gpicker and an EWMH/NetWM compatible X Window Manager
commandlinefu.com 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.
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: