Check These Out
Finds all directories containing more than 99MB of files, and prints them in human readable format. The directories sizes do not include their subdirectories, so it is very useful for finding any single directory with a lot of large files.
I used to use the Firefox "View page info" feature a lot to determine how stale the web page I was looking at was. Now that I use mostly Chrome I miss that feature, so here is a command line alternative using wget. The -S says to display the server response, the --spider says to not download any files/pages, just fetch the header. The output goes to stderr, so to grep it you use 2>&1 to combine the stderr stream with stdout, the pipe that to grep for Last-Modified.
You can use curl instead if you have it installed, like this:
$ curl --head -s http://osswin.sourceforge.net | grep Mod
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.
The output of lsof is piped to txt2html which converts it to html.
# Perl module HTML::TextToHTML needed
I often use it to find recently added ou removed device, or using find in /dev, or anything similar.
Just run the command, plug the device, and wait to see him and only him
This command will log the output of your simple cronjobs to syslog, and syslog will take it from there. Works great for monitoring scripts which only produce simple output.
Advantages:
* This can be used by regular users, without modifying system files like /etc/syslog.conf
* Reduce cron spam to root@localhost (Please stop spaming the sysadmins)
* Uses common tools like syslog (and logrotate) so that you don't need to maintain yet another krufty logfile.
* Still ensures that the output is logged somewhere, for posterity. Perhaps it's stored the secure, central syslog server, for example.
* Seems to work fine on Ubuntu, CentOS, FreeBSD & MacOSX
When I'm testing some scripts or programs, they end up using more memory than anticipated. In that case, computer nearly halts due to swap space usage, and sometimes I have to press Magic SysRq+REISUB to reboot.
So, I was looking for a way to limit memory usage per script and found out that ulimit can limit memory. If you run it this way:
$ $ ulimit -v 1000000
.
$ $ scriptname
Then the new memory limit will be valid for that shell. I think changing the limit within a subshell is much more flexible and it won't interfere with your current shell ulimit settings.
note: -v 1000000 corresponds to approximately 1GB of RAM
Converts any number of seconds into days, hours, minutes and seconds.
sec2dhms() {
declare -i SS="$1"
D=$(( SS / 86400 ))
H=$(( SS % 86400 / 3600 ))
M=$(( SS % 3600 / 60 ))
S=$(( SS % 60 ))
[ "$D" -gt 0 ] && echo -n "${D}:"
[ "$H" -gt 0 ] && printf "%02g:" "$H"
printf "%02g:%02g\n" "$M" "$S"
}