Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Thursday, August 11, 2011

Sound for Ubuntu 10.04 on the Compaq Presario CQ56

After installing Ubuntu 10.04, and then every time the kernel updated, I had no sound. The operating system seems to detect the card, and I can set the volume, but no sound is played through the speaker.

I hope the next point release gets a fix for this, but in the meantime, this page has the solution for next time I need to update the kernel:

InstallingLinuxAlsaDriverModules.

The technique I use is to execute the following three lines at the command line, and then reboot:

sudo add-apt-repository ppa:ubuntu-audio-dev/ppa
sudo apt-get update
sudo apt-get install linux-alsa-driver-modules-$(uname -r)

Don't forget to reboot!


Note that you may hit the following error, which means that the package has not been created for the newer version of the kernel. The solution is usually to wait a few weeks for the package to be created and try again.

Couldn't find package linux-alsa-driver-modules-2.6.32-37-generic

Monday, May 2, 2011

Setting up a Google App Engine development environment on Ubuntu 11.04

  1. Install Ubuntu 11.04.
  2. sudo add-apt-repository ppa:fkrull/deadsnakes
  3. sudo apt-get update
  4. sudo apt-get dist-upgrade
  5. sudo apt-get install eclipse python2.5
  6. Launch Eclipse and install PyDev from http://pydev.org/updates
  7. Download Google App Engine from http://code.google.com/appengine/downloads.html
  8. Expand app engine code into source code folder
  9. Create a new PyDev Google App Engine Project (Ctrl+N)
  10. Set up run configuration
    1. Name your run configuration.
    2. Under "Project", add your Google App Engine Python project.
    3. Under "Main Module", enter the location of the "dev_appserver.py" script.
    4. Change to the "Arguments" tab and enter "${project_loc}/src" as first argument. After this argument, you may add all available additional arguments listed on the Dev Webserver documentation page. (Here, for example we changed the port where GAE is listening to 9999.)
  11. Run the project.
  12. Optionally use lib/django_1_2/django/bin/django-admin.py to create a new Django project. You will need to install Django first by running sudo python2.5 setup.py install

Monday, March 21, 2011

Retrieving streamed Flash video on Linux

This blog post on commandlinefu.com shows a fantastic one-liner to retrieve a streaming Flash file as it is being played. It seems that Flash writes to a file, but then deletes that file even as it is being used.

Reproduced here in case the other blog disappears one day:
for h in `find /proc/*/fd -ilname "/tmp/Flash*" 2>/dev/null`; do ln -s "$h" `readlink "$h" | cut -d' ' -f1`; done

Sunday, February 20, 2011

Copying video from the JVC GR-D850AA using firewire on Linux

It seems that our JVC GR-D850A works on Vista, but not on Windows 7, so I thought this might be something that Linux could solve for me.

I started up Kino on my Linux Mint Debian Edition partition, and was able to fast forward and rewind the tape, but I only saw a black screen when playing. CLI application dvgrab to the rescue.

To copy the video and split into timestamped files, I ran this command:

dvgrab -buffers 1000 -rewind -autosplit -format avi -timestamp video

I needed the buffering because I was streaming over a network.

Note that dv1 format seems to crash mplayer. Another useful command is this, which streams the video directly into mplayer:

dvgrab - | mplayer -

To control the tape, you can use the dvcont command:
dvcont stop
dvcont rewind
dvcont status

Using mencoder and find, the following command will convert a folder of AVI files into XVID format, saving them into a subdirectory called small:

find . -name "*.avi" -type f -exec mencoder {} -ovc xvid -oac mp3lame -xvidencopts fixed_quant=3 -o small/{} \;

Wednesday, January 5, 2011

Booting into the MBR of another drive using GRUB 2

I wanted to try dual booting Linux and Windows on my machine, whose existing Windows hard drive is fully encrypted with Truecrypt. To avoid complications with Truecrypt, I put another physical disk in the machine with the intention of installing Linux on that. I wanted to be sure that the install did not touch the Truecrypt disk, including the MBR on that disk. The intention is that the new disk will become the boot disk and it will either load Linux or boot from the MBR on the Truecrypt disk.

The first trick is to make sure that the Linux installer does not overwrite the MBR on the Truecrypt disk, potentially rendering it unbootable. During the "expert install" of Debian based distros (including Ubuntu), it is important to install Grub 2 and then instruct Grub not to install to the MBR of the first hard disk. The installer will then give you the option to specify the drive whose MBR to modify - at this stage, choose the Linux disk, rather than the Trurcrypt disk.

After setting the Linux disk to be the boot disk in BIOS, edit /etc/grub.d/40_custom as the root user and add the following lines to the end:

menuentry "Other Disk" {
    set root = (hd1)
    chainloader +1
}

The key here is to set root to the Truecrypt hard drive. Do not specify a partition, because we want to boot using the MBR of the disk. Booting into grub and using ls at the grub command prompt will give you a list of all the available drives.

After modifying 40_custom, run update-grub, and reboot. You should be able to boot into Linux or into the Truecrypt drive using the Other Disk menu entry.

Sunday, December 19, 2010

Installing Debian 5 (Lenny) on Microsoft Virtual Server 2005 R2 SP1

If you run into a kernel panic installing Debian 5 (Lenny) on Microsoft Virtual Server 2005 R2 SP1 (32 bit host and client), try this:
  1. Launch the Debian CD.
  2. Press TAB on the Install option to edit the command line.
  3. Change
    vga=normal
    to
    vga=791
  4. Add the following:
    noapic nolapic noreplace-paravirt
  5. Install as normal.

Thursday, December 16, 2010

Dynamic linking of shared libraries in Linux

To list the classes, functions, and methods exported by a shared library (.so), use this command:

nm -C --defined-only -g liblibrary.so

To view a list of shared libraries required by a program:

ldd program

Tested on Ubuntu 10.10. Note that the equivalent functionality in Windows would be provided by dumpbin.exe.