Jul 15 2010

Installing Python 2.6/2.7 on Debian Lenny

Just a quick note to Google-eyed installers of Python who can’t get python to start after compiling it from source. Debian 5 ships with Python 2.5.x and complains about libpython after you install 2.6 or 2.7. The solution is very simple and quick:

Create the following 2 symlinks to sort yourselves out:

ln -s /usr/local/lib/libpython2.6.so.1.0 /usr/lib/
ln -s /usr/local/lib/libpython2.6.so /usr/

If you’re on a 64 bit OS replace /usr/lib/ with /usr/lib64/

My full setup script for Python including threads etc is:

# as sudo / root:
wget http://python.org/ftp/python/2.6.4/Python-2.6.4.tgz
tar -xvzf Python-2.6.4.tgz
cd Python-2.6.4
./configure –with-threads –enable-shared
make
make install
# fix libpython2.6 problem
ln -s /usr/local/lib/libpython2.6.so.1.0 /usr/lib64/
ln -s /usr/local/lib/libpython2.6.so /usr/



May 31 2009

Convert Video for Viewing on the HTC G1/Magic Android phone.

The Google Android OS is the best mobile Operating System I’ve used, and the HTC G1/Magic phones are really excellent machines. They become even more excellent when you can take films and TV shows with you on your morning/evening commute. The train ride will never be the same again.
I’ve had to look up quite a bit to find the right and easy way to convert videos for the phone, and ended up collecting all the information I found into a neat and handy Bash script.  I assume this could work for any other phone using the 3GPP / H263 video decoder/codec/type, but I haven’t tested it (you’re welcome to try it out and let me know).

Please remember that I’ve done this for myself mainly, so it assumes you’re using a Debian based distro for the setup portion of the script. If you don’t have apt, you’ll have to do the leg work and get all the pre-equisites sorted out yourself.

The script has two main parts: Setup and Conversion. The conversion is pretty straight forward. To convert 3 files you simple do:

./androvideo videofile1 videofile2 videofile3

However, converting to the phone requires the h263 decode/encode libs and ffmpeg to be compiled against them. When you perform the Setup portion (via ./androvideo -s) the script will attempt to do all for you. Attempt is the key word here. NO promises it will work for you (it does for me, but I’m special :o ).

During setup, what is supposed to happen is:

  • Get all build dependencies for ffmpeg via apt.
  • Get a few libs ffmpeg will need, subversion, checkinstall and build-essentials
  • Downloads the amr shared libs from and attempt to compile/install
  • Get latest ffmpeg from svn and attempts to compile/install with the amr libs included
  • Get rid of temp dir, all downloaded files and compiled pre-install stuff

Download the script (right click and Save Link As)
You’ll have to “chmod +x androvideo” after you download it to make it executable

I could not have done this without the very good help from these resources:
http://www.linuxquestions.org/questions/linux-mobile-81/androidg1-and-video-converted-via-ffmpeg-h263-687163/
http://po-ru.com/diary/up-to-date-ffmpeg-on-ubuntu-hardy/
http://tldp.org/LDP/abs/html/
http://www.penguin.cz/~utx/amr


May 28 2008

Built in wifi in Ubuntu Hardy on Thinkpad T61p

Just  a short note to any googling bodies who like me might be stuck on this problem for days as I have been…

I could not get the built in IBM wifi card (Atheros, recognized as “AR5212 802.11abg NIC” in lshw -C network) on my  Thinkpad  T61p to work in Ubuntu 8.04 (Hardy) as well as other versions of Ubuntu on Live CD.  A PCMCIA card of the same chipset worked great and the internal card worked fine in XP, but not in linux. No matter what I did (and I did a LOT).
The solution was, as always, a simple one. I took the latest madwifi source from their subversion repository, and compiled it. Then took the latest wpa_supplicant and complied that against the madwifi source. That did the trick!

Update:

Run this to turn on the wifi blinkenlight (taken from here):

sysctl -w dev.wifi0.ledpin=1
sysctl -w dev.wifi0.softled=1

				

Feb 22 2007

Accessing GMail with CFMail

It sounds a pretty trivial thing, to access GMail from CFmail, but for those who’ve tried it, it will awaken nightmares.
Even though GMail and CFMail both have the word Mail in them, you cannot access GMail smtp via a CFMail tag in ColdFusion. That is because CFMail does not support SSL. What a shame. For those who deploy ColdFusion on Linux/Unix systems, there’s still hope in the form of Stunnel, a small GNU utility that acts as an SSL wrapper, allowing you to encrypt regular tcp/ip connection inside SSL. Setup is simple, and it works a treat.

You can get it at: www.stunnel.org