Commands by nanoscript (2)

  • 1st log (samba) has filters to omit annoying repetetive connections and messages about cups printer sharing, and ONLY show messages pertaining to connections to a samba service. Also requires Samba be configured to use a single logfile. use the path to your single samba logfile. 2nd log (for SSH) point to your /var/log/auth.log file. change path as needed. cron is filtered out to avoid looking at processes spawned by cron. which just eats up the screen unnecessarily. 3rd log (FTP), point at the logfile for your ftp daemon. assuming it uses a single file and does so neatly. multitail has lots of options. season to your tastes. this is a highly dumbed down version of the one liner I actually use for this, which incorporates several more logs, color options, window size options etc. depending how much garbage is generated by certain logs and what strings you ignore, when spawning this you may not see any previous log lines. this can be fixed using options like "-n [number]" to search back far enough to produce some lines. otherwise don't worry, it will display newly logged lines. --follow-all is used to follow filenames instead of descriptors. an important thing when following logfiles that rotate as most do.


    0
    multitail -D --follow-all -ev "cups" -ev "CUPS" -ev "AbusiveVMnameHere" -e "connect" -i /var/log/samba/yourUnifiedSambaLog -ev "cron" -i /var/log/auth.log -i /var/log/YourFTPlog
    nanoscript · 2015-01-18 05:03:18 8
  • The only requirement to make this work is some research on what your local NOAA "zone" is. One place to take a look is: http://www.nws.noaa.gov/mirs/public/prods/maps/pfzones_list.htm Show Sample Output


    0
    wget -q -O - http://weather.noaa.gov/pub/data/observations/state_roundup/ny/nyz003.txt http://weather.noaa.gov/pub/data/forecasts/zone/ny/nyz003.txt | less
    nanoscript · 2015-01-17 05:09:05 7

What's this?

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.

Share Your Commands


Check These Out

Compare two directory trees.
This uses Bash's "process substitution" feature to compare (using diff) the output of two different process pipelines.

Rename .JPG to .jpg recursively
This command is useful for renaming a clipart, pic gallery or your photo collection. It will only change the big caps to small ones (on the extension).

a function to find the fastest DNS server
http://public-dns.info gives a list of online dns servers. you need to change the country in url (br in this url) with your country code. this command need some time to ping all IP in list.

Which processes are listening on a specific port (e.g. port 80)
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"

See OpenVZ Container id's of top 10 running processes by %cpu
This command will list the PID, VEID, and Name of the 10 highest cpu using processes on a openvz host. You must have vzpid installed.

command to change the exif date time of a image

increase recursively the modification time for a list of files
Increase the modification date for the files selected with the find command.

Check the current price of Bitcoin in USD

Indent a one-liner.
Bash builtin type also indents the function.

Adding Prefix to File name


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.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

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: