r00t.gr

Programming and more

Entries for the ‘Linux’ Category

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 install apache mod_expires In directadmin DA centos linux

cd /usr/local/directadmin/custombuild mkdir -p custom/ap2 cp configure/ap2/configure.apache custom/ap2/configure.apache vi custom/ap2/configure.apachecd /usr/local/directadmin/custombuild mkdir -p custom/ap2 cp configure/ap2/configure.apache custom/ap2/configure.apache vi custom/ap2/configure.apache add: –enable-expires so it looks like this: #!/bin/sh "./configure" \ "–prefix=/etc/httpd" \ "–exec-prefix=/etc/httpd" \ "–bindir=/usr/bin" \ "–sbindir=/usr/sbin" \ "–sysconfdir=/etc/httpd/conf" \ "–enable-so" \ "–enable-dav" \ "–enable-dav-fs" \ "–enable-dav-lock" \ "–enable-suexec" \ "–enable-deflate" \ "–enable-unique-id" \ "–with-suexec-caller=apache" \ […]

How to run rsync from command line script with password

When everything else fails try:   #!/usr/bin/expect set timeout 19900 spawn /bin/bash expect -re "]# " send "rsync -av –delete user@host:someremotefolder/ somelocalfolder\r" expect -re "password:" sleep 2 send "userpassword\r" expect -re "total size is" expect -re "]# " send "exit\r"#!/usr/bin/expect set timeout 19900 spawn /bin/bash expect -re "]# " send "rsync -av –delete user@host:someremotefolder/ somelocalfolder\r" […]

How to install imagemagik to centos 5.8 – with DirectAdmin DA

It’a atually very easy. Just type: yum install ImageMagick ImageMagick-perl yum install ImageMagick ImageMagick-perl Output: Loaded plugins: fastestmirror, priorities Determining fastest mirrors * base: mirror.kiewel-online.ch * epel: mirrors.n-ix.net * extras: mirror.kiewel-online.ch * updates: mirror.kiewel-online.ch base | 1.1 kB 00:00 epel | 3.7 kB 00:00 epel/primary_db | 3.8 MB 00:00 extras | 2.1 kB 00:00 extras/primary_db […]

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

Openvz + rsync problem Disk quota exceeded (122) [fixed]

Ok I had this annoying error. I rent servers to clients, and I user VPSs on another server to backup them. This one client (latest client) had a problem. When I used rsync to move files to the Backup VPS I got a lot of these errors: rsync: write failed on "/vz/private/106/mnt/sdb1/var/lib/mysql/ibdata1": Disk quota exceeded […]

fix quota error on cpanel openvz systems

To fix that please read this: http://forums.cpanel.net/f5/fixquota-script-error-46270.html

Fix “Metadata file does not match checksum” on yum (centOS)

Today I tried to install some new programs, in CentOS, with yum install program, and i got this error: http://mirror.xfes.ru/openvz/kernel/branches/rhel5-2.6.18/current/repodata/filelists.xml.gz: [Errno -1] Metadata file does not match checksum Trying other mirror.http://mirror.xfes.ru/openvz/kernel/branches/rhel5-2.6.18/current/repodata/filelists.xml.gz: [Errno -1] Metadata file does not match checksum Trying other mirror. I don’t know why that happened, but I found the solution to the […]

Install Pear Log package (and others) in CentOS

I used some code, that needed Pear Package Log. The way to install a Pear Package in CentOS is: yum install php-pear php-pear-Log php-pear-MDB2yum install php-pear php-pear-Log php-pear-MDB2 Don’t use pear’s internal package installer, that doesn’t work so well on CentOS

Enable sudo for a user (CentOS)

Today i wanted to run a command, as root. I am not logged in as root for security reasons, everybody says it’s a bad idea, so I stopped loggin in as root. Then i wanted to run something as root. I remembered the sudo command so I typed sudo chmod +x runsudo chmod +x run […]