#!/bin/sh mem=$(LC_ALL=C free | awk '/Mem:/ {print $4}') swap=$(LC_ALL=C free | awk '/Swap:/ {print $3}') if [ $mem -lt $swap ]; then echo "ERROR: not enough RAM to write swap back, nothing done" >&2 exit 1 fi swapoff -a && swapon -a
#!/bin/sh mem=$(LC_ALL=C free | awk '/Mem:/ {print $4}') swap=$(LC_ALL=C free | awk '/Swap:/ {print $3}') if [ $mem -lt $swap ]; then echo "ERROR: not enough RAM to write swap back, nothing done" >&2 exit 1 fi swapoff -a && swapon -a
You can read my last post on LeaseWeb Labs – Streaming Video on Demand with nginx and RTMP Module
The version 3.7 of Linux Kernel was just released few days ago (11 December). In this version there are a lot of interesting features, and I will mention only unified system architecture support for ARM, TCP Fast Open and Virtual extensible LAN tunneling protocol. For an extended list of the new features, you can check a list here.
Today I had this error on my Ubuntu Linux box
Fatal error: Cannot redeclare geoip_country_code_by_name()
The reason was that I have geoip extension enabled in my PHP configuration and also I used the geoip.inc file from maxmind.com.
The solution is very simple. Actually, there are two solutions:
First is to disable the geoip extension from your configuration. In /etc/php5/apache2/conf.d/geoip.ini comment the first line:
;extension=geoip.so
The second solution: in your geoip.inc file, look for this code
function geoip_country_code_by_name($gi, $name) { ... } function geoip_country_name_by_name($gi, $name) { ... }
and replace with
if (!function_exists('geoip_country_code_by_name')) { function geoip_country_code_by_name($gi, $name) { ... } } if (!function_exists('geoip_country_name_by_name')) { function geoip_country_name_by_name($gi, $name) { ... } }
It seems it is a bug (I didn’t investigate too much) in Ubuntu 10.x related to PHP files in userdirs.
On my box I have Ubuntu 10.10, Apache/2.2.16 (Ubuntu) and PHP 5.3.3-1. Everything worked fine except the PHP files from ~userdir. Instead to parse these files, the web server send them directly to the browser which open the “save as” window.
The problem is in /etc/apache2/mods-enabled/php5.conf file.
<IfModule mod_userdir.c> <Directory /home/*/public_html> php_admin_value engine Off </Directory> </IfModule>
These lines should be commented:
#<IfModule mod_userdir.c> # <Directory /home/*/public_html> # php_admin_value engine Off # </Directory> #</IfModule>