CGI Perl scripts debugging (solve 500 Internal Server Error)

When you run your perl scripts in browser you would get “500 Internal Server Error” when something goes wrong. There would be several reasons of this but one thing to be done is to check if your perl script contains errors. To do it login to server you’re running perl script (I hope you use Linux ;] ) and execute command: /usr/bin/perl -w /path/to/script.cgi It will show debug information and […]

Read more →

 

Automatic "zombie" processes killing (shell script)

Here is a shell script example that can be run by cron for automatic killing of “zombie” processes in Linux system: zombies.sh

Read more →

 

Quick shell change for user in Unix or Linux

In order to change shell for a particular user of Unix/Linux system without editing /etc/passwd file manually just use command: chsh -s /path/to/shell username for example, to change shell to ‘sh’ from ‘bash’ for user ‘viper’, use command: chsh -s /bin/sh viper

Read more →

 

Encryption files with GPG without user intervention (batch)

I usually encrypt files with GPG with symmetric algorithms when I have to transmit files over insecure channel: for example I encrypt backup files stored at my USB stick and I’m sure that if it’s stolen or lost my files are in safety. Encryption without user intervention can be used when you wish to perform automatic (runs with cron) backup procedure and protect backup files. To encrypt file /tmp/file.tgz by […]

Read more →

 

FAQ: Change forgotten or lost MySQL root password

Question: I forgot root password for MySQL DBE. How to reset or recover it? PLEASE HELP! Answer: Below is simple algorithm to reset MySQL root password in Linux, FreeBSD, OpenBSD and other Unix like operating systems: 1. Stop MySQL server process by one of the following commands: # /etc/init.d/mysqld stop # killall -9 mysqld # kill `cat /mysql-data-directory/host_name.pid` # mysqladmin shutdown To check if mysqld is killed run “ps ax […]

Read more →