Category Archives: Linux

Rolling Back yum Packages – CentOS Roll Back After Installation

Rolling back yum packages: http://dailypackage.fedorabook.com/index.php?/archives/17-Wednesday-Why-Repackaging-and-Rollbacks.html http://www.vincentverhagen.nl/2007/12/10/how-to-roll-back-packages-on-centos-5-rhel-5/ When you’ve installed/updates packages with yum or rpm, you can quite easily roll back the updates/installations using rpm. For this, yum and rpm need to save roll back information, which they do not do … Continue reading

Posted in Redhat / CentOS, System Maintenance | Leave a comment

PHP – Execute Linux Commands

There are 4 functions: _ exec _ system _ passthru _ shell_exec They basically differ for the return. The best seems to be the last one, if you need the whole command output in your PHP script.

Posted in Linux Command Line, PHP | Leave a comment

SSH Without Password

Use Public/Private Keys for Authentication Using encrypted keys for authentication offers two main benefits. Firstly, it is convenient as you no longer need to enter a password (unless you encrypt your keys with password protection) if you use public/private keys. … Continue reading

Posted in Linux Command Line, System Administration | Leave a comment

List Which Ports Are Listening – Open Ports – Open Connections

This is the most reliable method because is actually scans the ports: nmap -sT -O localhost Other methods based on internal checks that give you also the information about the program using the ports: netstat -anp lsof -i

Posted in Linux Command Line, System Administration | Leave a comment

APC – Installing It On CentOS

yum install php-pear yum install php-devel yum install httpd-devel Edit the file /usr/share/pear/pearcmd.php and add the following at the beginning: @ini_set(‘memory_limit’, ’16M’); otherwise you’ll probably get a fatal error whilst building the extension: pecl install apc Now configure PHP to … Continue reading

Posted in LAMP Server Setup, Linux, Web Development | Leave a comment

Building Scalable Web Sites – Scalability

A scalable system has got 3 simple characteristics: The system can accommodate increased usage The system can accomodate an increased dataset The system is maintainable It’s not about speed or complexity, those are other topics. For exampel, this is a … Continue reading

Posted in Linux, Linux Command Line, Microsoft, Web Development | Leave a comment

Linux: How To Count The Number Of Files Under a Directory

find . -type f | wc -l

Posted in Linux Command Line | Leave a comment

Linux – Cut Lines

Very useful when you pipe it, for example, for easily reading a file containing very long quries cat queries.sql | cut -b -10

Posted in Linux Command Line | Tagged | Leave a comment

MySQL – Importing Many SQL Dump Files in a Database

ls *.sql | awk ‘{printf(“mysql -u [username] -p[password] [databasename] < %s\n”, $1) | “/bin/sh” }’

Posted in Linux Command Line, MySQL | Leave a comment

CentOS – Setting the Network / Internet Interface

http://www.cyberciti.biz/faq/rhel-centos-fedoracore-linux-network-card-configuration/

Posted in Redhat / CentOS | Leave a comment