Dieses Dokuwiki verwendet ein von Anymorphic Webdesign erstelltes Thema.

Mah BlueeeEERGH!

following netbsd 5.0_STABLE

Just a quick note as reminder for myself.

The aim is to keep in sync with NetBSD 5.0_STABLE / the current pkgsrc stable branch. I try to use pkgin a lot but have to build some packages myself because of compile time options.

That's why I need the pkgsrc tree.

first we need to update our source tree:

host# cd /usr/src
host# cvs up -Pd -rnetbsd-5

Then we need to update out pkgsrc tree (at this time the stable branch is pkgsrc 2009Q2).

host# cd /usr/pkgsrc
host# cvs up -Pd -rpkgsrc-2009Q2

Every source is up to date, time to build!

Let's begin with the kernel, then userland base system with build.sh.

host# cd /usr/src
host# MYKERNEL=$(uname -v | sed -e 's/.*\/\(.*\)/\1/'); export MYKERNEL
host# ./build.sh -U -u kernel=$MYKERNEL
host# ./build.sh -U -u distribution

Now, we install our new kernel and boot on it.

host# cp /netbsd /netbsd.old
host# cp sys/arch/i386/compile/$MYKERNEL/netbsd /netbsd
host# reboot        # Just in case.

Now that all is built, we can install the userland:

host# ./build.sh -U install=/

Next, our packages.

I use pkgin, which was released with pkgsrc-2009Q2

host# pkg_add ftp://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/i386/5.0_2009Q2/pkgtools/pkgin-0.2.5.tgz
host# pkg_add ftp://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/i386/5.0_2009Q2/pkgtools/pkg_install-20090724.tgz
host# pkgin up
host# pkgin fug

The only thing left to do is to rebuild the few packages which need different compile time options.

And voilà !

Journey in RPM packaging

I had to package nginx and modrails for CentOS 5, it was a painfull process, achieved with some fairly ugly hacks, but it works.

In the process, I also repackaged ruby enterprise edition (simple rebuild from this one ) and the needed gems, based on ruby-enterprise. See this mail about using this package of Ruby Enterprise.

Here are the RPMS and the SRPMS. You can use them with yum, simply cut/paste this into

/etc/yum.repos.d/twisla.repo
[twisla]
name=twisla's nginx/ruby packages
baseurl=http://stuff.twis.la/rpm
gpgcheck=0

upgrading-dragonfly-the-easy-way

Getting the source (base system and pkgsrc)

<note warning> by default, you will be in the master branch, where all the dev happens, I am not responsible for anything that might happen! This could be unstable and untested code.</note>

box# cd /usr
box# make git-clone
[...]
box# make pkgsrc-checkout
[...]
Building and installing the Kernel and base system userland

Now we will have to build all those sources and install the resulting binaries.

box# cd src
box make buildworld
[...]
box# make buildkernel
[...]
box# make installkernel
[...]
box# make installworld
[...]
box# make upgrade
box# reboot
Installing some useful packages

Now that we have a shiny bleeding edge basesystem, we can install some basic packages from pkgsrc.

box# cd /usr/pkgsrc
box# cd pkgtools/pkg_rolling-release # used to later upgrade packages
box# bmake install clean
box# cd ../../
box# cd $category/$package_you_need

<note> A few months later</note>

Updating the sources and pkgsrc
box# cd /usr
box# make git-pull
box# make pkgsrc-update

Now you can revert to the base system build steps explained earlier.

After a reboot you can upgrade the pkgsrc. For some reason, there is a little hack to get the bootstrap-mk-files and bmake (NetBSD's make) upgraded:

box# cd /usr/pkgsrc/pkgtools/bootstrap-mk-files
box# bmake USE_DESTDIR=full package
box# pkg_add -uu /usr/pkgsrc/packages/All/bootstrap-mk-files-$VERSION.tgz
box# cd ../../devel/bmake
box# bmake USE_DESTDIR=full package
box# pkg_add -uu /usr/pkgsrc/packages/All/bmake-$VERSION.tgz

Now that you have the latest build tools, you can upgrade the rest of the packages. The is a lot of ways to do it, but it choosed this one:

box# pkg_rolling-replace -u

And that's it. Hope it will work for you.

toying with ruby's Net::IMAP

Nope, this website is not dead, I was only -as usual- too lazy to keep it updated. Well, I just wanted to post a little something to check your IMAP accounts for unread mails with Ruby.

Unfortunately, it requires ruby 1.9 (btw, this is a good reason to give it a try). I'm not fluent enough to take advantage of any new features, but the Net::IMAP modules has been updated and supports a lot more authentication schemes than in 1.8.

Enough blah, here is the code:

#!/usr/bin/ruby1.9
 
accounts = [{ :name => 'example',
              :server => 'imap.example',
              :username => 'me@example.com',
              :password => 'mypass',
              :method => 'PLAIN',
              :mailboxes => ["INBOX"] }]
 
require 'net/imap'
 
def check_mails(account)
  imap = Net::IMAP.new(account[:server])
  imap.authenticate(account[:method], account[:username], account[:password])
  print "#{account[:name].capitalize}: "
  account[:mailboxes].each do |mailbox|
    imap.examine(mailbox)
    unread = 0
    imap.search(["UNSEEN"]).each do |message_id|
      unread += 1
    end
    status = imap.status(mailbox, ["MESSAGES"])
    print "#{mailbox.capitalize} #{unread}/#{status["MESSAGES"]} "
    imap.disconnect
  end
end
 
accounts.each { |a| check_mails(a) }

First, we define an array of hashes representing the IMAP accounts with their parameters (the keys speak for themselves).

Then we require the Net::IMAP module and define a method to check the mails.

The connexion and authentication parts are obvious.

We then loop on each defined mailbox and EXAMINE it, which will select it in read-only mode, allowing us to search messages.

The status method used later allow us to get some informations such as the RECENT and total messages counts. Unfortunately, we can't trust the RECENT count, because it's reset at every connexion, and I wanted the unread count.

That's why we have to search the messages having the UNSEEN flag set and loop on them.

We then ask for the status of the mailbox as explained before and print the results.

Finally, we we loop on the accounts and call the method.

So this is it, that's all for today (and my WMII status bar is happier! :).

doku iz full of luvz

First of all, welcome to the new version of twis.la, now powered by dokuwiki.

Doku is full of luvz, doku is beautiful, doku is easy, doku is your friend.

Short story: upgrade went bad, backup all data, by chance, it's the chistmas holidays, take the chance to make a clean reinstall, restore data.

More on the clean install later (it will be a page or even namespace on its own, linux/kvm with multiple BSD's running on it).

“Long” story: I made a big mistake while playing with the /usr HAMMER partition on my DragonFLy Web Server virtual Machine, I had to take it down for maintenance. Made my backups “just for the case”. Having the box backup'ed was an opportunity to upgrade the host physical machine… but as usual, murphy was there too, the box never came back online (it's a headless dedicated server without any console access, I did'nt knew why the box did not came back).

Being safe with my data, I took the opportunity to made a clean install and redo the setup of the virtual machines (I am still busy to bring everything back to life). So, kasteel now runs a small ubuntu 8.10 server linux distribution which act only as a “dom0” kvm host, all the services are jailed in different virtual machines, there is actually one OpenBSD 4.4-release, one FreeBSD 7.1-STABLE and one DragonFly 2.1.1-DEVELOPMENT. but as I said, the technical details are for another day.

This brings me to the title of the post, a great and clean technical setup is pretty uselless a few month later if you don't have any documentation. That's where doky came into the play. Wait - stop - I forgot something.

I WANTED MY WEBSITE BACK!

You all know that you don't exist if you don't have your little part of teh interwebs.

It was quite easy as all I had was static pages generated with asciidoc and igal. I'm a lazy guy, especially when it comes to web and database stuff. So, a few scripts and some tools were pretty useful to build a static website without too much trouble.

Except that I didn't edit any page for more than a year, I just dropped some files here and there on the server.

Here we are.

Dokuwiki!

  • No database to setup and manage, only static files.
  • A plethora of plugins to use it for other things than a classic wiki.
  • Easy to set up with nginx
  • It's a wiki and that what I need!

All in all, it fits my needs, I found some cool plugins to add, all the blog stuff I'm using now (see this page for more info about how to set up doku as a blog), a few syntax extensions and… the other essential website component, a galery plugin !

Welcome 2009, welcome doku, let's have some fun with the web.

following netbsd 5.0_STABLE 2009/08/20 17:45 twisla
Journey in RPM packaging 2009/06/19 11:42 twisla
upgrading-dragonfly-the-easy-way 2009/04/27 14:22 twisla
toying with ruby's Net::IMAP 2009/03/09 11:08 twisla
doku iz full of luvz 2009/01/07 04:06 twisla
blog.txt · Last modified: 2011/02/01 11:59 (external edit)
Trace: blog
Dieses Dokuwiki verwendet ein von Anymorphic Webdesign erstelltes Thema.
CC Attribution-Noncommercial-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0