EZ Linux Admin random header image

Entries Tagged as 'Cheat Sheets'

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

Click to continue →

Tags: Cheat Sheets · Linux Commands · Linux Operating Systems

fsck

April 9th, 2010 by EZ linux · No Comments

fsck -a
Will automatically fix errors.

Click to continue →

Tags: Cheat Sheets

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.

Click to continue →

Tags: Cheat Sheets · Hardware · Linux Commands · Linux Tricks

Mod_cband the new Mod_Bandwidth

March 29th, 2010 by EZ linux · 1 Comment

I spent hours trying to get mod_bandwidth to work simply because I have used it for years. But now with Apache 2.0 times have changed and there is a better option for Linux and it’s free. The new mod to regulate bandwidth and more is called Mod_cband I’m not sure what cband means but I [...]

Click to continue →

Tags: Cheat Sheets · Cpanel and WHM · Linux Security · Linux Software / Scripts · 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” [...]

Click to continue →

Tags: Cheat Sheets · Linux Commands

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 [...]

Click to continue →

Tags: Cheat Sheets · Linux Commands · Linux Security · Linux Software / Scripts · Linux Tricks

Default MYSQL port

February 9th, 2010 by EZ linux · No Comments

The default MYSQL port is:
3306

Click to continue →

Tags: Cheat Sheets · Linux Security · Ports

Show All Running Processes in Linux

January 21st, 2010 by EZ linux · No Comments

To see every process type:
ps -A
To see every process except what’s running from root type:
ps -U root -u root -N

Click to continue →

Tags: Cheat Sheets · Linux Commands · Linux Tricks

Change root or user password on a Linux server

January 18th, 2010 by EZ linux · No Comments

Simple when logged in with the user type:
passwd
Then enter the new password twice to save it.
To change the root password on a Linux server you have to be logged in as root.

Click to continue →

Tags: Cheat Sheets · Linux Security

How to reduce or free space in /usr partition

January 13th, 2010 by EZ linux · 1 Comment

1. Restart the httpd service. This might free a little space some times.
2. Check for apache logs like error_log, access_log , suexec_log in /usr/local/apache/logs . These can either be cleared off or if you need the logs then you can take a zipped copy and keep it aside.
3. Same can be done for the files [...]

Click to continue →

Tags: Cheat Sheets · Linux Tricks