Linux
Display real-time memory usage
How to find the memory usage
We need to monitor our Linux server memory usage, "watch" is a handy command to display the real-time memory usage in Linux.
watch
will execute a program periodically, showing output fullscreen.
We can issue the following command to keep track the real time memory ..
Find hw information of my machine
demicode command to get hardware information
The "dmidecode" is a handy tool in Linux to display the hardware specification detail. For example, memory, processor , BIOS and etc.
man dmidecode
DMI TYPES
The SMBIOS specification defines the following DMI types:
Type Information
----------------------------------------
0 BIOS
1 System
2 Base Board
3 Chassis
4 Processor
5 Memory Controller
6 Memory Module
7 Cache
8 Port Connector
9 ..
Check cpu details
How to find cpu information
Linux CPU information is stored in /proc/cpuinfo, we can check our Linux CPU information by issue following command.
cat /proc/cpuinfo
The above command will print the CPU details of your server or local machine. You can find the memory information of your system by executing /proc/meminfo
cat /proc/meminfo
will print ..
Lock caps key
Lock and unlock Caps key on keyboard
Linux provided a command called "xmodmap" to enable and disable the Caps Lock key functionality.
Disable Caps Lock key
xmodmap -e "remove lock = Caps_Lock"
Enable Caps Lock key
xmodmap -e "add lock = Caps_Lock"
The remove lock will lock the caps key on your keyboard and the add ..
Find top 10 users in server
Command to find server load spike users
The following are some of the most used command by me and system admiins as and then.
To Find max http hits from which ip
netstat -tn | grep :80 | awk '{print \$5}' | cut -f1 -d: | sort | uniq -c | sort -rn ..
Remove Malicious Script
Script to remove hack code from your webpage
The below code will help you to remove the malicious script from the server. However you have to edit the script as per your need.
for i in `cat lko_list`; do sed -i.bak.hak
's/<script.*rivergathering.com.*indiasearthday.*wp.*script>//' $i; done
I do linux support for another hosting company and I ..
Media streamer on mobile phone
Dreambox mobile client media streamer
Some of the useful video and link to install the Dreambox mobile client media streamer. Media streamer on mobile phone. Follow the steps to install the dreambox media dtreamer.
http://win-mobile.forumpro.fr/
..
Libdisk - Free BSD
Library interface to slice and partition labels
Libdisk
It provides an interface to the low-level disk slice and partition labels. Most functions operate with arguments of the types ‘struct disk’, or ‘struct chunk’.
struct disk {
char ..
Plesk documents
Important paths on plesk.
The below are the some of the most used plesk path and plesk files for configuration.
1) Document root for domain.
/var/www/vhosts/domainname/httpdocs
2) path to php.ini
/etc/php.ini
OR
/usr/local/lib/php.ini
3) maillog path:
/usr/local/psa/var/log/maillog
4) Domain Error log path
..
Pleak Migration
Plesk Migration
1.Login to plesk panel
2.choose server option --> Migration manager
If you do not find the option 'Migration manager', please install the
same with the help of 'updater'. This would be the same case when any
new applications has to be installed.
Also to check for the version details of ..
Server load monitoring
Shell script for load monitoring
The below script will help you to monitor the load on the server
Save the below code as load.sh
#!/bin/bash
echo Content-type: text/html
echo
echo "<html><title>Server Load Status</title>"
echo "<meta http-equiv="Refresh" content="60"></head>"
echo "<body><font size="1" face="Verdana"><b>"
echo "<table width="100%" border="1" cellpadding="1" cellspacing="1" align="center">"
echo "<tr>"
echo "<th>Server Name</th>"
echo "<th>IP</th>"
echo "<th>Uptime</th>"
echo "<th>Load</th>"
echo "<th>Service Scanned</th>"
echo "</tr>"
##copy load file ..
How to recover lost pssword
Recover Lost Admin Password vBulletin Forum
Here are the complete instructions on how to restore an admin account for
when you have lost the password, got hacked, or you can't receive the lost
password email.
- Browse to your forum and log out if you aren't already. Register as a new user and login ..
Most used web tools by me
Most used web tools by me
DNS and IP Tools on the Net
* DnsStuff.com - BEST Paid Network Service Tools on the Net
* ViewIP.info - Cool Tools : What is My IP and More
* IPTools - Mostly IP tools ..
Download RPM to install YUM
Yum Installation
Packages or RPM required to install yum
http://www.placona.co.uk/blog/post.cfm/installing-yum-on-centos-5
rpm -Uvh http://mirror.centos.org/centos-5/5.2/os/i386/CentOS/elfutils-libs-0.125-3.el5.i386.rpm
rpm -Uvh
http://mirror.centos.org/centos-5/5.2/os/i386/CentOS/gmp-4.1.4-10.el5.i386.rpm
rpm -Uvh
http://mirror.centos.org/centos-5/5.2/os/i386/CentOS/readline-5.1-1.1.i386.rpm
rpm -Uvh
http://mirror.centos.org/centos-5/5.2/os/i386/CentOS/python-2.4.3-21.el5.i386.rpm
rpm -Uvh
http://mirror.centos.org/centos-5/5.2/os/i386/CentOS/python-iniparse-0.2.3-4.el5.noarch.rpm
rpm -Uvh
http://mirror.centos.org/centos-5/5.2/os/i386/CentOS/libxml2-2.6.26-2.1.2.1.i386.rpm
rpm -Uvh
http://mirror.centos.org/centos-5/5.2/os/i386/CentOS/libxml2-python-2.6.26-2.1.2.1.i386.rpm
rpm -Uvh
http://mirror.centos.org/centos-5/5.2/os/i386/CentOS/expat-1.95.8-8.2.1.i386.rpm
rpm -Uvh
http://mirror.centos.org/centos-5/5.2/os/i386/CentOS/python-elementtree-1.2.6-5.i386.rpm
rpm -Uvh
http://mirror.centos.org/centos-5/5.2/os/i386/CentOS/sqlite-3.3.6-2.i386.rpm
rpm -Uvh
http://mirror.centos.org/centos-5/5.2/os/i386/CentOS/python-sqlite-1.1.7-1.2.1.i386.rpm
rpm -Uvh
http://mirror.centos.org/centos-5/5.2/os/i386/CentOS/elfutils-0.125-3.el5.i386.rpm
rpm -Uvh
http://mirror.centos.org/centos-5/5.2/os/i386/CentOS/rpm-python-4.4.2-48.el5.i386.rpm
rpm -Uvh
http://mirror.centos.org/centos-5/5.2/os/i386/CentOS/m2crypto-0.16-6.el5.2.i386.rpm
rpm -Uvh
http://mirror.centos.org/centos-5/5.2/os/i386/CentOS/python-urlgrabber-3.1.0-2.noarch.rpm
rpm -Uvh
http://mirror.centos.org/centos-5/5.2/os/i386/CentOS/yum-metadata-parser-1.1.2-2.el5.i386.rpm
rpm -Uvh
http://mirror.centos.org/centos-5/5.2/os/i386/CentOS/yum-3.2.8-9.el5.centos.1.noarch.rpm
The above rpm will help you to install yum in linux.
..
Rename files using shell script
shell script to rename multiple files
Renaming multiple files in a folder is easy using linux shell script.
Save this file in ".sh" extension to tell the system that this a shell script. Place this file inside the folder where you want to rename multiples files.
For example, here we have used ..