Linux

Working config for nginx + Drupal + Boost

Self-notes...after spending a few hours researching and benchmarking various configurations. Apache is so old news.

Setup:

  • Ubuntu Lucid Lynx (10.04)
  • nginx as frontend webserver
  • Drupal served using fastcgi to phpcgi
  • ...and Drupal's Boost module.

Most of these configs is gathered from http://groups.drupal.org/node/26363.

How fast is it now? How about almost 6,000 requests/sec, with throughput around 240Mbps? Fast enough?

nginx error: 413 Request Entity Too Large

Encountered this error when I tried to upload a large file. nginx default is too small. To upload bigger file, add this line in /etc/nginx/nginx.conf, somewhere inside the http section:

http {
    ....
    client_max_body_size 20M;
    ....
}

Save, and then restart your nginx instance.

L2TP IPSec server setup for Linux

Tested under: CentOS 5.2, Ubuntu Intrepid Ibex (8.10), Ubuntu Hardy Heron (8.04), both 32-bit and 64-bit flavors. 

Tested working with the following clients: Windows XP, Windows Vista, iPhone, Mac OS X Leopard.

How to fix "VMware Workstation was unable to claim the device (No such file or directory)"

I'm running Ubuntu 7.10 using custom 2.6.23.11 kernel. Somehow, starting from kernel 2.6.23, VMware was unable to properly use my Windows Mobile PDA (Atom O2 Life). Every time I plugged in the Atom, VMware will spurt out "VMware Workstation was unable to claim the device" message. The issue was actually with VMware, and not the kernel. Follow the steps outlined below to work around this bug in VMware.

Setting up Nokia phone as modem under Linux

Linux: Guide on configuring Nokia phone as GPRS / 3G / EDGE / HSDPA modem

NOTE: Some parts of this tutorial is probably outdated.

Using imapsync to backup / archieve your Gmail emails

1. Download and install the latest version of imapsync at http://www.linux-france.org/prj/imapsync/dist/. As of today, the latest version is 1.255.

Recovering from stuck modifier keys caused by VMWare

I use VMware a lot, mostly using VMware Workstation 6.0.2 under Linux host. However, from to time, some or all of the modifier keys (Ctrl, Shift, and Alt) somehow ceased to function. Seemed that sometime VMware failed to correctly restore those keys function to X server.

Here's simple command, using xmodmap (installed as part of X base utilities) that will fix this issue. xmodmap is assumed to be located at /usr/bin

Starting with SQLite

SQLite is a small C library that implements a self-contained, embeddable, zero-configuration SQL database engine. The primary benefits of using SQLite is that you can create a self-contained database in your application.

What is so great about this? Well, for starters you can:

  • Manipulate data inside your program using standard SQL construct.

  • Zero database configuration – but you get database-like capabilities for your program.

Installing and configuring FireHOL

Linux / Network: Beginners guide to FireHOL.

NOTE: Content of this tutorial is probably outdated.

Part 1

Having firewall is one of the steps you can take to make sure that you machine is a little bit secure. This is achieved by opening access only to application or ports that you explicitly allow, and blocking the rest. This for me is a good practice, although some people might argue otherwise.

Defragment XFS File-system

I have been using XFS file-system for all my Linux box for quite some time now. XFS have some fancy features such as live file-system defragmenting. Let's cover how to do that.

First, make sure you have the xfsdump utilities install. For Ubuntu or its derivatives distribution, simply issue this command:

sudo apt-get install xfsdump

Then, optionally you can check how fragmented your file-system is by this command: