BSD UNIX – Is it for me?

BSD UNIX – Is it for me?

I have spoken about this earlier as well. You can see the following link for an example.

OpenBSD – EEE PC

My Transition

I was recently asked by a blog visitor about why I use BSD UNIX over Linux and what advice can I give a prospective convert. Nothing special, actually. In my case, it was just a matter of choice. I started from the school of UNIX (HP-UX, Sun Solaris, IBM-AIX and some SGI-IRIX) and  then ventured into Linux (Red Hat, Gentoo, Fedora, Ubuntu and its variants, Sorcerer, Lunar Linux, SourceMage, LFS, and back to Sorcerer), before getting to BSD UNIX. Why didn’t I try BSD earlier? Good question. You see, during my Engineering and Physics studies, in addition to the aforementioned Unices, we were forced to use Red Hat or Gentoo. Apart from a HP-UX box at home, I had no other personal computers, so I sort of stayed with Linux. Since, I grew up in India, during those days, computers were really expensive. Then, when I began my Doctorate studies, something happened. BSD UNIX was always on the back of my head. But a chance encounter with another BSD power user over at box-look led me to BSD UNIX finally. And it was also the time I started developing my toolkits for high performance simulations at work. Since,  the C compiler and Perl with many ported libraries from netlib, was all I needed, I realized I could have a lean system without  all the bells and whistles, including X. So I took an older computer at work and installed FreeBSD. So, you see, it was my efffort to start anew that eventually led me to BSD, FreeBSD to be precise. It was the beginning of a fruitful relationship that persists even to this day. Apart from one rig that runs Sorcerer, all my boxes are powered by BSD’s

Installation Routines

It would be illogical for me to go into the merits of using BSD versus using Linux. There is plenty of information available on the internets comparing BSD with Linux. So, I will avoid it. All I can talk about is what can one expect out of a standard installation routine on BSD systems, just briefly. One should not be lazy to read the manuals. BSD documentation will knock the socks off of Linux. Trust me, it is not a joke. OpenBSD manuals, in particular are poetry. Detailed installation methods are explained in the manuals. So, its absolutely necessary to read them. Don’t expect details in this post.

In general, every BSD installation follows through stages. First, you install the base system that installs the kernel and important toolchains needed for further builds. Assuming you are doing an installation with a CD/DVD, on FreeBSD there is the time-tested, pretty old sysinstall that can be used to install the base system.  It is pretty intuitive and it must be very easy to follow. Although, I don’t use sysinstall anymore . There are modern methods to install a rock solid base system with ZFS enabled and getting it up to date with security  advisories.  For a beginner, this might be complex, so on your first trial, just use sysinstall. But that doesn’t mean that the highly motivated should not use the modern method. It is up to you.Once the base install is finished, you can install X that would pull in additional dependencies automatically.

OpenBSD’s installation is pretty easy with a CD. Once you set the filesystem up, you can easily install the base system with X. Remember,  Xorg on OpenBSD is called Xenocara, a unique build infrastructure of Xorg. In my opinion, it is more efficient than the standard implementation of Xorg. When you reboot, you can immediately  start using a customized fvwm implementation and can start customizing the system according to your needs.

NetBSD and DragonFly BSD are pretty similar in their installation infrastructure. You setup the base system from a CD or minimal boot iso’s and then you can start adding software, like X, window managers etc.

Speaking about filesystems, on BSD’s you have the opportunity to explore different filesystems on different flavors. ZFS, UFS, Hammer, so much variety. For the initiated, you can learn more about them.

Package Management – Binary or Source?

Package management in BSD UNIX is probably the best in my opinion. You have the option of installing binary packages, but for the functionally paranoid, you can use the source (ports, pkgsrc).

On my boxes, I always start out like this. Install base system. Then, important languages that I need, a shell like zsh, vim editor and then X server. You could install the full X server or even choose to get a lite version installed, depending on the BSD flavor. So, you see you have complete control over what you want.

You can install either binary version of the packages or you could install every package from the ports infrastructure. My choice is ports. The reason is, many packages have build options that make it easy to customize them the way you want. For instance, let’s take the rxvt terminal. If you install the binary package, you will just get the default flavor. But if you build from ports, you could choose to install various encodings, scrollbars, 256 colors, etc. So, you see, it is usually helpful to install from ports. But having said that, the developers have gone through the pains of generating binary packages to facilitate easier, faster installation of packages. Hence, sometimes, it would be better to just choose the binary package. It is the most preferred route for me when I use OpenBSD stable branch. I mostly install the binary packages, except for occasional port builds. On FreeBSD and NetBSD, DragonFly BSD boxes, it is ports and pkgsrc, respectively.

Updates/Upgrades

Patience is important when using ports to configure your system. Speaking of patience, if you are a bleeding edge fanatic, you would be better off without BSD. That brings us to the topic of updates. Yes, it is possible to keep your packages updated on BSD boxes, but it is cumbersome if one resorts to doing that almost daily. I do that on unstable branches, and have encountered many breaks and most of the times I had to rollback to get the system back up on its wheels. BSD is a complete operating system, unlike Linux, so if you are only bothered about the relative newness of packages, just use a rolling release Linux distribution, like Gentoo or Arch Linux. But if you are bothered about the stability of the system as a whole with emphasis on code correctness and proper vetting of packages, BSD might just be your savior.

The main updates that I do on all my BSD boxes are security and kernel updates (release to stable). They are the ones that matter the most to me, not whether I am using zsh 4.5.X1 or zsh 4.5.X2. I hope, I have made my point clear. The only time I do port upgrades on my stable machines is when there is a new release of BSD. Generally, a complete system upgrade. I have done system upgrades universally across all my BSD boxes, that it is child’s play these days.

It’s not easy to generalize Linux users, due to the various distributions. But all I can say is this – If you want to use BSD over Linux, your thought process has to change as well. What is more important? Stability or constant tinkering even on the kernel level and upgrades that might rock your system? You be the judge. Honestly, of late the whole bleeding edge concept has become some kinda disease, where using fresh off the stove software is more important than stability. It is a philosophy that has become popular these days, thanks to many rolling release distros. You might ask, when Linux does it, why not BSD? Again, at the danger of sounding like a broken record, I am gonna reiterate the fact that BSD UNIX is an operating system, unlike Linux.

In conclusion, what works for me is being up to date with security updates and full system upgrades when a new release is out on stable machines. Snapshot testing rigs are a different story altogether. OpenBSD is the only BSD that adheres to a strict release philosophy, putting out new releases every six months. FreeBSD is famous for prolonging releases. NetBSD and DragonFly BSD do release cycles pretty well too.

Hardware Issues – Do the research!

It pays to know your hardware inside out, if you wanna have a completely enjoyable experience, be it using BSD UNIX or even Linux, for that matter. You see, hardware can sometimes be a stumbling block in using BSD. Newest hardware, be it graphic cards, sound cards, wireless cards and many more might not function well, just because the drivers may not be available. It is likely that one of the BSD’s might have support for a certain piece of hardware that others don’t. So, it is essential to do some research. In my opinion, research has to precede the buying process. Every release information of BSD’s include details about the cards that are supported and by which driver. Even bugs are listed. Lets say, you have settled on OpenBSD. Now, you wanna buy a laptop. You dig into the release information and find laptops that more or less match the support information in the release document. Then, you will never ever have to complain. This holds true for new hardware. For older systems that you might be getting from work, friends or family, if no information is available about the hardware, you can cycle through all BSD’s to find the optimal distribution for your machine (Refer this post about my NetBSD experience on a laptop that I salvaged earlier). On legacy hardware, for instance, NetBSD is a killer. It flies on some of my very old rigs, without any of the hacks.

It takes a while to reverse engineer a driver even on Linux, but the wait would be longer on BSD. But that doesn’t prevent you from trying to reverse engineer yourself! That’s the beauty of OpenSource isn’t it? Still, on matters like graphic cards, you need to do some research before settling on a BSD of your choice. For instance, if you have an NVIDIA card, and you want to use OpenBSD, do not ever expect to find an official NVIDIA driver on the machine. You will not. Theo is very particular about binary blobs. That is the very essence of OpenBSD. People criticize the OpenBSD project as being very rigid in their philosophy and their emphasis on security. Linus Torvalds, once famously called OpenBSD developers a bunch of masturbating monkeys! It’s nothing but hot air. OpenBSD’s focus is on security and cryptography and not having the source code goes against their security emphasis and why should someone criticize them for that. You don’t like it, don’t use OpenBSD, plain and simple. As of this writing, FreeBSD is the only BSD operating system that has an agreement with NVIDIA to develop and use official NVIDIA drivers. FreeBSD’s focus is different. If you don’t like their agreement with NVIDIA, no one cares. You see, it could go both way.

Support Information

There is plenty of support available on the internets. FreeBSD forums, Daemon forums, mailing lists, etc. In special cases, if anyone needs help, you can always bug me as well. On FreeBSD forums, for example, you should definitely check out the Tips and Tricks section. There is plenty of gold there. Same holds for Daemon Forums. Most users of FreeBSD forums are also active members on Daemon forums. So these two places are great to start with when someone needs help. Otherwise, you always have mailing lists. When you use snapshots and daily builds, it is crucial that you check mailing lists, since anything out of the ordinary will be reported and it might help you in case you run into a bug.

Have fun with BSD UNIX. I promise, you will love it!

Beep X11 Font – Another Mod of Neep

Let us continue with the X11 font series. This font is called Beep. Again, it is a mod of Jim Knoble’s Neep. A few characters modded according to personal taste, like, “a” and “i”. This is a pixelsize 11 font and comes only in medium version. So don’t try to use it in the bold form or another pixelsize. It’s a bit bigger than Dweep and can be used on a relatively higher resolution screen without any issues. As usual, I have uploaded the font to my github. Please click on the image to get to my github.

Beep X11 Font - Mod of Neep

This is a screenshot of the font in action on a 1600×900 screen. Click on the image for full view.

Beep in action FreeBSD 9.0-Release

As it must be evident, most of my fonts are just minor mods here and there. I will release a font that I have made right from scratch next month. I have to think about a kickass name first. If you need any other information, please let me know using the comment feature.

Marathon Mod Showcase Contd.

Thought of adding another screen with Marathonmod in action. Window Manager is Fluxbox. OS is FreeBSD 9.0-Release of course. The fluxbox theme is a mod of Absurd theme. I am using the Xoria256 color palette on my terminal. The font has been released in my previous post and it points to my github from where it can be downloaded.

Marathon Mod in action

This wallpaper is one of my absolute favorites. It’s not from a bio weapons research lab or a deleted scene from The Shining (It is one helluva film!). It’s from Bell Labs, 1966. Everything works in this picture, the “WTF are you lookin at punk?” look, the glasses, the creepy hallway and much more. I will post the wallpaper and some related stuff tonight. The current network I am on is crapping all over the place.

If you are interested in the animation series in the screenshot, it is one of the funniest series ever, Harvey Birdman – Attorney at Law. The references to pop culture, politics and being extremely funny at the same time made this series stand out. Perfect animation with loads of adult humor. The guy you see here is Phil Sebben from Sebben & Sebben (Stephen Colbert was beyond awesome in this series man!).

Note: I would just like to say one thing about the font. It might be too tall or the character variations might be too much for some of you. I had the same feeling about the font when I started out. But it kinda grew on me.  This is particularly obvious with the semi-condensed version shown in the screenshots. The normal version isn’t that extreme. Besides, I had posted earlier that I am just releasing all the fonts that I have created over a period of time, regardless of their aesthetic appeal.

Marathonmod X11 Font – Nucleus Family

pf hacking went great. Just filed a test report with my friend. Slept well. Long day ahead. Anyway, I would now like to release my third font. It is called Marathonmod, which is again a minor mod of Marathon from the nucleus font family. It comes in two variants – normal and semi-condensed. What you see on the screenshot is the semi-condensed version. It’s a tall font with a minor height difference between alphabets and numbers. Some special characters are not available, but it will be worked out in the next release. It never strained my eyes and I never had a problem with multiple head setups.

Now, without further ado, here is a screenshot. Note the marginal height difference between the letters and numbers. Click on the image to go to my github page, where the font is hosted.

Marathonmod X11 Font

Here is another screenshot with the font in action. ScrotWM on FreeBSD 9.0 amd64.

Marathonmod Font in Action

Chocolate milk and candy bars beckon – Breakfast for Champions! Till then.

Stderr – zsh

Zsh is a great shell that simplifies a lot of tasks and brings in a ton of features (if you intend to use a load of modules and shell functions that is). For instance, the live command coloring capability is pretty awesome. The following post is just a simple illustration of a simple, single line added to my .zshrc and what it does.

When you type in a wrong command, the shell will throw a stderr command not found. The output would be the same color as the foreground color that you use on your terminal (The command color is red here because of live command highlighting – More on this at the end of the post). Like this:

Stderr - Default

But, wouldn’t it be nice to color the output as well? I want my colors man. See what I mean?

Stderr - Colored

All I had to do was add a line in my .zshrc on my BSD boxes.

Line in .zshrc

It should be self-explanatory I guess. Here’s the entry again for you Ctrl+C, Ctrl+V ‘ers.

exec 2>>( while read X; do print "\e[91m${X}\e[0m" > /dev/tty; done & )

With live command coloring, colored stderr is repetitive though. Since, typing a wrong command would automatically let the command stand out in red, indicating that it is not a proper command. But if you don’t want live syntax highlighting, the above feature would be of use.

Dweep X11 Font – Mod of Neep

This is my second font release. I call it dweep. No particular reason for the name though. I took the amazing Neep font from Jim Knoble, which is one of the favorite fonts of programmers, and modified a few characters, namely, “a”, “i”, “f”. May be some more, but it eludes me at the moment.

I did this specifically for my netbook. Small enough and readable at the standard EEE resolution. As usual, I have updated my github with this font. You can get it from there. Just click on the image to directly go to my github page.

Dweep - Mod of Jim Knoble's Neep Font

Posting an old screenshot with the font in action on my OpenBSD powered netbook. Gives you an idea as to how it looks on a dark background. Click on the image for full view.

OpenBSD 4.8 + EEE 1000H + Dweep Font

I will release another font tomorrow. Till then, folks.

BSD root shell – Leave it alone!

Just for Fun - Don't take it literally!

Of late, I have observed that a lot of new migrants to BSD immediately want to change the default shell to bash. Bad, bad idea! bash is not available automatically in any BSD base system. Leave the root shell as it is. Some of you might not see the issue now, but when the system breaks and you have to restore it somehow, you would be pissed, since /usr won’t be available. Most software executables that you install on BSD would sit in /usr/local/bin directory. So, think twice before changing the root shell.

Of course, when you troubleshoot using single user mode and bash is your root shell and is unavailable, you will be asked if you wanna use the default shell (csh). So failsafe is in place, but still, it is just bad practice to change the root shell. But if you insist, use toor instead. No problems there.

You can find multiple discussions on this topic over at FreeBSD forums as well. A friend of mine who recently installed FreeBSD for the first time naturally wanted to go the bash way and asked for my opinion. That’s why decided to post here as well.

Dash X11 Font

As I had mentioned earlier, I modify fonts at will. Some I like, some I don’t. I have decided to share all modified fonts that I use from time to time. The first one in that series is Dash, which is a mod of the awesome font, Smooth from the Misc. foundry. The latest version of the font is on another machine, so I will update this submission coming Saturday. Apart from simple changes here and there, the only big difference between Smooth and Dash are the letters, ‘a’ and ‘i’. The newest version that I currently don’t have access to also has a different ‘l’. See NetBSD screenshot from a few posts earlier.

The font is available on my Github page. Just click on the image to get there. The image should give you an idea about the font as well.

Dash X11 Font - Available on my GitHub

Till later folks.

Solarized

Solarized by Ethan Schoonover

From my screenshots here it would be clear that I like light on dark color schemes. Although I am aware of the solarized palette for quite some time now, I was a bit reluctant to use it. Not anymore. I gave the Solarized-Light version a try, and consider me sold. This one works perfectly with a good ttf font, ideal size and hinting. This is also the first time that I am using a ttf font (Envy Code R in this case, size 8). Another plus in favor of solarized is that there are a lot of editor specific themes already available that makes the computing experience uniform across the spectrum.

So, I just hacked a quick fluxbox companion theme to go with solarized light colors. This theme is a mod of tenr’s foobar theme. I call it foobar-solarized. I also found a perfect wallpaper from wallbase.  Being a fan of comic books and Justice League, this is the perfect wallpaper. I just modified the color a bit and threw the FreeBSD logo on it. You can download both the wallpapers here as well.

Anyway, here is the screenshot. Click on the image for full view.

Solarized Desktop - Fluxbox

Here are the wallpapers.

Justice League Solarized

Justice League Solarized with FreeBSD Logo

You can download the Fluxbox theme from omploader. Note: Direct Download

Foobar-Solarized Fluxbox theme 

Illogical!

They need love too!

I cannot believe how people can throw away their computers when they are working fine. Last month, as I was walking along the street where I live, I saw a gentleman discarding some of his old stuff. Right when I was passing by, he brought a laptop out and threw it away. I asked him what was wrong with the machine. He said it was not working (That doesn’t say anything, of course). Then I asked him if I could take a look. He said it was ok. It was a relatively new laptop from Dell and I took it home for testing. First thing I realized was that the hard drive connector was loose. Once I sorted that out, it was absolutely fine. The machine started fine after that. No problems whatsoever.

So I took the machine back to the gentleman and told him I fixed it. But he was not interested and told me with a straight face that he doesn’t take something back after having thrown it away. Quite a philosophy I must add. So, I took it home and upgraded the RAM and did some minor quirks here and there and it was ready for its life v 2.0.

My first choice was FreeBSD, which wouldn’t even boot. OpenBSD worked fine up until hard drive recognition. It wouldn’t budge. So, my next choice was NetBSD. Well, what would you know, it installed just fine. Next up was X, followed by pkgsrc. No issues. Only issue was wireless card. It comes with a Broadcom chip that doesn’t have support. But I had a spare Ralink USB wireless adapter, which was pretty easy to set up. Took the machine for a test ride, even LINPACK benchmarks gave satisfying results. Wireless worked fine too. So, another machine salvaged.

Since it was Christmas time, like the year before, wanted to donate this machine as well. I found a smart kid from a not so well to do family through one of my friends and donated it to him. It was totally satisfying to see how happy he was. He has never used BSD before, but he has worked with Linux for a long time. So I gave him a crash course on BSD and NetBSD in particular.

Here is a screenshot from the laptop before I gave it to him. Click on the image for full view. Window manager is ScrotWM and the font is Dash, which is a mod of the famous font, Smooth (from misc family). I will release it sometime this month.

NetBSD 5.1 on the donated laptop

That makes it 28 computers donated until end of last year. Let’s see how it is this year.