Archive for the ‘Software’ Category

CentOS 5.5 ImageMagick install + php module

Working this morning, I had to get ImageMagick working on a CentOS 5.5 VM. Pretty easy with YUM right? Well there were some complications installing the associated PHP module. So after doing the usual yum update, here is what you should do.

  1. yum install ImageMagick ImageMagick-devel
  2. If you are lucky “pecl install imagick” will work, if so skip to last 2 steps. If not continue along. I got the $PHP_AUTOCONF error.
  3. Head over to – http://pecl.php.net/package/imagick – and download the latest tarball (wget or whatever you fancy). At time of writing, I used “imagick-3.0.0RC2.tgz“.
  4. tar xzvf [da archive name] and cd into said archive
  5. gotta compile this thing from source: a) phpize b) ./configure c) make d) make install (as root … duh!) [check out Steven's post on webhostingtalk.com]
  6. load & restart: a) echo "extension=imagick.so" > /etc/php.d/imagick.ini b) /etc/init.d/httpd restart
  7. check to see if it was installed: php -m | grep imagick

Now let’s check to see if imagemagick “works”. Create a .php file on the server and access it with your web browser. Excerpted from docduke’s post on astahost.info.

<html> <head> <title>Test for ImageMagick</title> </head>
<body> <?
function alist ($array) {  //This function prints a text array as an html list.
$alist = “<ul>”;
for ($i = 0; $i < sizeof($array); $i++) {
$alist .= “<li>$array[$i]“;
}
$alist .= “</ul>”;
return $alist;
}
exec(“convert -version”, $out, $rcode); //Try to get ImageMagick “convert” program version number.
echo “Version return code is $rcode <br>”; //Print the return code: 0 if OK, nonzero if error.
echo alist($out); //Print the output of “convert -version”
//Additional code discussed below goes here.
?> </body> </html>

MediaTomb 12 on Debian 5 for DirecTV MediaShare/DLNA

I have been trying unsuccessfully for the past couple of months (on and off) to stream content from my home Linux servers to several DirecTV HR20-700′s. This latest attempt, actually worked and I wanted to document my exact setup as no other literature has done.

Stuff you need:

  1. Debian 5 installed on a computer with ~ 1GHZ CPU, 256MB RAM, hard drive with media content on it
  2. reliable Internet connection
  3. a DirecTV HR2x

 
 
Here are the exact commands you need to run, I’ll explain them later.

apt-get update
apt-get upgrade
apt-get -y install screen vlc vorbis-tools mpg123 ffmpeg unzip subversion build-essential autoconf automake curl libexpat-ocaml-dev libsqlite3-dev libcurl-ocaml-dev libid3-3.8.3-dev libtagc0-dev libavformat-dev libexif-dev
svn co https://svn.mediatomb.cc/svnroot/mediatomb/trunk/mediatomb mediatomb
cd mediatomb
autoreconf -i
./configure
make
make install
cd
wget http://vraidsys.com/article-includes/mediatomb.zip
mv mediatomb.zip /etc/
cd /etc/
unzip mediatomb.zip
rm mediatomb.zip
mkdir /var/lib/mediatomb
chmod -R 777 /var/lib/mediatomb/
cd
mv /etc/mediatomb/mediatomb /etc/init.d/
vi /etc/init.d/mediatomb < -- change line so ethX reads eth0, eth1, or whatever your LAN network interface card is assigned to
chmod +x /etc/init.d/mediatomb
update-rc.d mediatomb defaults

The idea is that the default MediaTomb install found in the repos (version 11) doesn’t support transcoding quite right for the DirecTV HR2x. So we do an install from the repos for a bunch of dependencies for the latest code (version 12) that we then checkout from the project SVN repo. A new configuration script that I built is downloaded and installed. It has support for transcoding ogg, mp3, flac, flv, avi, mkv, mov, and a few other formats (pretty easy to add support for other formats check out –> http://mediatomb.cc/dokuwiki/transcoding:transcoding#directv_hr2x_transcoding).

MediaTomb will be automatically started on boot. It can also be stopped and started manually by: /etc/init.d/mediatomb stop or /etc/init.d/mediatomb start.

You can then go to the webui of MediaTomb and update your media library. –> http://hostname:49152/

Your Ad Here

extract hdd data using GParted Live

Today I had the misfortune of being stuck at school without my library of diagnostic/repair CDs. I was dealing with a corrupted Windows Vista (64 bit) install, make that one corrupted sys file. The one that operates the low-level hard drive access functionality. Of course the user in question was without her install/repair disk. Fortunately for me I had two 4GB USB sticks, and a fast Internet connection. Thanks University of Minnesota for the fat pipe! Anyways …

Fortunately for me the laptop’s BIOS allowed one to boot from a USB stick. I would really have been stuck then: no CD-R’s, no server to PXE boot from, and no floppy drive. Oh floppies … but I digress.

All that I needed was a live Linux environment to mount the hard drive that I wanted to get data off of and an extra USB stick for holding the recovered data. I first downloaded a copy of the USB zip image of GParted Live ~100MB. I then used Live USB Helper (for windows) to write a copy of the image to one of my USB sticks. I know, shock … the man who bashes Windows on occasion actually uses it. Well my XP Pro 64bit install supports the hardware the best.

Excerpted:

Download Live USB Helper to help you to create this Live USB flash drive. Just install the program on MS windows, then you can follow the GUI to create the live. You need the GParted live zip file for this method. PS. To run Live USB helper program on MS windows, you need a dll file “vb6stkit.dll”. If Live USB helper complains about no vb6stkit.dll was found, you can download it on http://www.dll-files.com and read the FAQ to install it.

I booted in from the USB stick to GParted, and after a bit of confusion remembered that Vista encrypts its data partition! Argh! Secure yes, but makes supporting users difficult.

I could have been like:

mkdir /mnt/hdd
mkdir /mnt/usb
mount /dev/sda2 /mnt/hdd
mount /dev/sdb1 /mnt/usb
cd /mnt/hdd
ls
cd /Documents and Settings/[user name]
cp -r * /mnt/usb

Moral of the story: always keep a backup of your data.

Return top