Programming and more

Entries for the ‘Centos’ Category

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

Delete all subfolders with specific filename in linux, recursively

I used Subversion for a project I did, they I stopped developing that, then after a long time, I found that folder and i wanted to copy it locally. There was one problem, Subversion, created a folder named .svn in all the subfolders, and this had some more more folders in it (3-4 folder). I […]

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

Install json (and pcre) for php (CentOS Linux 5.5)

Today I tried to run a script that was using json and got the following error: Fatal error: Call to undefined function json_encode()Fatal error: Call to undefined function json_encode() The problem was that the json library wasn’t installed. I researched google a little and I found how to install it and configure php to use […]

How to change user’s folder in linux (Ubuntu, CentOS, all unix)

To change the default user directory in linux, you have to run: usermod -d /path/to/new/homedir/ usernameusermod -d /path/to/new/homedir/ username You have to run this as root. If you don’t have root access, you can do that: Login with the user you want to change the folder. Then edit .bashrc file: vi ~/.bashrcvi ~/.bashrc And add […]

Installing nginx 1.0.0, php, mysql, ftp, disk + memory (ram) caching On Centos 5.5

This is how you install a complete website with nginx php mysql ftp for CentOS. If you have basic linux knowledge you have what it takes to configure a system. Don’t spend you money in expensive Control Panels (Cpanel DirectAdmin) (like i did!). These packages make everything look harder because you didn’t install the packages […]

Installing nginx 1.0.0 On a fresh Centos 5.5 System from source

[I wrote this, and then i found rpm for nginx 1.0.0 see the whole article to setup a complete CentOS system with nginx + php +mysql + eaccelerator + ftp + php caching here: http://www.r00t.gr/2011/04/installing-nginx-php-mysql-ftp-disk-memory-ram-caching-on-centos-5-5/] After my little adventure where i tried to install a complete nginx, php, eaccelerator, mysql, ftp, file + memory php […]

Install nginx v1.0.0 + php + eaccelerator + mysql + ftp + file and memory caching on an Ubuntu 10.04 System

I am designing at the moment a new website. I don’t want to reveal much, but i except this to have much traffic, and there will be a lot of php running in the background, and the site will use a very large database, and a remote API. So it is very important that i […]

How to avoid duplicate lines in Linux Command line (bash history)

I will try and explain the problem first. Many times, when you work with a linux machine, (in my case mostly CentOS) through command line, you write some commands. Many times you use the same commands more more than one times in a row. For example you run ls many times this command will be […]