Posts Tagged ‘linux’

Start services automatically on boot in Gentoo

Tuesday, December 4th, 2012 | Life, Tech

If you want a service to start automatically when Gentoo boots up, you need to tell Gentoo to start it. Gentoo looks at /etc/runlevels/boot to see what it needs to run, so all you need to do is add a symlink in here to your init.d script. In this example, I’ll use exim.

cd /etc/runlevels/boot
ln -s /etc/init.d/exim exim

Next time Gentoo boots, it will see exim in the boot directory and run the script. This isn’t just limited to boot either – /etc/runlevels also has directories for shutdown and system initialisation.

Install Go Server on CentOS with OpenJDK

Wednesday, October 17th, 2012 | Life, Tech

If you’re trying to install ThoughtWorks’ Go Server on CentOS (or indeed any Linux variety), you might run into a problem where it says you need JDK installed. Indeed, even if you have OpenJDK installed it may continue to complain.

This is because they have not officially approved OpenJDK yet, so your two options are to a) installed the actual JDK or b) to install OpenJDK to at least the version required (1.6 at time of writing) and then force the installer to ignore dependences. This can be done using the following command.

rpm -i --nodeps go-server.rpm

Providing you already have OpenJDK installed, this should work fine.

Install DKMS on CentOS 5.7

Saturday, August 18th, 2012 | Life, Tech

DKMS is in RPMForge, so we need to add that before we can install it via Yum.

cd /root/
wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.i386.rpm
rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt
rpm -K rpmforge-release-0.5.2-2.el5.rf.*.rpm
rpm -i rpmforge-release-0.5.2-2.el5.rf.*.rpm
yum install dkms

Installing APC for PHP on Fedora 15

Sunday, August 12th, 2012 | Life, Tech

This is how to install APC for PHP on Fedora 15.

yum install php-devel
yum install pcre-devel
yum install php-pear
pecl install apc

Create a file in /etc/php.d named apc.ini, containing the following.

extension=apc.so

Killing zombie processes

Wednesday, July 25th, 2012 | Life, Tech

Zombie processes are very hard to kill, like cave trolls, but there is a way. We need to get the parent IDs for them and use those.

ps -Al
kill <ppid>

Install APD on CentOS 5

Thursday, July 19th, 2012 | Life, Tech

Here is how to install APD (Advanced PHP Debugger) on CentOS 5. Lets start by creating a directory for it to log files to.

cd /tmp
mkdir apd
chown apache:apache apd

We need to remove ioncube, or it will cause errors.

rpm -e php-ioncube-loader

Now we can install APD, via PECL.

pecl install apd

Add the following to php.ini.

[apd]
zend_extension=/usr/lib64/php/modules/apd.so
apd.dumpdir=/tmp/apd
apd.statement_tracing=0

My PHP binary was in a different location, so I had to alter the script too.

cd /usr/bin/
vim pprofp

Change /usr/local/bin to /usr/bin and save the file.

You also need to ensure PEAR is in your include path (/usr/share/pear) for the script to work.

Create permenant aliases with .bashrc

Saturday, July 7th, 2012 | Life, Tech

Sometimes, it’s easier to create an alias when working with the Unix command line. Having to create these every time seems to defeat the point of having a short alias though. Luckily, you can make them persistent.

Lets assume that we are using a user called mike. We need to be in our home directory.

cd /home/mike

The .bashrc file should be in there, but hidden.

ls -a

You should be able to see it listed. Now lets edit it.

vim .bashrc

And add a command in, for example, to save our usual CVS update command.

alias upd='cvs -q update -P -d'

Now save and exit. After that, every time you log onto the box you can use the upd command to run the CVS update.

Installing GCC 4.4 on CentOS 5

Sunday, July 1st, 2012 | Life, Tech

If you’re running CentOS, you may find yourself frustrated that you have GCC 4.2 or older, when you need to be running at least 4.3 for some features – for example, if you want to compile HipHop for PHP.

Never fear, you don’t need to compile a compiler from source!

As well as the gcc RPMs in the repository, there are also a set for GCC 4.4, appropriately enough named gcc44 and you can install them in the usual way.

yum install gcc44 g++44

ImageMagick, Apache and Debian

Thursday, June 7th, 2012 | Life, Tech

Following on from my previous post about installing ImageMagick from source, to get it working with Apache you need to do the following. First, we need to install something from Pecl. So make sure you have the pecl command at hand – if not, install it.

apt-get install pear

Then run the following.

apt-get install php5-dev
pecl install imagick

Finally, add the extension to your php.ini.

extension=imagick.so

Compiling ImageMagick from source on Debian

Friday, June 1st, 2012 | Life, Tech

There is an RPM available for ImageMagick on Debian, but it isn’t the most update to date, so if you need all the new features, you’ll need to compile and install it from source. Luckily, it’s very easy to do.

wget ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick.tar.gz
tar xvfz ImageMagick.tar.gz
cd 
./configure
make
make install
make check