Scripts

Disclaimer

This is some of the scripts I’ve written which I think may be of interest to others. Some of these scripts are written in BASH and some are written in Perl. I wrote these scripts because I couldn’t find any other decent tools to do what I wanted.

** DISCLAIMER **
These scripts are made available ‘as is’ without any warranty. Any tips or improvements are welcome. The scripts probably work on most distributions, but have been tested in Debian-based distributions.

 


[download id=”13″ format=”scripts”]

Netports can be used to list your current network listening ports and the applications owning them, including the PID of this application and the PID:s of any child processes and the name of the user owning the process. Here is a screenshot to see what it may look like:

netports in action

 


[download id=”6″ format=”scripts”]

This perl-script is based on the shell-command ‘du’. It takes one or more files or dirs as arguments, and shows them in human readable format and ascending order based on their size. This means the biggest files will show up last, much like you want to when looking for the biggest disk hogs.

The main difference to using du -sh is the output, sorted but still in human readable format, looking like this:

[eek@narcissus [17:42:44] ~]$ howbig /var/* 2>/dev/null
0K  /var/crash
0K  /var/local
0K  /var/lock
0K  /var/opt
0K  /var/run
4K  /var/www
12K  /var/mail
5.1M  /var/backups
122.4M  /var/log
122.6M  /var/spool
217.2M  /var/tmp
268.2M  /var/cache
347.5M  /var/lib

 


[download id=”7″ format=”scripts”]

This perl-script displays a list of the filenames and names of your favorite ROMs specified in the MAMEWAH GUI. This script could probably work in Windows as well, although this haven’t been tested. You can specify a default file to use with the script or you can pass a filename as a parameter to the script. This is what the running script looks like:

mamefavs in action