Apache’s ProxyPass on Ubuntu

  1. Install apache2. On Ubuntu type:
     # apt-get install apache2
  2. Activate mod_proxy:
     # a2enmod proxy
  3. Create a new file in /etc/apache2/sites-available, named metak (or whatever):
    NameVirtualHost *
    <Virtualhost *>
      DocumentRoot "/var/www/metak"
      ServerName localhost
      ServerAdmin support@mycompany.com
      DirectoryIndex index.html index.phpProxyRequests On
      ProxyPreserveHost On
      ProxyVia full
        Order deny,allow
        Allow from all
      ProxyPass        /  http://www.metak.com
      ProxyPassReverse /  http://www.metak.com
  4. Enable the new site and restart apache2:
    # a2ensite metak
    # /etc/init.d/apache2 reload

Ruby tricks

A short little method that helps find methods up the class latter:

class Object
  def my_methods
    self.class.ancestors.each {|anc|
      puts "#{anc}:"
      p anc.instance_methods(false)

It was copied from Stupid easy Ruby tricks

Recursive recovery of MySQL databases

On Red Hat Enterprise MySQL is recovered with these commands:

cd /var/lib/mysql
find . -name "*.MYI" -exec myisamchk -r '{}' \;