Setting up a local Drupal development environment on Ubuntu 12.10

I’ve recently started developing with the Drupal content management framework.  I did a lot of work with Drupal in the past, but haven’t done much work with the platform since Drupal 6.  While it still feels a bit strange coming from MVC frameworks and more expressive languages, it seems like Drupal and PHP have come a long way in offering a fluid development experience in the last few years.  This is how I set up my development environment in Ubuntu 12.10, though it probably works for newer releases of Ubuntu or other Debian-based Linuxes.

# Add the PHP5 PPA
sudo add-apt-repository ppa:ondrej/php5 
sudo apt-get update

# Install PHP5.  This will also install a recent version of Apache
sudo apt-get install php5

# Install PEAR, this will make it easier to install drush
sudo apt-get install php-pear

# Install drush via PEAR
pear channel-discover pear.drush.org
sudo pear channel-discover pear.drush.org
sudo pear install drush/drush

# HACK: The first time I ran drush it needed to install some dependencies via PEAR, 
# but I ran drush as my user so I didn't have permissions to write to the global PEAR
# directory.  Work around this by running drush with sudo and then chmoding your
# ~/.drush directory back to your own user.  You can probably just install the
# dependencies using PEAR.
sudo drush
sudo chown yourusername:yourgroupname -R ~/.drush

# For local development, I like using SQLite
sudo apt-get install php5-sqlite

# drush dl/en needs crul
sudo apt-get install php5-curl

# Drupal needs GD
sudo apt-get install php5-gd

Creating a video CD (VCD) from a YouTube video

As a Christmas gift for my father, I transferred a YouTube video of a public service announcement that he remembered fondly from his childhood to optical media so he could watch it on the television instead of on the computer.

There were some unique sets of constraints that made this an interesting project. First, I came to my parents’ house with only a Dell Mini netbook (with no optical drive) running Ubuntu Linux.  None of the computers had DVD writeable optical drives, but they could burn CDs.  My parents’ DVD player can play video CDs (VCDs) so I decided this would be a good option.

Capturing the video

I downloaded the YouTube video using the UnPlug extension for Firefox.  I chose to save the MP4 version of the video.

Transcoding the video

Since I would be burning the video on my mom’s notebook, I read the help documentation for the CD writing software to determine which video format the software needed to create a VCD.

VLC is usually my go-to tool for working with video, but I got errors about not having the correct codecs.  Rather than messing around, I wanted to just get the project done.  So, my next choice was FFmpeg.   It was a good choice because the software, though a command-line utility, has a preset for creating an mpeg file suitable for burning a VCD.

ffmpeg -i High\ Flight\ \(John\ Gillespie\ Magee\ Jr\ Poem\).mp4 -target ntsc-vcd high_flight.mpg

I was able to do this with the version of ffmpeg included with Ubuntu 10.04, but as ffmpeg is cross-platform it should be straightforward to do this on other platforms.

Burning the VCD

I copied the file to my Dropbox and downloaded it to my Mom’s computer using the services web interface.  Her burning software allowed me to just drag-and-drop the file into the burning program’s window.

Xubuntu Gutsy Gibbon on Dell Latitude D810

I got Rich’s old notebook from work and installed Xubuntu 7.10 (Gutsy Gibbon) see update below on it. I’m tracking issues I’m having with the distro/platform here.

Spell Checking in OpenOffice Writer – FIXED

After having this machine for a while, I just noticed this issue.  I followed some instructions I found here and tried File > Wizards > Install New Dictionaries.

Update: Volume Control Widget – FIXED

My volume control widget up and disappeared.  This post made the suggestion that instead of clicking the ‘Add’ button from the widget list (accessed by right clicking on the taskbar and choosing ‘Add New Item’), you can drag the volume control widget from the list window onto the taskbar and it works.

Update: Upgraded to 8.04

I upgraded via package updates to 8.04 (Hardy Heron) without any problems.

Can’t lock screen – FIXED

I added the screen locking widget to my top panel, but clicking it didn’t do anything. I fixed this by installing the xlockmore-gl package.

Can’t suspend/hibernate – FIXED

When I try to use the buttons to suspend/hibernate (I think these are from some gnome program), the screen goes blank, but I’m not able to resume.

Link to launchpad bug report about this issue.

Apparently, others with this laptop were able to have success by using the uswsusp package. However, they were running Feisty, not Gutsy.

Link to userspace software suspend home page.

Debian has a newer version of the uswsusp package, so I tried installing that because I found what appeared to be thorough docs on using the 0.7 version. Things still didn’t work.

I found another post on the ubuntu forums that aggregated a bunch of information about this issue. link.

I removed the fglrx video driver (a non-free driver) as this was mentioned as causing problems. After removing this driver, suspend to ram didn’t work, but hibernate did using the default login,shutdown,etc. menu. Using the s2ram program from the command line also worked!

Update: If I want to lock the screen on resuming from suspension, I use

s2ram; xlock&

Trackpad is slow

The trackpad seems to move extremely slowly. I can configure the eraserhead using the Mouse Settings panel, but this doesn’t effect the trackpad.

EVDO Card – FIXED

This was the most straightfoward thing so far. This forum thread helped my get my PC5750 EVDO card working just fine with pppd and wvdial.

Playing Encrypted DVDs

Add the following line to /etc/apt/sources.list

deb http://packages.medibuntu.org/ gutsy free non-free

Then run

sudo apt-get install libdvdcss2

Function Keys on Keyboard

These are the keys on the keyboard with additional functionality (written in blue on the keys and accessed by holding down the Fn key to the right of the left-hand-side Ctrl key) that do things like switch between CRT/LCD, eject CD media, change volume or brightness, etc.

disabling tap-to-click on synaptic touchpad in ubuntu

I was leant a Dell Latitude D810 that has a Synaptics touchpad.  Eventually, I had to admit that the tap-to-click setting was a little to sensitive and kind of annoying (most frequently, I accidently clicked things in my bookmarks toolbar in Firefox).  I found that I could disable the tap-to-click feature by adding the line:

 Option        "MaxTapTime"        "0"

to the appropriate section of my /etc/X11/xorg.conf file so that it looks like this:

Section "InputDevice"
    Identifier    "Synaptics Touchpad"
    Driver        "synaptics"
    Option        "SendCoreEvents"    "true"
    Option        "Device"        "/dev/psaux"
    Option        "Protocol"        "auto-dev"
    Option        "HorizEdgeScroll"    "0"
    Option        "MaxTapTime"        "0"
EndSection