February 20th, 2012 |
admin |
Here’s a great trick if you need to add custom classes to the body tag output of your Drupal theme. This goes above the standard body tag output using a line like this in your page.tpl.php <body class=”<?php print $body_classes; ?>”> Which only creates the usual body classes like: <body class=”front logged-in page-node one-sidebar sidebar-right”> [...]
February 16th, 2012 |
admin |
setuid and setgid (short for set user ID upon execution and set group ID upon execution, respectively) are Unix access rights flags that allow users to run an executable with the permissions of the executable’s owner or group. They are often used to allow users on a computer system to run programs with temporarily elevated [...]
February 14th, 2012 |
admin |
Shell Script to search Failed Ftp Login Attempts This Shell script will search the server logs on daily basis and will email you the Failed Ftp Login Attempts of the day. The ftp logs are saved in the /var/log/messages file as by default there is no separate log file for Ftp in Linux. Create a [...]
February 10th, 2012 |
admin |
tail -1000 /var/log/exim_mainlog |grep ‘\[' |cut -d[ -f2 |cut -d] -f1|sort -n |uniq -c |sort -n Incoming search terms:cpanel shell scripts (3)shell script to send email on daily basis (1)
February 6th, 2012 |
admin |
In Unix-style computer operating systems, root is the conventional name of the user who has all rights or permissions in all modes (single- or multi-user). The root user can do many things an ordinary user cannot, such as changing the ownership of files and binding to ports numbered below 1024. It is never good practice [...]
February 4th, 2012 |
admin |
#!/bin/bash # mybackupadd – Add file to ~/.mybackup file, then backup and email all # file as tar.gz to your email a/c. # # Usage : ./mybackupadd ~/public_html/ # # Copyright (C) 2004 nixCraft project # Email : http://cyberciti.biz/fb/ # Date : Aug-2004 # ————————————————————————- # This program is free software; you can redistribute it [...]
February 3rd, 2012 |
admin |
#!/bin/bash # Shell script to backup directories from Linux server to Windows 2000/NT Server. # Run it as follows # Scriptname /home backup abc123 //server2000/backup # Backup /home directory from Linux box to NT/2000 box called # ‘server2000′ in share called ‘/backup’ with username # ‘backup’ and password ‘abc123′ # ——————————————————————– # This is a [...]
January 22nd, 2012 |
admin |
Shell Script for Disk Space Notification The Disk Space Notification script can be scheduled to run once in a week which will check the Disk Space Usage on the server. The Shell script will send out an email to the admin if the Disk Space Usage is greater than the Threshold. Create a file /home/diskspace.sh [...]
January 14th, 2012 |
admin |
#!/bin/bash # Shell script to backup MySql database # To backup Nysql databases file to /backup dir and later pick up by your # script. You can skip few databases from backup too. # ——————————————————————– # This is a free shell script under GNU GPL version 2.0 or above # Copyright (C) 2004, 2005 nixCraft [...]
January 10th, 2012 |
admin |
Use to perform arithmetic operations. Syntax: expr op1 math-operator op2 Examples: $ expr 1 + 3 $ expr 2 – 1 $ expr 10 / 2 $ expr 20 % 3 $ expr 10 \* 3 $ echo `expr 6 + 3` Note: expr 20 %3 – Remainder read as 20 mod 3 and remainder [...]