Listing installed Perl Modules
Simple one line command for listing all installed Perl modules
-
perl -MExtUtils::Installed -e'my $inst = ExtUtils::Installed->new(); print $_, $/ for $inst->modules'
Listing installed Perl Modules
Simple one line command for listing all installed Perl modules
Another simple script I've written and use often (actually runs via cron every 5 minutes) to verify the contents of a particular page to determine of it has changed for any reason like a webserver cracked/hacked or if the dynamic content is not what is expected.
In this case it is specifically monitoring a page from a PeopleSoft application that I do not entirely trust, if the content doesn't match my checksum that generally means the Tuxedo application server is hosed and needs to be restarted.
Easily adapted to fit your particular needs, is use it on all of my public websites that are on shared hosting accounts etc...
Comments for bigger sections are thrown in to give you an idea of what to tweak for your needs, remember to update $file2 with a new copy of the markup if you modify the landing page you are monitoring!
Finding large files on Linux/Unix
Depending on how you build your filesystem, locating large files such as logs or other output from scripts, programs, or daemons can be frustrating at best. Since I'm not a GUI kind of guy this little snippet for the shell can save tons of time. (tested with KSH and Bash shells, likely should work with most if not all)
This will search beginning at the root / directory for all files over 20M. To adapt it for your use simply change the / to represent any beginning path you wish and the 20000k to the minimum filesize you would like to find.
Hard to get any easier than this. A detailed description of the all powerful awk can be found by reading the associated man pages should you be so inclined.
Happy hacking!
Occasionally recurring jobs will get hung, especially with jobs fired off from cron that are scheduled to run every minute. In my case there is a job that runs every minute to pick up status files from numerous remote servers, the script gets the files, parses them, and then plugs them into a MySQL database. That data is later parsed on demand by a php page to display different status information about the remote servers. All in all it works quite well, until something gets hung, especially if the NFS mount for the database has a hiccup, once the first database connect hangs it tends to hang the subsequent jobs as well... quickly filling up the available memory and of course crashes or hangs any other web pages trying to access the database.
A quick and dirty way to right things without typing or copy/pasting a bazillion pids to a kill -9
Nothing magical about it, the for loop scans the output from the ps command for the process_name, awk parses out the pid #, the loop performs a kill -9 for each pid returned.
Like I mentioned, nothing magical about it, but a quick efficient method of killing what can be hundreds of processes.
Happy hacking!
Another surprise development by Sun, paying out $1 billion to aquire MySQL, that's reported to be $800K in cash and $200K in options. Rumor had it that Oracle has been trying to aquire MySQL a number of times in the past however they would not sell out to the database holding giant. Likely fearing that it would be squashed or strangled into non-existance or having licensing fees placed on the millions of open source community users.
Sun, having no other real database offering stands to be in a great position in the Open Source community. History shows Sun is willing to stand up for open source projects, MySQL developers should be allowed to continue development to improve the already stable database platform with new funding.
MySQL has a very proven track record with LAMP, which stands for Linux, Apache, MySQL, and PHP as the leading webserver platform used all over the world. No other OS platform can match the performance and stability of LAMP proven time and again in native Linux enviroments. It has forever changed the landscape of the internet as a whole, for large web hosting companies and the general developer.
As reported by ComputerWorld and more details can be found here.