25 April 2012

PHP Error: "Class 'DOMDocument' not found"

The following module is missing: dom
If you compile PHP, add: --enable-dom

It is possible that XML module is missing as well, at least in my case it was...
If you compile PHP, add: --enable-xml

Compilling ipsec-tools-0.8.0 errors...

While compiling i got the following errors:
gcc -I../../src/libipsec -include ../../src/include-glibc/glibc-bugs.h -I../../src/include-glibc -I../../src/include-glibc -g -O2 -Wall -Werror -Wno-unused -o setkey setkey.o parse.o token.o ../libipsec/.libs/libipsec.a -lresolv
token.o(.text+0x98d): In function `yylex':
/programs/ipsec-tools-0.5-rc1/src/setkey/token.c:1903: undefined reference to `yywrap'
collect2: ld returned 1 exit status
make[3]: *** [setkey] Error 1
make[3]: Leaving directory `/programs/ipsec-tools-0.5-rc1/src/setkey'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/programs/ipsec-tools-0.5-rc1/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/programs/ipsec-tools-0.5-rc1'
make: *** [all] Error 2

Solution came from here and is described below.
Please note that this fix was used on a Debian machine.
apt-get install flex
apt-get install bison
./configure && make && make install

puppet master: push one directory

If you want to push/copy a full directory from puppet master to clients and keep it in sync, you can use the following configuration:

file { "/etc/apache2/":
  ensure => directory,
  recurse => true,
  purge => true,
  force => true,
  owner => "root",
  group => "root",
  mode => 0644,
  source => "puppet:///apache/conf/",

Disable IPv6 on Debian

The following command will disable IPv6 on Debian:
echo net.ipv6.conf.all.disable_ipv6=1 > /etc/sysctl.d/disableipv6.conf
You need to restart your debian system afterwards.

debian - mail: command not found

On a new Amazon instance of Debian, I didn't have the "mail" command available. Installing postfix/exim4/qmail didn't help. The right package for this is "mailutils". In order to install it:
root@server# apt-get install mailutils

After that, the "mail" command should work fine:
root@server#mail No mail for root

15 April 2012

Linux: flush cache ram memory

I noticed that most of my memory was used by cache (more than 90%) so I decided to find a way to flush it, just for fun, I had no real reason to do it... this is the command that i've used and it worked:
root@localhost# sync; echo 3 > /proc/sys/vm/drop_caches