Linux

Resize video using Mencoder

Mencoder has many video filter and scale is one of them.

mencoder input.avi \
         -vf scale=64:-2 \
         -ovc lavc \
         -oac lavc \
         -ac mp3 \
         -o output.3gp

Tags: ,

How to install JDBC drivers and SAP JCo on Apache Tomcat properly

Developing web applications on Apache Tomcat is very easy including ones interact with DBMS or even SAP. The key component is JDBC driver and SAP JCo. However, common problem is about deploying the application. If you installed JDBC driver or SAP JCo improperly on Apache Tomcat, you may run it as long as you don't redeploy the application again. Whenever you redeploy the application or deploy another application using the same driver, all applications will crash immediately because the driver was not loaded properly (it was already loaded).

How to authenticate Pure-FTPd by Drupal

Pure-FTPd supports various authentication source. I have an application to offer a private storage to Drupal user. In particular, every users share the same data storage since they are all friends. The scenario is that I would like to limit number of concurrent connection for each user to prevent parallel fetching by FlashGet or its friends. So I gave an individual user and limited the concurrent connection instead.

Anyway, I don't want to have duplicated accounts for both Drupal and Pure-FTPd. It would be nice if the account is shared among the two system so users may change their password by themselves.

How to transfer file using netcat

Destination:

nc -l -p 10000 | tar xvf -

Source:

tar cvf - data/ | nc 172.16.137.133 10000

Tags:

How to change max open files limit in Linux

By default, each user is limited maximum number of open files to 1024. Sometimes this value might be insufficient, e.g., you are running peer-to-peer applications on the host. If you want to see the current value, run ulimit -n or ulimit -a to see all limits. Anyway, you should get error messages as follow whenever the limit is not enough.

Too many open files

How to install MySQL server 4.1 on Ubuntu Edgy

In Ubuntu Edgy Eft, the default repository only have mysql-server-5.0 since it is the lastest stable version. However, in some rare cases where existings codes are relying on MySQL 4.1, it is eaiser to install MySQL 4.1 to minimize the effect on the codes. Below is what I did.