preload preload preload preload

Linux Date Command Option

Date command options. Date command to get the current date. $ date=$(date +%Y-%m-%d) $ echo $date Date command to get yesterday's date. $ date=$(date --date=yesterday +%Y-%m-%d) $ echo $date Date command to get tomorrow's date. $ date=$(date --date=tomorrow +%Y-%m-%d) $ echo $date ...
0

Shell Script To Monit Swap Usage

Some time our system started to use more swap area even 100% of swap area and the system crashes. So for a System Admin it would be very helpful when they get informed if the system started to use more swap usage so that system admin can manage the server before crashing. So I wrote a shell script which will Alert by send mail if the ...
2

Shell script to notify Hard disk space utilization

The below script will check the hard disk space usage, using the command du and send an email alert if any of the partition is using more than 85% of space. vim disk-usage.sh #!/bin/sh df -H | grep -vE '^Filesystem|tmpfs|cdrom' | awk '{ print $5 " " $1 }' | while read output; do echo $output usep=$(echo $output | awk '{ print ...
3

Configuring Iptables on system startup

In Ubuntu we don't have a mechanism to start or stop iptables or we don't have a mechanism to restore iptables after restarting the system. Now we will see how to create a script for start and stop iptables also to make the script to start on system startup. 1. Create a Firewall script  vim /etc/set_iptables.bash echo 1 > ...
0

Shell Script to delete unwanted files and directories

#!/bin/bash cd /home/shahid/ # Change the dectory to the specified location monit stop all # Stop all the process rm -rf log/* # Deletes all the files inside the directory log rm -rf dump/processed/* # Deletes all the files inside the directory ...
0

Apache URL Rewriting

Introduction  One of the more powerful tricks of the .htaccess is the ability to rewrite URLs. This enables us to do some mighty manipulations on our links; useful stuff like transforming very long URL's into short, cute URLs,  redirecting URL to some other URL, transforming dynamic ?generated=page&URL's into /friendly/flat/links, redirect missing pages, preventing hot-linking, performing automatic language translation, and much, much ...
0