Monday, March 12, 2012

Clock settings in gnome like windows


To see all the options: man date | less +/"FORMAT controls"

mine are like windows 7: %H:%M%n%d/%m/%Y

Sunday, March 04, 2012

Using PHP5-FPM With Apache2 On Ubuntu 11.10

http://www.howtoforge.com/using-php5-fpm-with-apache2-on-ubuntu-11.10



Could not reliably determine the server’s fully qualified domain name

sudo gedit /etc/apache2/httpd.conf

ServerName localhost
sudo /etc/init.d/apache2 restart

Thursday, March 01, 2012

Apache

How to redirect your website base on country ip request, Apache, geoip, rewrite

Install the mod-geoip

sudo apt-get install libapache2-mod-geoip

Enable the mods:

sudo a2enmod rewrite
sudo a2enmod geoip

In your file ".htaccess" add these lines:

# if country is PT
RewriteEngine on
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^PT$
RewriteRule ^(.*)$ http://www.site.pt

# else
RewriteEngine on
RewriteRule ^(.*)$ http://www.site/en/

You have to configure the virtual host to read the .htaccess file.
<directory /var/www/site/>
 Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        allow from all
</directory>


In your file "httpd.conf" add these lines:


GeoIPEnable On
GeoIPDBFile /usr/local/share/geoip/geoip.dat



Download the file from http://www.maxmind.com/app/geolitecountry and put it in /usr/local/share/geoip/geoip.dat

There are a lot of versions. This one is free for countries :)




Using mod_spdy With Apache2 On Ubuntu 12.04
from: http://www.howtoforge.com/using-mod_spdy-with-apache2-on-ubuntu-12.04

SPDY runs over HTTPS, so we need an HTTPS-enabled web site to test SPDY. Please note that SPDY will fall back to HTTPS if the user's browser does not support SPDY or if things go wrong, so installing mod_spdy doesn't hurt your existing setup.

a2enmod ssl
a2ensite default-ssl
/etc/init.d/apache2 restart

cd /tmp
wget https://dl-ssl.google.com/dl/linux/direct/mod-spdy-beta_current_amd64.deb
dpkg -i mod-spdy-*.deb
apt-get -f install
/etc/init.d/apache2 restart
chrome://net-internals/#spdy

xfce4-screenshooter keyboard shortcut

sh -c 'xfce4-screenshooter --fullscreen --save "$HOME/Pictures/Screenshots/Screenshot_$(date +%Y-%m-%d_%H:%M:%S).png"' s...