Category: Scripts

Define

Just a quick script for looking up the definition of a word via the commandline… touch define vim define add the following code then :wq to save #! /bin/bash # display definition of a word # curl –stderr /dev/null dict://dict.org/d:$1 | sed ‘/^[.,0-9].*$/d’ then, chmod +x define mv define /usr/bin/define Usage # define linux Linux…


Rsync Cpanel Server (Cloning)

This script will copy everything necessary for a full cpanel -> cpanel transfer. You need to open the script up and change 127.0.0.1 to the FQDN or IP of the target server. It will first create a key pair and then transfer it to the target server. Root level access is required for this script…


vpsinfo : server status in your browser

from http://www.labradordata.ca/home/13 vpsinfo is a Linux server monitoring script, written in PHP, that provides web access to system status information. It gathers the output from several common Linux commands into one web page, providing a quick overview of the system’s current state. While designed for use on a Linux Virtuozzo or OpenVZ VPS (Virtual Private…


e – Extract Any Archive

With this little tool you can extract almost any archive in Linux so you do not need to remember which tool and what command lines are necessary. Usage: # Extract a zip file: e file.zip # Extract a rar file: e file.rar # Extract several archives, one after another: e a.tar.gz b.tar.bz2 c.cab d.deb e.rpm…


cleanbackups.sh

cleanbackups.sh chmod +x ./cleanbackups.sh


DomainKeys Install

Here is a little script that will add domainkeys to all cpanel user accounts. #!/bin/bash for i in `ls /var/cpanel/users` ;do /usr/local/cpanel/bin/domain_keys_installer $i ;done cd /var/named localdomains=$(cat /etc/localdomains | grep ‘^[^.]*\.[^.]*$’ | uniq -u) for i in $localdomains do echo “_domainkey IN TXT “t=y; o=~; n=Interim Sending Domain Policy; r=root@$HOSTNAME”” >> $i.db done wget http://layer3.liquidweb.com/updateserial.pl…


Reset Permissions in a Cpanel Users Directory

#!/bin/bash cd /var/cpanel/users for user in * do chown -R $user.$user /home/$user/public_html/* done


FFMpeg Install

1) Install ffmpeg via admin-ahead.com (http://scriptmantra.info/ffmpeg.html) 2) Register here: http://installers.admin-ahead.com/ (Name, Email, Server IP, Country, Hit Submit) 3) Reply to email 4) Download script to server using wget in /root directory wget http://scriptmantra.info/scripts/AAST_ffmpeg_installer_5.0.7b chmod +x AAST_ffmpeg_installer_5.0.7b ./AAST_ffmpeg_installer_5.0.7b 5) Select FFmpeg install. Setup will now run 6) Flawless install…FTW nice… This installer works well also ffmpeginstall.3.2.1.tar…


Add SPF Records to all Domains

touch spf.sh vim spf.sh select and copy the following code (ctrl+A) #!/usr/bin/python import commands,os,time curdate = time.strftime(“%Y%m%d”) # Just in case things blow up os.system(“cp -Rp /var/named /var/named.backup”) os.chdir(“/var/named”) files = commands.getoutput(“ls *.db”).split(“\n”) for file in files: domain = file.rstrip(‘db’) record = “\n%s IN TXT \”v=spf1 a mx ~all\”” %domain f = open(file, ‘a’) f.write(record)…