history -c
Entries Tagged as 'Linux Commands'
Clear bash history through ssh command line
May 30th, 2010 by EZ linux · No Comments
Tags: Linux Commands
Path to date
May 24th, 2010 by EZ linux · No Comments
The server path to date can very for different servers, you will need to run this command to find it:
which date
For most servers it is:
/bin/date
This is the same for perl and php
Tags: Cheat Sheets · Linux Commands · Linux Operating Systems
setroubleshoot bug
May 24th, 2010 by EZ linux · No Comments
There is a bug with the new option in Centos 5 called setroubleshoot.
The bug spins the program over and over causing high memory and sometimes CPU use. Unfortunately there is no permanent fix yet, but if you see something like this high in your daily process log:
/usr/bin/python -E /usr/sbin/setroubleshootd
To fix for now you simply have [...]
Tags: Cpanel and WHM · Linux Commands · Linux Software / Scripts
When asking about a networking issue, get these details from the server
April 5th, 2010 by EZ linux · No Comments
Kernal version
uname -a
Nic / Lan driver version
dmesg | grep r8169
Internet controller
lspci -nn | grep Ethernet
Details on etho nic card
sudo ethtool eth0
Module size
lsmod | grep r8169
Module versions
cat /proc/modules | grep r8169
Don’t worry all these commands are safe and just for reporting.
Tags: Cheat Sheets · Hardware · Linux Commands · Linux Tricks
How to do a search and replace over multiple files
March 18th, 2010 by EZ linux · No Comments
You could also use find and sed, but I find that this little line of perl works nicely.
perl -pi -w -e ’s/search/replace/g;’ *.php
-e means execute the following line of code.
-i means edit in-place
-w write warnings
-p loop
Example I had the following style sheet in a section:
<link rel=”stylesheet” type=”text/css” href=”../includes/style.css”>
and I wanted the following instead:
<link rel=”stylesheet” type=”text/css” [...]
Tags: Cheat Sheets · Linux Commands
Getting a md5sum error when tranferring a cpanel account?
March 3rd, 2010 by EZ linux · No Comments
This usually means you need to upgrade Perl on the server. Here is a example of a md5sum error.
The remote server didn’t report a correct md5sum of the archive. Please ensure you selected the correct type of remote server.
To fix upgrade Perl as shown here:
http://www.ezlinuxadmin.com/2009/08/upgrading-perl-on-cpanel/
Tags: Cpanel and WHM · Linux Commands · Linux Software / Scripts
My new favorite rsync command
March 3rd, 2010 by EZ linux · No Comments
rsync -vae ssh 12.123.123.123:/home/dwhsbackup/daily/username/ /backup/cpbackup/daily2/username/ –bwlimit=10000 –exclude-from ‘/root/exclude.txt’
Tags: Linux Commands · Linux Software / Scripts · Linux Tricks
Calm down rsync if it overloads your IO memory or CPU
March 3rd, 2010 by EZ linux · No Comments
The trick is to limit I/O bandwidth for rsync.
The –bwlimit option limit I/O bandwidth. You need to set bandwidth using KBytes per second. For example, limit I/O bandwidth to 10000KB/s (9.7MB/s), enter:
rsync –delete –numeric-ids –relative –delete-excluded –bwlimit=10000 /path/to/source /path/to/dest/?
10 megs a second is plenty of speed and will keep the server running smoothly when your [...]
Tags: Cheat Sheets · Linux Commands · Linux Security · Linux Software / Scripts · Linux Tricks
rsync running slow?
March 3rd, 2010 by EZ linux · No Comments
Today I was transferring files through rsync it was taking forever, my guess was the new server or old server was out of memory so I killed some procs and even rebooting the server but still it was crawling. So I thought I would think out of the box and after a couple trial and [...]
Tags: Hardware · Linux Commands · Linux Tricks
Free /usr partition space by a symlink to domlogs
February 10th, 2010 by EZ linux · No Comments
First move the domlogs folder to the backup partition:
mv /usr/local/apache/domlogs /backup
Then create a symbolic link to it:
ln -s /backup/domlogs /usr/local/apache/domlogs
Tags: Linux Commands · Linux Tricks
