linux

mplayer crashed !

For unknown reason, mplayer crashed with a message:-

mplayer: ad_liba52.c:315: decode_audio: Assertion `len <= maxlen' failed

mplayer -nosound work’s fine but no one would watch a movie without any sound. Checking on google, I’d only got two results and the solution suggested at this blog seem’s to work.

mplayer -channels 1 file.ogm

Since google would only return two results, the primary intention of this post is just to make it redundant ;)

Btw, the movie I’m trying to watch is a korean 2004 A Family. Quite a nice movie but I’m not in the mood of writing movie review. Here is some screens and short review of the movie. This is my first korean movie after a very long break.

qemu on OpenSuse

Inspired by khairil’s blog on qemu, I’d installed it on my laptop running OpenSuse. As usual, I’m a lazy person and only care for something that work out-of-the-box. Khairil’s article look’s promising. These are my expection when trying something new:-

  • Easy to install, means I can get it as binary package or if no binary package available I can install it by ./configure && make && make install without pulling my hair or smashing my keyboard.

  • Quickstart. All I need to get started are just command --help, man command or a few keyword on google.

That said, installing qemu on Suse is quite easy. Just untar the binary package in your / directory and everything is ready to go. First test with KNOPPIX quite impressive although little bit slow (tooo slow actually) but that was expected. Fully loaded to KDE, KNOPPIX quite usable (I’d only tested with Firefox). The second test was installing my all the time favourite linux distro archlinux. The installation went fine, then I realized that network connection was emulated to the actual interface so there was no chance for me to test the recent archlinux support for wireless connection.

Having a usable archlinux system running (without X) I wanna see if I can configure it as a development server. Network connectivity from guest to host has no problem. I can ssh to the host machine but not the reverse. Checking the documentation, I have to use the -redir option to redirect the request to the guest os. So to enable ssh and http service from host OS, I need to start qemu with:-

$ qemu -hda image -boot c -redir tcp:555:10.0.2.16:22 -redir tcp:8000:10.0.2.16:80

Now I can ssh to guest OS using port 5555 and access the http server using port 8000. But this only work from the host machine. Trying to access the service at the mentioned port from other machine did not work. So to actually use qemu as virtual development environment, few questions remained:-

  • How to access the network services from other machine.
  • How to map the port to the actual listening port so I can just access the services as http://virtual-machine.com/ instead of http://virtual-machine:8000/.

SuExec PHP/FastCGI under Apache 2

I want to have both PHP4 and pHP5 on my system in more simple way. Already accomplished this before, but a little bit tedious. My hosting provider allow me to choose whether to use PHP4 or PHP5 for my site. I can even specify my own php.ini, so there must be some way to achieve this. Digging their knowledge base, I got the trade secret. They used Apache suEXEC to run PHP using FastCGI. Their setup also provide mod_php as a fallback if I don’t want to run PHP as a CGI. There are few benefits of this setup:-

  • The PHP process is run as the user itself and not the default apache user as in mod_php.
  • Using a wrapper, user can choose which binary (php4/php5) to run and also specify custom options to binary such as their own php.ini.

As for my developement purpose, this is great since I just need to specify different virtual host in my apache config pointing to the single application and have it tested in both platform (php4/php5). My setup can be seen here, in the wiki.

Reading Readme.FastCGI in php source, now I know that php also can be set to run as a seperate process from the web server, listening own it’s port serving request from the web server.

In this setup, PHP is started as a separate process entirely from the web server. It will listen on a socket for new FastCGI requests, and deliver PHP pages as appropriate. This is the recommended way of running PHP-FastCGI. To run this way, you must start the PHP binary running by giving it an IP and a port number to listen to on the command line, e.g.:

./php -b 127.0.0.1:8002

In term of performance and security, I can’t tell any word since no benchmark has been made and I’m not security expert.

y2pmsh - YaST2 Package Manager

I’ve been using Archlinux for almost 2 years and really like the idea of pacman -S packagename when I want to install something. However Archlinux is not quite ready yet for laptop, especially when dealing with wireless issues so I have to stick with OpenSuse which has wireless support out of the box. Installing package in OpenSuse is quite easy, all can be done through YaST2 interface with a few clicks (noticed: a few clicks). What can be accomplished with one command requires few clicks in OpenSuSE and I hate it. While doing some reading on the web, I’d just noticed that they provided command-line tool called y2pmsh as a backend to the GUI interface. Sounds good ….

[1] y2pm > search vim
     gvim (6.3.84-2) - A GUI for Vi
     kvim (6.2.14-121) - Vi for KDE, it also Includes a Vi Kpart
     kvim-debuginfo (6.2.14-121) - Debug information for package kvim
 i   vim (6.3.84-2 / _6.3.84-2) - Vi IMproved
     vim-debuginfo (6.3.84-2) - Debug information for package vim
[0] y2pm > install gvim
 +   gvim (6.3.84-2) - A GUI for Vi
[0] y2pm > commit
Installing from 'SUSE LINUX Version 10.0', media nr. 1
fetching gvim (1.0 MB) ................................................................................................. ok
installing [ 25%] gvim-6.3.84-2 (i586) ................................................................................. ok
Installing from 'Packman (SuSE LINUX 10.0)', media nr. 1

You will get a terminal upon starting y2pmsh through the command line. Just type ‘help’ to get a list of available commands. The one that you’ll probably need is just search, install, commit. Now it much faster … :)

cups printing - hp psc 1210

It’s seldom that I use printer at home. The last time I used it I think to print a resume for my current company. Today, I’d really need to use a printer to print some stuff. The printer that I have is HP PSC 1210 (not mine actually). I’m quite reluctant to setup the printer on my Archlinux system because of my previous experiences setting up printer on linux system is not that enjoyful. Some know how about the printer’s driver that work best with your system is needed plus some other application to make it work. Luckily, I’ve done it before, so I’d try to see if the notes that made sometimes ago still applicable to my current system. It’s was a post that I made to ittutor forum. Based on that notes, all that I need was to install the cups package from pacman. In that notes, I’m using a parallel printer, so most of the stuff to make parallel port working can be skipped. The HP that I have currently was a USB printer.

The system automatically detect the printer once I plugged it into the USB port and switched it on. Good start, I hoped. Then I started the cups services:-

# /etc/rc.d/cups start

Then log on to the CUPS’s web based management interface. I need to select the printer’s driver but none was listed in the CUPS configuration interface. I tried to select some random drivers and print the test page but nothing happened. Then I looked into http://www.linuxprinting.org/ to see if my printer works well with linux. It was, and the drivers are called hpijs. I try my luck with pacman:-

# pacman -Ss hpijs
extra/hpijs 1.7.1-1
HP Linux inkjet driver. Provides support for DeskJet, OfficeJet, Photosmart,
Business Inkjet and some LaserJet printer models.

No need to mention how happy I am.

# pacman -S hpijs
 Targets: foomatic-filters-3.0.2-1 hpijs-1.7.1-1

 Total Package Size:   1.4 MB

  Proceed with upgrade? [Y/n] y

Pacman download all the package but then complained there was a conflict:-

 checking package integrity... done.
 loading package data... done.
 checking for file conflicts...
 error: the following file conflicts were found:
 foomatic-filters: /etc/foomatic/filter.conf: exists in filesystem
 foomatic-filters: /usr/bin/foomatic-gswrapper: exists in filesystem
 foomatic-filters: /usr/man/man1/foomatic-gswrapper.1.gz: exists in filesystem

I know that I’d already installed package foomatic before but I don’t know what the differences between foomatic and foomatic-filters. I don’t care about that:-

# pacman -R foomatic
# pacman -S hpijs

This time, no conflict reported and all packages were installed. Restarting cups and I got the drivers for my printer listed. Print the test page and … it’s worked !!

running php4 and php5 concurrently

well, it's not really concurrent, but I want to be able to switch between php4 and php5 by just running one or two commands. to get started, I need to compile php5 from source. this one is based on my system, archlinux.

# cd /var/abs
# abs
# cd devel/php
# vi PKGBUILD

need to edit this line:-

./configure --with-apxs --prefix=/usr/php5 --sysconfdir=/etc/php5
--with-config-file-scan-dir=/etc/php5
--with-pear=/usr/share/php5/pear

make INSTALL_ROOT=$startdir/pkg EXTENSION_DIR=/usr/lib/php5 install
cp ../php.ini $startdir/pkg/etc/php5

the package name also need to be changed, since we already have package php installed.

pkgname=php5

and all I need to do is run:-

# makepkg
# pacman -A pkgname

we also need to define new apache configuration file.

# cd /etc/httpd/conf
# cp httpd.conf httpd-php5.conf
# vi httpd-php5.conf

edit these line:-

PidFile /var/run/apache-php5.pid
ScoreBoardFile /var/run/apache-php5.scoreboard
LoadModule php5_module /usr/lib/apache/libphp5.so

our php5 configuration file and module are located in:-
/etc/php5
/usr/lib/php5

test run php with:-

# httpd -f /etc/httpd/conf/httpd-php5.conf

if no error displayed, we are done. ref

old arch is gone ... new one comes in

my most terrible experience since I'm using archlinux happened two days ago. I accidentally wipe out my arch system while trying to install dragonflybsd on the seperate partition. don't know what really happened, whether I was selecting the wrong partition number or the dragonfly installer behaved differently. all that I know, my arch is gone .... with all the stuff that have not been backup for quite a long time :( . so .. in these few days I spent most of my time to setup the new arch system using the latest 0.7 Release (wombat) of course.

as usual, archlinux installation is quite easy and straightforward. with the more matured hwd (hardware detection tool) it's end up with almost a fully configured system. two new things really make a difference in 0.7 release - udev and xorg. although user still can choose to use either udev or devfs, I opt for the new udev. moving to udev is just a matter adding one line to your bootloader configuration file (lilo is my preffered choice).
append="devfs=nomount"

hwd script produced a ready to use xorg.conf file but it is name as xorg.conf.hwd, so it's up to you to use it by renaming as xorg.conf. I only notice this after starting X for the first time and discovered that my wheel mouse does not work in firefox. so looking back to /etc/X11, I found that there is no xorg.conf file, only xorg.conf.hwd. so xorg just starting my X without using and xorg.conf file ... cool !! :). to make my wheel mouse working I just add this line to my xorg.conf file
Option "Buttons" "5"

another glitch was mplayer unable to access audio device as normal user. looking through udev permission, I discovered that audio device is accessible to the member of group audio, so it's just a matter of:-
gpasswd -a kamal audio
which will add user kamal to the audio group. to create a symlink for my cdrom/cdrw/dvd device, there's already file named cdsymlinks.conf in /etc/udev. all I have to do just uncomment the line:-
OUTPUT="CD CDRW DVD DVDRW DVDRAM"
and restart udev through
/etc/./start_udev
and the new device node will be populated.

all in all, setting a new system with archlinux 0.7 is painless.

alsa oss emulation is working ! shame on me

For so long, since I moved to Archlinux I have a belief that Alsa\'s OSS emulation is not working, at least on my system. I spent so much time searching on google and asking on irc until giving up with that belief. It\'s totally my mistake. I broke the #1 rules - read the doc ! Thanks to a friend asking how to configure ALSA for his soundcard which get me back to the docs. I\'m not really sure what made me think that I\'ve done all the necessary step. Two mistakes actually - I did not install alsa-oss package and I forgot to load snd_pcm_oss module that will provide OSS emulation for alsa. Correct this and it takes not more than 5 minutes to get everything to work.

# pacman -S alsa-oss
# modprobe snd_pcm_oss
Add this entry to /etc/devfsd.conf

REGISTER sound/.* PERMISSIONS root.sound 660
REGISTER snd/.* PERMISSIONS root.sound 660
Create sound group and add user to that group, restart devFS. Although I can simply chmod 777 for the sound devices, I thought this is better.

# groupadd sound
# gpasswd -a kamal sound
# killall -HUP devfsd
Now I can use all player that still need OSS such as moc, mp3blaster and xmms without the Alsa output plugin.

the lion sleep tonight

Someone on irc (#archlinux@freenode) send me this file. Just like the guy said, "when you are a little sad, or depressed, it is the best way to smile again...". It's funny and it's the hippo ! :)
.

Grab the file (1.5MB) here

some news

a lot of things happened today ...

  • Kernel 2.4.26 is out .......
  • Mandrake 10 Official is out .. available to club members
  • Lindows changes name to 'Linspire - story
  • a flaw found in Mplayer - the typical buffer overflow.
    A remotely exploitable buffer overflow vulnerability was found in MPlayer. A malicious host can craft a harmful HTTP header ("Location:"), and trick MPlayer into executing arbitrary code upon parsing that header.

source - osnews, slashdot

another news from the register - X is now free of XFree86.
A new version of the X11 windowing system, used by Unix-like operating systems including Linux, will become generally available in ten days time. What's significant about this one is that it's likely to be the one that will face most users in future distributions. Known as X11R6.7, it's the first release from the XOrg consortium, which was originally founded to steer the specification in May 1999, but only recently decided to do something about, citing the glacial pace of development by the XFree86 consortium. XOrg created the XOrg Foundation which is backed by IBM, Sun and HP and blessed by Jim Gettys, one of the authors of the original X11 specification twenty years ago. XFree86 continues to be supported by a clutch of smaller Linux distributions, including Conectiva and Slackware, although the big players including Novell and Red Hat have thrown their weight behind XOrg's efforts.
The new XFree86 license has been in controversial leading to the fork of XFree86 project. The new X.org server is just an enhancement over the latest XFree86-4.4 which was claimed to be incompatible with the GPL license. Searching through the Arch repository, I found that they had placed the package for X.org server in the testing rep. Discussion in the forum also pointed out that there's still no decision by the arch developers whether to use the new server as default in the next arch release. Btw, I'm still running 4.3 version, no planning for upgrade yet. :)

Syndicate content