r00t.gr

Programming and more

Entries for the ‘System Administration’ Category

How to fix: RESULT: csf will not function on this server due to FATAL errors from missing modules [4]

I tried to install CSF to a linux machine running Cpanel. I got the error: RESULT: csf will not function on this server due to FATAL errors from missing modules [4]RESULT: csf will not function on this server due to FATAL errors from missing modules [4] As it turns out this is an openVz issue. […]

Redirect all windows traffic through ssh tunnel – socks proxy – http proxy

So you have build an ssh tunnel http://www.r00t.gr/how-to-easily-create-a-ssh-tunnel-using-windows-in-startup-boot/ and you want to redict all you traffic through it. You can configure all browsers and email clients and utorent to use the proxy, or you can download proxifier http://www.proxifier.com/download.htm and set it up to use one proxy. It’s really cheap, 40$ for a lifetime licence. Cool tools […]

How to install git on centos with yum

# Add the repository rpm -Uvh http://repo.webtatic.com/yum/centos/5/latest.rpm   # Install the latest version of git yum install –enablerepo=webtatic git-all# Add the repository rpm -Uvh http://repo.webtatic.com/yum/centos/5/latest.rpm # Install the latest version of git yum install –enablerepo=webtatic git-all Clean, simple and it works!

How to see what programs use the most memory in linux

You have to run:   ps aux | sort -nk +4ps aux | sort -nk +4 That will print you a list of all the running applications and it wil sort them by the 4th column (memory) The same can be applied for CPU, Virual memory etc. Just change the -nk +4 value to +3 […]

How to log cron crontab output in linux

Question: I created a backup.sh shell script and added it to my crontab to execute it daily. How do I verify whether the backup cron script job ran successfully? Also, I have several echo statements inside my backup.sh shell script. How do I save the output of my script to a log file when it […]

How to remote backup Direct Admin (rsync backup)

You can never be sure about backups. If you are have a dedicated server you should know, local backup is never enough. Hard disks fail. Every hard disk will fail eventually. So having a remote backup solution is a must. There are many solutions for that problem. The first think I tried was configure da […]

CentOS Linux: Fix bash: ntpdate: command not found centos

First you have to install ntp: Run as root: yum install ntpyum install ntp Then if you run ntpdate again you might get the error again. You can run ntpdate with: /usr/sbin/ntpdate 2.pool.ntp.org/usr/sbin/ntpdate 2.pool.ntp.org Replace 2.pool.ntp.org with another server if that doesn’t work. If you get a ntpdate[585863]: the NTP socket is in use, exiting […]

Disable stopwords in mysql Full text index

Disable stopwords in mysql Full text index if you didn’t know what full text index for mysql is google it. It makes searches for text much faster than using “where text like ‘%keywod1%’ AND text like ‘%keyword2%’. (at least 100 times faster) That trick saved me in a when I had an overloaded server. Anyway, […]

nginx, apache reverse proxy, and $_SERVER[‘HTTP_HOST’]

Ok here is the senario: I have a website built on a server with nginx as the main web server I use apache as a reverse proxy The problem: I tried to use the $_SERVER[‘HTTP_HOST’] command (this gives you the hostname of the url the user requested). For example if the user requested http://subdomain.domain.net/ $_SERVER[‘HTTP_HOST’] […]

Change user on linux (or switch users on linux)

The easiest way to switch users in linux is: su usernamesu username if you type only su then root is default. You can to enter the other user’s password to switch to it.