Archive for February 2008

Install a MySQL server from debian source package

Quick code overview to compile a debian mysql5 server package, and to install it. ?View Code BASH1 2 3 4 5 6 7 apt-get install libdbi-perl libdbd-mysql-perl apt-get build-dep mysql-server apt-get -b source mysql-server dpkg -i mysql-common_..all.deb dpkg -i mysql-client-..i386.deb dpkg -i mysql-server-..i386.deb mysqladmin -u root password ‘yourpassword’ It might also be required to integrate [...]

Install lighttpd + php5-cgi + xcache

For the myp2p website, we are running on lighttpd with fastcgi php5. To improve performance, we installed xcache, a PHP opcode cacher. Xcache seems to improve the performance with about 20%, as far as that can be measured in just a percentage. Instead of using the oftenly chosen Apache, we’re going with the more controversial [...]

Create a samba mount

To create a sambe mount on a server: ?View Code BASH1 mount -t smbfs -o username=User,fmask=7777,dmask=7777 //10.0.0.1/mount-name /mount-place The ‘mount’ program will use smbfs, and feed the -o options to it. You can also add password=Password to this -o parameter. Now it will ask you for one. Furthermore, you can display the mounts by just [...]

Exporting and importing MySQL database

Quick way to do this via commandline: export: ?View Code BASH1 mysqldump -u Username -pPassword DatabaseName > DatabaseName_backup.sql import: ?View Code BASH1 mysql -u Username -pPassword DatabaseName < DatabaseName_backup.sql

Creating a MySQL database with proper rights.

Sometimes it’s easy to create a database without any specific permissions, to test some scripts on. The way to do this is: ?View Code BASH1 2 3 4 CREATE USER ‘testuser’@'localhost’ IDENTIFIED BY ‘pass’; GRANT USAGE ON * . * TO ‘testuser’@'localhost’ IDENTIFIED BY ‘pass’; CREATE DATABASE IF NOT EXISTS `testDB` ; GRANT ALL PRIVILEGES [...]

removing files: argument list too large

On the myp2p website we host there is a caching system which safes all its cache data to a directory (mounted in the memory to improve performance). When flushing the all cache files, there sometimes are yoo much files for the ” ?View Code BASH1 rm -fr ” command to work. Therefore every file needs [...]

A couple of useful commands for debian etch

Calculate the number of php5-cgi processess running: ?View Code BASH1 ps aux | grep php5-cgi | grep -v "\(root\|grep\)" | wc -l Display process list of processnames including “php5″: ?View Code BASH1 ps axo ‘pid user cmd’ | grep php5 | grep -v "\(root\|grep\)" Analyse apache access.log: Display top 10 ip client ip addresses (in [...]