Implementing procmail on pleskPosted 2 years, 10 months ago on May 14, 2006 by yerma Scripts I had a need to implement procmail on a server running redhat and plesk so after a bit of googling I stumbled across this message: ---Comment Rescan scsi busPosted 3 years, 1 month ago on February 27, 2006 by yerma Scripts Can't remember where I got this script from but it proved very helpful when trying to sort out a debian machine with LVM. ---Comment testing technorati pingPosted 3 years, 1 month ago on February 27, 2006 by yerma Scripts Added a new thing for technorati pings ---Comment Time based email forwardingPosted 3 years, 1 month ago on February 26, 2006 by yerma Scripts A while back I worked on a small procmail recipe which took me a while to get right but which has proved invaluable since. I have been using a blackberry for about 2 years now and find it invaluable for work and also keeping up-to-date with my home email. I didn't want the blackberry pinging all the time with crap mail so firstly I wanted only certain email forwarded and secondly only at certain times of the day(after 5.30 if in the office, before midnight, at the w/end etc etc). I couldn't find a lot online about it and tried a few things before stumbling across the idea of using a procmail recipe - I did have a link to where I got the original ideas from but can't find the link now. The recipe is: #in office #:0 c #* ^From.*(emailaddress|emailaddress2).*(((Mon|Tue|Wed|Thu|Fri).*(1[789]|2[0123]):[0-5][0-9]:.*)|(Sat|Sun)).* #! blackberryaddress@whatever.com #out of office :0 c * ^From.*(emailaddress|emailaddress2).*(((Mon|Tue|Wed|Thu|Fri).*(0[789]|2[0123]|1[0-9]):[0-5][0-9]:.*)|(Sat|Sun)).* ! blackberryaddress@whatever.com ---Comment BackupsPosted 3 years, 5 months ago on November 1, 2005 by yerma Scripts I have created a few scripts to help in my backing up procedures - I normally install cygwin to enable me to use most unix commands from a windows environment. The following assumes that you have 2(or more) servers - for clarity sake I will call one backup and one web (obviously we are backing up from web to backup).To make the below function will require the below cygwin packages:
The below scripts all take advantage of ssh key authentication to avoid password authentication on the remote host - there is a great tutorial here to setup the sshd - one caveat is that I set nontsec instead of ntsec. To enable remote authentication without a key do the following: Login to web: ssh-keygen -t dsa mv .ssh/id_dsa.pub ~/web.pub scp ~/web.pub USERNAME@web: Login to backup: cat web.pub >> .ssh/authorized_keys You should now be able to login without a password.Next step is to put the scripts in place(rename them all from .txt to .sh). On the web server download the backups.sh script into your scripts folder (I use ~/scripts with chmod 700). Edit the parameters at the top. #the backup server BACKUPSERVER="" #this server name THISSERVER="" #where the local files are stored with no trailing slash LOCALFILES="" #Logfile LOGFILE="/tmp/backups.log" On the backup server download the "dobackups.txt"[/files/dobackups.txt] and place in your scripts file - edit your variables again: #Recieve the site to backup from the command line SITETOBACKUP=$1 LOGFILE="/tmp/backups.log" #Where the files will be stored when zipped etc - no trailing slash FILELOC="" Test it out and it should all work without probs - if it all works okay then setup your cron job on the web server (0 1 * * * /path/to/script.sh) and your ready to go. I have also included an Oracle script for doing an exp which should be useful. ---Comment Banning ssh attacks on debianPosted 3 years, 5 months ago on October 26, 2005 by yerma Scripts Howto ban SSH attacks on debian apt-get install swatch Then create /etc/swatch.conf # Global swatch filter file # To ignore a IP-range - this is your lifeline :) ignore /ip\.goes\.in\.here/ #Invalid SSH Login Attempts watchfor /: [iI]llegal [uU]ser/ # uncomment this to let them fail 3 times #threshold 3:3600 mail addresses=root,subject="SSH:\ Invalid\ User\ Access-IPTables\ Rule\ Added" exec "/sbin/iptables -A swatch_rejects -s $10 -j DROP" exec "echo $10 >> /opt/badlist.txt" #Failed SSH Login Attempts watchfor /: [aA]uthentication [fF]ail/ # uncomment this to let them fail 3 times #threshold 3:3600 mail addresses=root,subject="SSH:\ Failed\ User\ Login-IPTables\ Rule\ Added" exec "echo $10 >> /opt/badlist.txt" Then in your iptables script(at the end): [code] #create the chain iptables -N swatch_rejects #link it to the input iptables -I INPUT -j swatch_rejects #kill any previously running swatch pid - there should be a check in here kill -9 `cat /var/run/swatch.pid` #delete existing pid file rm -rf /var/run/swatch.pid #run swatch - watch the wrap /usr/bin/swatch --tail-file=/var/log/auth.log --config-file=/etc/swatch.conf --awk-field-syntax --pid-file=/var/run/swatch.pid --tail-args='--follow=name -n 0' --daemon [\code] ---Comment
|
MusicRSS feedsReferedSectionsApple Older StuffThe saga begins...... Linkage![]() ![]()
|