Monday, December 22, 2008

OpenSolaris with Blender 3D, Fetchmail, Sendmail, Procmail , Dovecot, and the Gimp

Today I got the OpenSolaris install a few steps closer to the replaced Linux install. I compiled Blender 3D, the Gimp, Procmail, and Dovecot--a few issues with Blender compiling, but then a Wiki explained how to build on OpenSolaris.

OpenSolaris already has fetchmail and sendmail packages in the main repo, so it was a matter of configuring sendmail to use the procmail mailer. The hardest part was figuring out how to make procmail use Maildir format. The answer was simple:

in /etc/procmailrc add this line:

DEFAULT=$HOME/Maildir/

The trick was the "trailing" slash to tell procmail to use maildir format. The man page for procmailrc clearly states so. I'm sometimes to quick to google something before RTFM, and what is really a simple solution becomes overly complex by endless online searches.

Sunday, December 21, 2008

OpenSolaris 2008.11 Revisited



Picture of OpenSolaris 2008.11 Desktop.

I last spoke about my encounters with OpenSuse, FreeBSD, and OpenSolaris. After writing that entry, for some reason, I kept thinking about my encounter with OpenSolaris. Maybe it was that I'm back on Solaris machines at work, or maybe it was the small OpenSolaris icon Firefox mistakenly replaced on one of my always visible bookmark links. Either way, I've decided to give it another go--this time diving in.

Initially, I ran it for a few days on my laptop. The primary purpose being to get more familiar with its capabilities as a desktop machine. Once I was satisfied and more familiar with it's capabilities, I wiped my "just-updated" OpenSuse 11.1 off my main home computer. My experience is still a work in progress, however, I am very happy with it so far. It does have a learning curve--even for an experience Linux user, however, I think it will be worth it.

Here are some high level thoughts in various areas:

Install Experience:
Very simple, if not easier than the most recent Linux Fedora/OpenSuse distros. The most complicated piece for me was partitioning--the install gui does not let do any advanced partitioniong, so you must bring up a command terminal and run the "format" command. While text-based, the entire format/fdisk capabilities are very easy for anyone with any fdisk or parted experience.

Startup Experience:
I _really_ like the whole service-based system as opposed to the rc.d/init.d scripts. Once you learn the svcadm and svcs commands, it's really cool. Services are managed very well and each has a dedicated log file. Failed services go into a maintenance mode where an admin can diagnose and restart. The initial boot time was slow, however, future boots are much faster. Linux users familiar with grub will be right at home. OpenSolaris uses grub with the additional Boot Environment capabilities to manage multiple "versions" of the installed software on the zfs file system--very nice for user updates and kernel updates.

Initial Desktop / Network Experience:
OpenSolaris ships with NVidia drivers, so it was a few mouse clicks to have the initial desktop up and running with Compiz on a dual-head display. The desktop network icons work fairly well to automagically attach to wireless or cabled networks. I had a few issues with wireless, so I had to come up to speed with ifconfig and dladm. The nice thing about both tools is they are very well documented in man pages and online docs.

32 / 64 bit differences:
This was hard to figure out--most Linux distros you just download the 32 or 64 bit installer, then you have that version installed. Of course 64 bit installs run 32 bit code. OpenSolaris is a little different. It's a unified OS, so the installed installs 32 and 64 libs. During the boot, the system figures out which kernel to boot.

Now, even though my kernel is 64 bit, when I launch firefox, it's the 32 bit version. Many programs have 32 and 64 bit version, so my guess is you can choose you desired architecture on many programs. Look for the bin/amd64 and lib/64 folders to get an idea--I'm still figuring this out.

Software and Updates:
The IPS ( network based package system ) does a decent job of updating packages. One of the criticisms of OpenSolaris is the available number of software packages. Even from the Linux crowd, you come across this argument from time to time ( shame on you ). It is noteworthy to see the available number of packages already available. I did feel that many of the packages on BlastWave and other repos were just too old. Any experienced Linux user would realize that the argument of "Distro X has 10k packages and OpenSolaris only has a fraction of that" is not really an argument. Linux was in the same boat just a few years back, and OpenSolaris ( IPS infrastructure in place now ) will catch up quickly. In addition, all one has to do ( just like we all did a few years ago on Linux ) is to download the source code to a package with its dependencies-- a few ./configure / make / make install commands later and it's there.

I did this on OpenSolaris and now have running dansguardian, openldap, mplayer, postgres, squid, kdelibs, kmymoney, and others. Some of these do have pre-compiled packages--I chose to get more recent versions the old fashioned way. Needless to say most compiled without incident--and using 64 bit flags or 32 bit flags where I desired.

Bottom line is don't let the current list of available pre-packaged software hold you back--if you know how to build src pacakges, you're set. Otherwise ask around or just give it time.

Device Driver Supprot
I have 2 issues with device driver support. The first is audio on the ICH10 hd intel chip. The second is printers. I believe the audio is being looked into now. OpenSolaris printing gives you 2 options ( the default lp service or CUPS). Switching between the two is simple ( print-service command ). Under lp, I printed fine to my laserjet, but not to the hp inkjet. Both printers were detected fine. Under CUPS, neither printer worked--I believe there is a known CUPS issue with USB printers.

I'm not too concerned here, as even the latest Linux distros suffer from audio issues or other device problems. Linux does support more devices right now. Given how far OpenSolaris has come in the past 6 months, I think 2009 will be a huge package/support device year for OpenSolaris.

Advanced Networking
I use a few advanced Linux networking features--namely virtual networks, bandwidth throttling, firewalls, and NAT routing. I have not got my OpenSolaris box doing this yet--I have to learn how to do this on OpenSolaris. I think firewalls and NAT are already there. Bandwidth control and virtual network cards are part of the OpenSolaris CrossBow project. Just recently, the capabilities were merged into the OpenSolaris kernel. I did the Linux equivalent of a kernel update on my laptop to learn how. My next big step will be to do it on this server. More to come in this department.

To summarize:

Is OpenSolaris ready for the desktop?
...YES. As ready as Linux is. You could set up an OpenSolaris box for any non-techie member of your family, and they could surf the web, get emails, write documents, etc. Linux and OpenSolaris still can not satisfy one's need for IPOD sync, camera photo management without a knowledgeable Unix go-to-guy to call.

Is there a Linux to OpenSolaris learning curve and initial struggle?
...YES. However, it's much less that say a Windows to Linux/BSD/Solaris conversion.

Is the struggle worth it?
...YES. For me, I'm very impressed and happy. I certainly don't want to say Linux is better or BSD is better or OpenSolaris is better. Choice is good and so is competition -- even in an open source world arena. I'm not sure why I like OpenSolaris. All I can say is it just feels good. I don't get too caught up in the licensing differences and arguments. If I can run it at home and at work and it's open source, I'm satisfied. It's also refreshing to have an excellent performing, stable OS capable of running my favorite open source programs with a company like Sun behind it. I sort of feel like the days when I switched from Windows to OS/2 Warp 3.0. Although Solaris has been around for a long time, to me, it feels like an evolutionary step forward. I still have lots to learn here too.

I'll be adding posts related to this migration experience as I learn more and become more familiar with OpenSolaris.

Saturday, November 29, 2008

Fedora, OpenSuse, FreeBSD, OpenSolaris

I've been running Fedora for some time at home and on several work computers--most recently the latest Fedora 10 development branches. I ventured out to try OpenSuse, and brought in Beta 5. I must admit, I was blown away. I had last run OpenSuse a year or so ago, and was not as impressed as I was with Ubuntu at the time. In case you're wondering my preferred Linux distro goes something like this ( this goes back a ways )

Slackware->RedHat->Gentoo->Ubuntu->Fedora->OpenSuse

Even given all the hype around the recent Fedora 10 release, I am still much more impressed with OpenSuse. I prefer zypper more than yum, and YaST2 either in console mode or graphics mode is much nicer than anything I've seen in Fedora or any other distro I've tried.

Earlier I posted about Fedora directory server and openldap. Well, I'm running OpenLDAP now and very happy with it. Fedora still has the nice gui admin tool. I stumbled on OpenSuse's User and Group Management tool which fully and graphically supports a back-end ldap configuration. So, it's easy to manage your ldap users with OpenSuse!

OpenSuse is well polished, looks great, easy to install ( again the best installer I've used ), the DVD even has graphical tools that analyze and help you fix a broken system.

Bottom line, if you haven't tried OpenSuse, I'd recommend trying release 11.1.

In my spare time the last few days, I also tried out FreeBSD. I ran it on my laptop for a few days and was impressed--getting to know the system and how it worked in comparison to Linux. I often try testing things out first in a virtual machine, but I don't think you really know an OS until you run it on bare hardware--especially with things like 3D acceleration support and hardware support.

I eventually decided I would really test it out, and cleared of my home server/workstation--could FreeBSD support everything I needed??? The first road block I hit was no NVidia 3d support on the AMD64 bit platform. Even though I checked NVidia's site, I somehow missed the i386 on the driver listed. Ok, I'll through on the i386 FreeBSD version. Well, this time I realized that virtualization products ( like VirtualBox I use ) have not been ported to any BSD. I do like running VirtualBox on my Linux system. We'll, as much as I wanted to really dig deep and run FreeBSD, I decided against it--I could have lived without VirtualBox, but knowing I had full 64 bit 3D support on Linux and VirtualBox, I decided Linux suited my needs better.

Next stop...OpenSolaris 2008.11. I'd run 2008.05, but had to ask myself what it really gave me over Linux outside of ZFS and DTrace which I can personally live without. I installed 2008.11 on my workstation. OpenSolaris has a great installer--very simple. Booting up caused me a little pain, because the installer did not overwrite my previous OpenSuse boot loader. I had to wipe out the MBR, reinstall, then it was fine.

OpenSolaris 2008.11 booted up into Gnome and it looks great. It immediately identified my printers ( both HPs ), but I had no full sound card support. I ran it for a bit, but was again asking myself, "do you really want to go through the trouble. Re-compiling from scratch all the packages you just get with a standard Linux distro. Installing add-on packages just to get features you get out of the box with Linux like firewalls, traffic shaping, network virtualization??" Not that those couldn't be done with OpenSolaris, but again I asked myself "why go through the pain?" when Linux already does it and does it very well. The answer was "no", and I am back with OpenSuse.

OpenSolaris and FreeBSD are great operating systems, however, Linux has come a long way and has so much to offer me today.

Thursday, November 27, 2008

Encoding Video Using Mencoder for the Xbox 360 with AC3 5.1 Surround Sound

Some time ago, I spent a lot of time learning how to encode video using the MPlayer encoder mencoder. I eventually found settings that worked, but the final video did not support AC3 ( 5.1 ) surround sound.

The question came up to me the other day about the Xbox's ability to play back 5.1, and I thought I would revisit the issue. I found an existing video on the net the said it was an AVI for the Xbox with 5.1 sound. Sure enough, I threw it on a usb drive, plugged it in, and had 5.1 surround sound.

I looked at the specs of the file, and after a few trial and error attempts, I had a dvd converted and playing back on my Xbox 360 in full glorious 5.1 surround sound.

The magic command I use is:

mencoder dvd://1 -ovc lavc -oac copy -channels 6 -lavcopts vcodec=mpeg4:threads=2:vbitrate=4500:autoaspect:turbo:mbd=2:trell=1:vpass=1 -o test.avi -ffourcc xvid -mc 0 -noskip -vf scale=854:480,softskip,harddup -ofps 24000/1001

This command produces an avi file with a variable-rate mpeg4 video and a 5.1 AC3 audio channel.

A few interesting points on the command. I use two-pass encoding. So, you'd have to run the command 2x changing the vpass to 2 on the second run. Even though I told it to copy the stream, unless I specifically added the "-channels 6" command, mencoder only encoded 2 channels. Another issue is that you have to force the FOURCC to xvid. The final issue I had was the aspect ratio. Without forcing the scale to 854x480 ( 16/9 DVD ), the Xbox would not scale it to 16/9. mencoder allows the -aspect flag, however, as the mencoder man page states, it is only recognized by mplayer. So, scale the video while encoding it, and it plays back fine.

There are lots of other options to mencoder--it's got to be the most complex command I've ever seen. The documentation for mplayer is great, so check there if you have questions.

If anyone knows how to or can figure out if you can encode H264 videos using avi or mpeg format with a 5.1 audio channel, drop me a line.

Handbrake is another great tool for converting videos. They have an XBox 360 preset, but it looks like it only supports faac two channel audio with x264 video. Handbrake is great since it auto-crops the video. Using mplayer/mencoder, I have to play the video first to figure out if it needs cropping and to get the correct cropping parameters to pass into mencoder.

Now, if only I had a huge server farm to encode my DVD collection.

Sunday, October 12, 2008

EXT3, EXT4, JFS, XFS Weekend Encounters

Sometimes I'm a gluten for punishment when it comes to technology. My self-inflicted punishment this weekend was spending time formatting and copying data using xfs, jfs, and ext4 filesystems under Linux.

It started out several days ago when I got the itch to move from ext3 to a different filesystem to test the performance. I've been through this before, but it had been a while. I was tempted to try ext4 right off the bat, but decided to try xfs. I ran xfs for several days, and I really liked it. However, in an effort to fix my sound card not living up to Fedora's 10 promise of glitch-free audio ( this is another story in and of itself ), I had to hard-reboot my computer and ended up with a 0-length file on an opened file. This is not unusual for an unclean shutdown of xfs, so I wasn't mad, but decided to try jfs. A few reboots later, and a lot of time sitting around waiting to backup/restore a 90+GB root partition, jfs was up an running on the root partition. No problems, but I then came across the ext3 options for "xfs-like and jfs-like" behaviour by adding data=writeback,nobh,commit=30 mount options. So, back to ext3 with those options, and I was impressed. No official benchmarks to post, but it felt good and I was back on an ext filesystem.

After running ext3 for a while, I realized Fedora Rawhide had moved from ext4dev ( the pre-release ) to ext4. Why not, I already had the data backed up, so...reboot, rsync, mkfs.ext4, and a cp and I was back up running ext4 with the "data=writeback,nobh,commit=30" mount options.

While these mount options are a little more risky on hard reboots, it appears the worst that should happen is stale data--not a 0 byte file like xfs was so kind to produce. I can live with old data, but corrupt data is where I draw the line.

So far, the ext4 is blazing fast. It's running over a software raid 0 config. On the first reboot, the raid device forced a fsck. I was very impressed the 150GB partition fsck finished in less than a minute--compared to the several minute fsck the ext3 partition took on it's initial boot.

ext4 is the filesystem of choice for me now.

Wednesday, September 24, 2008

GNOME is Back for me

I previously posted about KDE 4.1. While I enjoyed it's cool looks, I've found GNOME is currently just more productive for me. So, I find myself running GNOME at work and home. Choice is great, and I'm sure this won't be the last time I try out KDE.

Sunday, August 3, 2008

KDE 4.1 Much Improved

I installed KDE 4.1 today on a few of my machines. I'm quite happy with it now, and I will be making the switch from GNOME back to KDE. KDE 4.0 was too buggy to work with. After a few crashes of KDE 4.0 within the first hour of installation, I went right back to GNOME 2.22.

GNOME is fine for the most part, though there were often times I wanted to customize something that I just couldn't do ( dual headed background limitations, running a separate screensaver process per head slamming the cpus, and lack of any customization in the newly, revamped gdm architecture come to mine ). But I digress. For me, KDE 4.1 is stable, looks great, and so far is not lacking any customizations I need. It took a few minutes of figuring out where the team is headed with Desktop folder views. I think they're way cool, and they help one keep a nice, organized desktop.

If you gave up on KDE 4.0 like I did, jump back on! KDE 4.1 shows the dedication of the KDE team to answering issues and pioneering the way for the Linux desktop.