Posts tagged with "netbsd"


pkgin and pkgng for pkgwin

I moved to Fedora as my desktop OS of choice largely because of yum, and some Red Hat Linux nostalgia. Pkgin and Pkgng on NetBSD and FreeBSD respectfully may be enough to win me back :)

# pkg_add -rv awesomeness

Back when I fickly used FreeBSD then NetBSD for my file server at home, the systems were so appealing I wanted to try them on the desktop. If you go back to the Rubenerd.com archives from a few years back, you'll see all my posts about BSD desktops, getting Xfce working on them, and how much I enjoyed using them.

Leaving aside the issue of accelerated 3D graphics for now, the main issue with using the BSDs as desktop OSs is they tended to be heavily source-based. Binary packages were available, but generally speaking if you wanted current software and updates, you needed to use their respective port/package systems. Before the advent of freebsd-update, you also needed to rebuild the base system to upgrade it.

For small applications or the ones you'd typically run on a server, this was fine. Building Firefox or Xfce or KDE from sources each time they had an update would take hours, and was an incredibly tedious process. Sometimes they'd break, or a dependency wouldn't build, and you'd be stuck. It didn't make for a terribly pleasant desktop experience, especially when my Linux friends could enter yum update and be largely up to speed in minutes.

Obconf, Nitrogen, urxvt on Openbox, my "cloud" theme :)

A NetBSD repo? You bet!

A lot has changed in the intervening years since I started using Linux again. Pkgng on FreeBSD and Pkgin on NetBSD offer repository-based binary package management systems akin to yum in the Red Hat world, or heaven forbid apt-get.

From the NetBSD pkgin site:

pkgin is aimed at being an apt / yum like tool for managing pkgsrc binary packages. It relies on pkg_summary(5) for installation, removal and upgrade of packages and associated dependencies, using a remote repository.

Many so-called GNU/Linux distributions provide a convenient way of searching, installing and upgrading software by using binary archives found on "repositories". NetBSD, and more widely, all operating systems relying on pkgsrc have tools like pkg_add and pkg_delete, but those are unable to correctly handle binary upgrades, and sometimes even installation itself.

This is the purpose of pkgin, to provide the user a convenient way to handle binary packages, using the same working mechanisms than tools like apt-get.

And from the FreeBSD pkgng wiki page:

pkgng is built on top of libpkg, a new library to interface with package registration backends. It abstracts package management details such as registration, remote repositories, package creation, updating, etc.

pkgng is: a replacement for pkg_* tools, a tool to query/manage installed packages, a tool to deal with binary packages, a tool to upgrade/install packages from a remote repository and a library that provides all the package management in a safe way so one can write a new frontend.

I moved from FreeBSD to NetBSD on my file server here, and so far I've only played with pkgin, but I'm genuinely excited about both. A method to reliably and consistently upgrade binary packages was arguably the main reason I went to Linux.

I'll keep the penguin on at least one machine I own, but if these systems work well I may be on my way to using BSD on my laptops again, including maybe even this one! As much as I know about the Fedora ecosystem now, I'm still far more at home with BSD. /etc/rc.conf, securelevels, jails [sic], the 2-clause BSD licence!

I'll be playing with both after my latest round of assignments are handed in, and will report back ^_^


NetBSD 6.0

Just a quick tip of the hat to NetBSD for their 6.0 release. I use Fedora Linux on my laptop and Mac OS X on the desktop, but I'd prefer to be using NetBSD. As far as I'm concerned, it's the cleanest, most elegant operating system I've ever used.

I also made some My-HiME desktop backgrounds for NetBSD back in 2008. She was predominately orange, and so is NetBSD. I was in the zone.

NetBSD in an Australian VPS, now that'd be awesome. I wonder if they exist?


libcxxrt C++ runtime now available under BSD licence

The NetBSD Foundation Press Release: libcxxrt C++ Runtime Now Available Under BSD License. This is big news!

The FreeBSD Foundation and the NetBSD Foundation announced that they have acquired a non-exclusive copyright license to the libcxxrt C++ runtime software from PathScale, a leader in high performance Fortran, C, and C++ compiler products for AMD64, Intel64, and MIPS. This software is an implementation of the C++ Application Binary Interface originally developed for Itanium and now used for the x86 family by BSD operating systems. Libcxxrt will be available under the 2-clause BSD license.

Interesting that they chose the 2-clause BSD licence which FreeBSD uses, over the 3-clause BSD licence that NetBSD uses, or at least used last time I checked. But I digress.

Why is this so cool? Well for one, I've used it before in bidness! Secondly...

"This work complements other work done in the community and is a further step in letting us adopt alternative toolchains in FreeBSD," said Robert Watson, a FreeBSD committer and Director at the FreeBSD Foundation.

Alternative toolchains != GPL, which for the otherwise BSD licenced NetBSD and FreeBSD operating systems can only be a Good Thing™.

There have been lots of interesting developments in this area recently. The GNU toolchain has served us well, but there are leaner, faster and more liberally licenced compilers, linkers, libraries and tools coming out now, and with Apple backing LLVM in a big way now (for example) this movement can only gain further momentum.


Caution: filename not matched unzip error

Torchlight ZIP icon

Quick tip I picked up this afternoon. If you try to extract a series of archives with unrar or unzip and you get this error:

% unzip *zip
caution: filename not matched

... you can get around it by escaping the asterisk.

% unzip \*zip

I wonder why it works like this when virtually nothing else does?


Excited, verbose review of Joe's Own Editor

Joe's Own Editor editing this very blog post!

I've been using Unix-like operating systems for years and, much like programming languages, I've never been able to settle on one editor. Today I may have finally found the perfect one!

Joe is one of them recursive acronyms like GNU and stands for Joe's Own Editor, so named for its creator, Joseph H. Allen. I had a crush on a girl in high school who's last name was Allen, but I don't think he's any relation. It even has a page on The Wikipedias.

From the introduction to Joe's well written and comprehensive manpage (you know, those things the GNU people used to write and the *BSD folks still do):

JOE is a powerful ASCII-text screen editor. It has a "mode-less" user interface which is similar to many user-friendly PC editors. Users of Micro-Pro's WordStar or Borland's "Turbo" languages will feel at home.

Editor nostalgia!

While I've got used to Vim, as I've mentioned numerous times on Twitter my favourite of all time is still the E Editor that IBM bundled with their later versions of PC DOS. The problem was, back in the day IBM had a spectacular falling out with Microsoft and couldn't bundle QuickBASIC and it's associated editor into their flavour of DOS any more, so they bundled the E Editor and REXX instead. I still run it in DOSBox even to this day. I know I know, I'm crazy!

While the shortcut keys are completely different, in perhaps a subjective way the E Editor and Joe "feel" very similar, right down to the prompt bar at the bottom of the screen where you enter file names. Because it's modeless and many of its commands are issued with control keys it should also appeal to users of pico/nano and Emacs who have DOS nostalgia too.

Joe's Own Editor showing its help screen

It can also emulate a series of other editors by invoking it in different ways. My dad used to use and love WordStar back in the day, so he'll be hearing about this!

JSTAR is a close imitation of WordStar with many "JOE" extensions. JPICO is a close imitation of the Pine mailing system's PICO editor, but with many extensions and improvements. JMACS is a GNU-EMACS imitation. RJOE is a restricted version of JOE, which allows you to edit only the files specified on the command line.

It works right out of the philosophical box thing

Unlike Vim or pico/nano which I use with huge custom configuration dotfiles, I could tell Joe was written for someone like me because it works almost perfectly its default state. Technically I could copy over the master configuration file to my home folder and customise it to make the software work more the way I want to, but so far I haven't felt the need to. That hasn't happened in a long time outside the realm of Apple or Xfce wares.

It's as if Joseph H. Allen sat down with me and asked what I wanted out of an editor and made it. It almost creeps me out. Get out of my head sir!

Aside from feeling like a CP/M or DOS editor ported to Unix with modern, common sense commands that gives me the warm fuzzies, Joe has a lot more going for it:

  • The automatic syntax highlighting is gorgeous and turned on by default.
  • The commands make sense and can be learned as you use the software with a help screen attached to the top of the console reminiscent of ee on FreeBSD.
  • Error messages are written in plain, non-cryptic English.
  • It supports double-space characters such as Hiragana which even the expensive TextMate doesn't have.
  • I get a childish, giddy kick out of calling my text editor "joe". Hey Joe, can you open this code file for me? ^_^

Grab it, use it, enjoy it!

You can grab the source for Joe's Own Editor on its , as well as from FreeBSD Ports, pkgsrc, MacPorts and other good package managers.

I really, really encourage you to give it a try, I haven't been this excited about an application in a long time. As I said, I gives me a warm fuzzy feeling :).


Graduating from nvi, kinda

nvi saying hello

After using it as my primary editor for several weeks, I feel as though I can finally graduate from nvi. It was more challenging than I thought it would be when I first decided to learn it, but it was a fantastic learning experience.

While I've been using a vi clone in the form of Vim for years, I admit I've always cheated by adding the nocompatible option in my vimrc file. This has the effect of making Vim behave more like a contemporary editor which lowered the barrier to entry, but it meant when I started using nvi I was lost and frustrated in a sea of escape keys!

Everyone likes a silly car analogy, so here goes. I like to think I learned how to drive vi editors by using an automatic (Vim with nocompatible), so when I had to use a manual (nvi) I understood most of it but there was a whole new set of interfaces I had to learn. The upshot of putting in this effort though is now I can drive both, and perhaps I can even drive Vim more effectively.

I can now confidently say if I'm ever thrown in front of a FreeBSD machine I myself don't maintain, I'll be able to use nvi in place of Vim with a minimum of muss and fuss. Well technically I could use ee, but where would the fun be in that? :)

nvi, Vim


Trying out the nvi editor

nvi

Having fun with FreeBSD on my Libretto this afternoon, I didn't have internet access to install Vim from ports so I decided to finally learn more about the bundled nvi editor. I missed syntax highlighting, but if you customise it right it's still a nice, lightweight, capable editor.

They're similar, sort of, in some ways, kinda

Because Vim and nvi are both implementations of the classic vi/ex they have a number of functional similarities, but because nvi has been essentially static for licencing reasons in the BSDs and given Vim's continuous and rapid development, the gap between the two editors has been widening for quite some time. That was a needlessly long sentence.

Historians with complex flowcharts showing the origins of software would faint in horror at this assertion, but I like to think of nvi as a sort of "Vim-lite". In that context I don't fret about lost features, I just learn what they have in common and work with it, just like a guy with a scooter doesn't expect it to perform the same as his dad's Ducati. Does that make sense?

nvi, Vim

Configuration philes

Unlike Vim's ~/.vimrc, Nvi reads from the historically named ~/.nexrc file.

I like to include plenty of comments in my dotfiles, but as I learned from trial and error (and error, and error!) nvi is more picky about what you can include. You can't place comments on the same line as settings, and if you include a blank line anything below it is ignored!

This is part of my ~/.nexrc file, you can check out the full version on my dotfiles site if you're interested.

" GENERAL SETTINGS
set columns=80
set secure
"
" I LIKE 2 SPACE INDENTATION
set autoindent
set shiftwidth=2
set tabstop=2
set ts=2
"
" TELL ME WHEN I DO SOMETHING STUPID
set errorbells
set flash
set verbose
"
" SHOW LINE NUMBERS, COLUMN/ROW POSITION
set number
set ruler
"
" ABBREVIATIONS
abbr _aa This is The Tale, of Alan A'Dale
abbr _bw The Bird is The Word
abbr _gc Grilled cheese sandwiches
abbr _nc #include <ncurses.h>

Why not just install Vim Ruben? Gosh!

Even if the first thing you do on a fresh system is install Vim, nano or another editor, because nvi is distributed with all the major BSDs by default it's a great idea to have a working knowledge of it. It's like a dependable friend :).


Testing pkgsrc on my MacBook Pro

Testing whether I got the NetBSD pkgsrc system installed properly on my MacBook Pro. Everything seems to be in order! Now to install Gnumeric and other free and open source goodness.

% uname -mrs
Darwin 9.7.0 i386
% figlet Rubenerd
 ____        _                             _
|  _ \ _   _| |__   ___ _ __   ___ _ __ __| |
| |_) | | | | '_ \ / _ \ '_ \ / _ \ '__/ _` |
|  _ <| |_| | |_) |  __/ | | |  __/ | | (_| |
|_| \_\\__,_|_.__/ \___|_| |_|\___|_|  \__,_|

Using Herrie to listen to Whole Wheat Radio

Herrie tuned into Whole Wheat Radio on my Mac

Just finished polishing up the Herrie media player page on the Whole Wheat Radio wiki. Over time I've being going through each media player and adding instructions with screenshots so hopefully any new person who has never tuned in before can get up and running easily.

  1. Download a "Listen" playlist from the sidebar of the wiki
  2. Launch herrie in playlist mode: % herrie -x
  3. Navigate to the saved listen.pls file by using your arrow keys
  4. Add it to your playlist by pressing "A"
  5. Change focus to your playlist by pressing "Tab" then press "X" to start playing!
  6. When you're done, press "Q" to quit

I think Jim really intended these pages to just be explanations for the players that appear on the Who's listening page, but I figure if at least one person found the information helpful it was worth it. Heck I owe the existence of this blog to that philosophy... right? ^_^


Installing Alpine on Mac OS X

Build options available for Alpine in MacPorts
Build options available for Alpine in MacPorts

I've been asked by a few people on Twitter how I installed the lightweight Alpine console based email client on my Mac. Alpine of course is the current version of the pine email software that addressed some concerns about licencing. I love Alpine, and the logo reminds me of the classic Altavista :).

As with most free and open source software, by far the easiest way to get it running is just to install it from a package manager. You can go ahead and fetch the source tarball and do the usual ./configure, make, make install and make clean, but it does have several dependencies which in turn have several dependencies. You know what I mean.

MacPorts
For MacPorts, grab yourself the latest version and install just as you would any other Mac software that uses a setup assistant. Once you're up and running it's simply a matter of firing up your Terminal.app and entering in # port -v install alpine.

By entering # port variants alpine you can see all the custom options you can set. If you want to compile Alpine with one or more of these custom options, use the same install command above but append the options you want with plus signs. For example, if I wanted password files support I'd enter # port -v install alpine +passfile.

Fink
I haven't used Fink myself much, but according to their online package manifest it is available.
NetBSD's pkgsrc
If you use pkgsrc for Mac OS X/Darwin, Alpine can be found in the ./mail/alpine directory in your pkgsrc tree. Once you're in the right directory, it's the usual routine of # bmake install clean clean-depends. As with all pkgsrc packages on OS X, remember to use bmake NOT make otherwise it won't work.

If you're interested in trying the sophisticated and elegant pkgsrc system on your Mac, I wrote up a tutorial in a previous post you can use to get yourself up and running with it.

Happy emailing!