Blogs

Preparing and presenting video for the web...

Recently, I've had to convert a 15 minute infomercial for BetterDaysMinistries.org, a non-profit organization. I was provided with a dvd, that cycled the infomercial twice during playback. Besides, the phone number and address shown on the original infomercial was old and that information needed to be updated. Below are highlights of the whole conversion process.

Migrating sites between DirectAdmin servers

These are some basic notes for reference just in case I need to do the migration thing again!!!

Steps taken on the old server

  1. Created a new reseller account.

  2. Created sites in the new reseller account as domain.com2 for the domains that needed to be migrated. DA won't let you add the same name twice, which is why I used a different one for the time being. Doing this will setup all the required files/paths needed to use the website.

  3. Copied the files to the new domain.
    # cp -pR /home/olduser/domains/domain.com/* /home/newuser/domains/domain.com2/
    # chown -R newuser:newuser /home/newuser/domains/domain.com2
  4. Did a search for the old file path and updated it to the new file path.
    # for x in `find /home/newuser/domains/*/public_html -type f -print0 | xargs --null grep -l /home/olduser`; do perl -pi.bak -e 's/\/home\/olduser/\/home\/newuser/g' $x ; done
  5. Swapped around the the email folders.
    # cd /etc/virtual
    # mv domain.com domain.com.tmp
    # mv domain.com2 domain.com
    # mv domain.com.tmp domain.com2
  6. Copied over the imap files. Any data in /home/olduser/imap needed to be copied over. There will also be permission issues as well, but can be fixed afterwards with the set_permissions.sh script.

  7. Changed user for the imap files.
    # find /home/newuser/imap -user olduser | xargs chown newuser:newuser
  8. Renamed the existing domains with a suffix of ".old".

  9. Renamed the new domains to domain.com from domain.com2.

  10. Logged in as reseller and created a backup.

  11. Created a script and dumped out single databases.
    #!/bin/bash
    # dbExport.sh

    OLD_DB=(
    db1
    db2
    db3
    ...
    )

    for ((i=0; i<${#OLD_DB[@]}; i++))
    do
      mysqldump --opt -u root --password={psswd} ${OLD_DB[$i]} > ./db/${OLD_DB[$i]}.db
    done
  12. Did a search and created a list of folders with 777 permission set.
    # find /home/newuser/domains -perm 0777 -type d > 777.txt
  13. Setup dns for each domain with a www1 A record to point to the new server IP. Better solution, would be to edit the local hosts file for testing purpose.

Nepalese NGO Releases Localised Open CD

In its on going efforts to bring the power of FOSS based technologies to the mountainous asian nation of Nepal, the Madan Puraskar Pustakalaya has released a localised version of the Open CD.

The Open CD is a project to create a collection of FOSS applications that run on the Windows platform, from Open Office to Firefox and beyond.

Localized Free and Open Source Software, Nepali Open CD 1.0

Madan Puraskar Pustakalaya (MPP) has released the Nepali OpenCD 1.0 in January 9, 2007. The Nepali OpenCD 1.0 is a compilation of free and open source software localized into Nepali and runnable in the Windows operating system and developed by Madan Puraskar Pustakalaya. After the release of two different versions of NepaLinux, a localized Linux Distribution in Nepali, the development of the Nepali OpenCD 1.0 is yet another attempt of Madan Puraskar Pustakalaya for promoting the usage of localized Free and Open Source Software in the region. With the existing old legacies of the Windows operating system deeply rooted in the masses, the localized OpenCD is believed to be a motivating factor for switching to the Free and Open Source Software. The translation and localization of the software has been supported by the International Development and Research Centre, Canada under the PAN Localization Project.

Contents of the Nepali OpenCD

The localized Nepali OpenCD consists of the following software:
1.OpenOffice.org Suite (Office applications like Writer,Calc,Impress,Base etc.);
2.SeaMonkey Browser and Mail client (Browser and mail client);
3.Gimp (Image Manipulation Software);
4.FileZilla - 3(FTP Client Program for uploading and downloading files);
5.VLC Media Player (Software for playing audio video files);
6.Nepali Unicode Keyboard driver (Input System for Nepali).

Pre-requisites for running the software included in the OpenCD after installation

In order to run the software included in the OpenCD after installation, the Nepali Unicode Keyboard driver, also included in the OpenCD has to be installed first in the computer.

Both the Open CD and its sister project Nepalinux can be found at nepalinux.org

Serving files from a folder outside the web root with mod_rewrite

I was serving static content within a drupal installation, which became a huge nightmare when doing upgrades. So, I decided, I should just create a symbolic link to a folder outside the installation and route the traffic via mod_rewrite rules.

I first created a folder called "/var/www/site_files" and then symlinked to it from "/var/www/html/site_files". This way, I just have to recreate one single symbolic link after doing the upgrades.

With the below rules, I was able to maintain the links to the existing pages.

  ## BEGIN: site_files ##
  # Redirect to the homepage if site_files is being called
  RewriteRule ^site_files/?$ http://%{HTTP_HOST}/ [L,R=301]
  # Apped / at the end of url, if directory is being called without /
  RewriteCond %{REQUEST_URI} !^/?$
  RewriteCond %{DOCUMENT_ROOT}/site_files%{REQUEST_URI} -d
  RewriteRule ^(.+[^/])$ /$1/ [R=301,L]
  # Get directory or file if exists in site_files directory
  RewriteCond %{REQUEST_URI} !^/$
  RewriteCond %{DOCUMENT_ROOT}/site_files%{REQUEST_URI} -d [OR]
  RewriteCond %{DOCUMENT_ROOT}/site_files%{REQUEST_URI} -f
  RewriteRule ^(.*)$ site_files/$1 [L]
  ## END: site_files ##

New Server CentOS 4.4 at LT Grid with ISPConfig Installed

These are notes, I had taken down while setting up ISPConfig Hosting Control Panel on LayeredTechs Grid. Most of the steps were referenced via howtoforge and ispconfig installation notes. There were some gotchas to look out for and has bee noted below:

Create and Manage Virtual Machines Using VirtualBox in Ubuntu

VirtualBox is a general-purpose full virtualizer for x86 hardware. Targeted at server, desktop and embedded use, it is now the only professional-quality virtualization solution that is also Open Source Software.

Full Story

Backup and Restore Linux Partitions Using Partimage

Partition Image is a Linux/UNIX utility which saves partitions in many formats (see below) to an image file. The image file can be compressed in the GZIP/BZIP2 formats to save disk space, and split into multiple files to be copied on removable floppies (ZIP for example), … Partitions can be saved across the network since version 0.6.0.When using Partimage, the partitions must be unmounted.

Full Story

Check for number of arguments in bash

# Check for proper number of command line args.

EXPECTED_ARGS=1
E_BADARGS=65

if [ $# -ne $EXPECTED_ARGS ]
then
  echo "Usage: `basename $0` {arg}"
  exit $E_BADARGS
fi

looping through an array with the for loop in bash

VALUES=(
value1
value2
value3
...
valueN
)

# Alternately:
#VALUES=("value1" "value2" "value3" "..." "valueN")

for ((i=0; i<${#VALUES[@]}; i++))
do
  echo ${VALUES[$i]}
done

Flash Player 9 released for linux

Adobes' Flash Player 9 is now public ready and can be downloaded from macromedia.mplug.org.

Quick install on Fedora using yum repository:

  1. Create the yum repo file as below:
    # cat << EOF > /etc/yum.repos.d/macromedia.repo
    [macromedia]
    name=Macromedia for i386 Linux
    baseurl=http://macromedia.rediris.es/rpm/
    enabled=0
    gpgcheck=1
    gpgkey=http://macromedia.mplug.org/FEDORA-GPG-KEY
    EOF

  2. Install the flash-plugin via yum:
    # yum --enablerepo=macromedia -y install flash-plugin

Syndicate content
Comment