Open Source Technologies

Memcache For Drupal in Ubuntu 13.04

Installation and Configuration of Memcached Daemon and PECL Memcache in Ubuntu for Drupal 7

Steps:

1. Install memcached in the server

sudo apt-get install memcached libmemcached-tools
sudo apt-get install php5-dev php-pear make
sudo pecl install memcache

Latest dev Version of Memcache can be installed via.

# If you haven't already installed PECL memcache
pecl install memcache-beta
# If you wish to "upgrade" to a beta release
pecl upgrade memcache-beta

2. Add memcache.ini in PHP conf.d directory

Batch Process Images in Linux

Sometimes its a pain when you want to modify, resize multiple files at once in Linux. Fortunately ImageMagick comes with a handy command called convert that makes the work simpler

Install ImageMagick in Ubuntu

sudo apt-get install imagemagick

Batch Process set of files in a folder and resize them to 1024X768

for file in *.jpg; do convert "$file" -resize 1024x768 "$file"; done

You may also try an app called as phatch for GUI related batch processing of images.

Snippet to bulk rename files by replacing strings in filename

Add www to URL using Apache mod_rewrite

For sites belonging to a domain name(Not Subdomain), one can access the site using the domain name with www, Ex: www.example.com or without it: example.com

Both ways the site can be accessed when a ServerAlias is created in the config. However this is confusing as session information for both is different, which means if one is accessing the site with www preceded and logs in, on accessing the site without www preceded - the server would have no information saved.

To redirect any domain name to use www by default, the following mod_rewrite condition can be used:

Apache URL Redirection on VPS

I faced an issue with redirecting a particular URL to another URL at the Apache settings. You can write an index.php(php based solution) file for redirecting the header to the required URL. However, this didnt seem to me like an apt solution hence I looked for a solution at the Apache Config itself.

Considering you have a VPS where you have configured the virtual host as follows:

ServerName pr.example.com
ServerAlias pr.example.com
DocumentRoot /sites/www/pr.example.com/public_html/
ErrorLog /sites/www/pr.example.com/logs/error.log

PiTiVi Video Editor - A Look

I wanted to try a Linux based video editor for editing video files which would do both video editing, converting and video compression using various encoding schemes. I had a hands on with ffmpeg command line video compression and conversion tool. I felt it was impressive.

I am not a very much versed in video editing. I needed a tool that would help me do the basic stuff without much fuss. Fortunately, I found PiTiVi as just the right tool I needed.

PiTiVi is a free, intuitive and featureful movie editor for the Linux desktop.