Linux
2009-01-06
Crossroads: a very good load balancing solution
Recently Martin Aspeli published a very nice buildout recipe that implements a complete setup for a production Zope/Plone server. One of the key components in that setup is the load balancer, which is implemented using the load balancer capabilities of nginx. Nginx might be a good load balancer, but it has a problem with the way Zope/Plone works: the first page loads, for a newly restarted Plone instance are very slow (especially if the site or the catalogs are big). It would be nice to have a way of telling nginx to take out one of the Zope instances from the cluster and then add it back once it's restarted and has its caches warmed. Sure, you could probably script something that would change the buildout options and reload nginx, but why bother when there's a load balancer that offers this and much more?
Crossroads (in its second version, at the moment 2.41) might lack the popularity when compared to perlball, pound or haproxy and may not even have the same features or performances (it's good enough for my needs and I haven't cross-benchmarked), but it's fast, easy to configure and, best of all, it can be configured to provide a web configuration/administration interface. This way, when a Zope server needs to be updated, I can take out the ZEO client from the balancer, restart it in supervisor, warm up the caches by calling the zope sites directly and then add it back to the cluster. The only faults that I could find to it is that the compilation mechanism is not very well tested (I couldn't complete an install with a specific destination prefix. Just checkout the Crossroads trunk or a tag and do a "make local", then you can use the xr binary from that folder). On the other hand, it's pretty well featured: it has sticky sessions, HTTP awarness (although its documentation recommends treating the http servers with the TCP algorithm), can use an external program to determine backend states (and could be plugged this way with Zope's ICP support), etc.
Below is a screenshot of the Crossroads administration interface, with Crossroads started with the following script:
#!/bin/sh XR=/usr/sbin/xr SERVER="-s http:127.0.0.1:7000" BACKENDS="-b 127.0.0.1:9080 -b 127.0.0.1:9081" ALGORITHM="-dl" HTTP_FLAGS="-x -X" TIMEOUTS="-t 10" CHECK_CALLS="-c 10" WEB_INTERFACE="-W 127.0.0.1:7020" #DEBUGGING="-v" DEBUGGING="" $XR $SERVER $BACKENDS $ALGORITHM $HTTP_FLAGS $TIMEOUTS $CHECK_CALLS $WEB_INTERFACE $DEBUGGING
2008-03-28
Ubuntu Hardy Heron: some things are bad
Note to self: always create a root account on Ubuntu.
I've updated my laptop to Kubuntu Hardy Heron, and while some things worked fine, there are a couple of stupid bugs that chained to make my life hard.
First of all, why did the Network Configuration applet in Settings Manager in KDE saw fit to delete the hostname of my localhost, tibi-laptop, from /etc/hosts? Now I can't run anything with sudo, as it imediately aborts with an error "No hostname tibi-laptop". Why can't my laptop find any Access Point if there wasn't one accessible at boot time? Why, when I've started Ubuntu in single mode, was I greeted with a dialog that asked me to select an option (continue normally, drop in root shell, fix X) but which didn't allow me to select anything (the keyboard wasn't properly recognized, even though that I have a perfectly regular keyboard on my laptop). Why does the reboot never finishes and maxes out the CPU?
The only way I could fix the hosts problem, while avoiding to hunt for some Linux cd, was to boot in Windows and install Ext2fsd and after that I was able to mount and change the /etc/hosts file.
These things are basic, they should just work. I'm aware that Hardy is beta right now and I'm using the KDE part of Hardy, but with Gutsy, (even though that applet always screwed up my network settings), I never had these problems. Shouldn't things go forward instead of backwards?
2007-05-08
Software is lame
I may sound like a fanboy or something, but I'm starting to think that it's impossible to have a perfect piece of software, especially with larger systems. Two things that happened to me lately that made me think this:
- How lame is that Windows doesn't automount USB sticks when they're present at boot time? Why would I have to remove+reinsert the stick just so Windows will see the bloody thing? My Kubuntu, of course, handles perfectly everything in this department (at least in my case).
- How lame is that Prototype handles in a really stupid way forms that have multiple submit buttons and are submitted through Ajax? Not even Form.request() will do the proper thing, which is to only leave one of the submit inputs in the stream, the one that has been clicked on. The problem is with zope.formlib, which gets the action and the validation from the submit button that was pressed. More then one submit input in the request and things become uncontrollable.
To fix this I have added the following onsubmit handler to my Javascript code:
my_form.onsubmit = function(event){
button = document.activeElement || event.explicitOriginalTarget; // IE, Mozilla, Opera
this.getInputs('submit').each(function(el){
if (el.name != button.name) {
el.disable();
}
}
}This disables all the submit input controls before serializing the form and doing an ajax request with Form.request(), as disabled inputs are ignored by serialize().
UPDATE: I am told that Prototype 1.6 will support multiple submit buttons.
2007-05-03
Brettspielwelt - the free, online boardgame portal
I live in Europe, I'm a geek, so I must also be a boardgame freak. I love games, and especially German style boardgames, with their intricate rules. Unfortunately, there's not much time to play, and not a lot of people that I can play with. Following a link on boardgamesgeek.com I've stumbled on this website, an online portal of boardgames that you can play, something similar to IGS (the Internet Go Server), but that implements loads of boardgames to be played in multiplayer style. The people are friendly and are willing to teach you to play (even in English). The client defaults to the German language, but this can be easily changed by changing the 'Nation = de' line to 'Nation = en' in the props file from the client download folder.
Being a Java application, it goes a long way to adding a few more entertainment choices to the ones available for the Linux platform, in terms of games.
UPDATE: There's a ton more of sites with online boardgames at the boargamegeek wiki
Some of these sites:
http://www.flexgames.com/ (2 games)
http://www.yucata.de/Default.aspx (several, growing)
games.asobrain.com (few, but has Settlers and Carcassonne)
http://www.spielbyweb.com/ (forum based)
http://yourturnmyturn.com/ (many, most classic)
http://hilinski.net/games/online/ (Taj Mahal and Tycoon)
2007-04-13
Starting the fans for an HP Compaq NX6125 with Ubuntu Feisty after suspend
In the saga to make my laptop behave as best as I can I've encountered a new obstacle: using Ubuntu Feisty Fawn (the beta) with kubuntu-desktop installed and using KDE, I can put the laptop in suspend mode, but the CPU fan won't turn on when I wake it. After a bit of searching I've found out that I need to do:
root@ubuntu:~# echo 0 > /proc/acpi/fan/C262/state
This starts the fan. Writing 3 in that fan ACPI state will turn off the fan.
References:
- http://gentoo-wiki.com/HARDWARE_HP_Compaq_nx6125_with_Turion64
- http://www.novell.com/documentation/suse91/suselinux-adminguide/html/ch09s03.html
The last update of Ubuntu broke the suspend, as shaky as it was before. The HAL package was updated and now Kubuntu won't wake up from sleep anymore. Also, I've updated my desktop from Edgy to Feisty and the update process wasn't without pains: the update-manager software would freeze and after updating with aptitude distr-upgrade, Gnome won't start anymore, the apparent reason being some problem with alsa. Funny enough, after I've installed kubuntu-desktop I can run KDE and play music with amarok without problems.
2007-03-20
Freeciv rediscovered
I've recently "rediscovered" Freeciv. I'm a very casual gamer (15 minutes/day), but also an old, addicted, Civilization fan. Lately I've been looking for a nice game to play on my Linux desktops and I've found that Freeciv is finally getting some good graphics, as this was my biggest turn off I've had with it before. I've tried first the SDL client on Windows, but it is buggy and tends to freeze its popup windows. The GTK Windows client is a lot better, works quite flawless as far as I can tell. I've compiled the Linux version (on Ubuntu Edgy), first I've tried the SDL client, but it complained (at configure time) about a missing sdl-image library, which I have (and no -dev version in my apt sources). Using the freeland-big tiles, the game had a huge memory footprint (40% of 1024 Mb RAM). The most apparent improvements are new tile graphics, with bigger size, new graphics for the city titles on the play screen, a new full-screen mode, even for the GTK version and a tree-based research screen. There is another tileset on the freeciv.org site, called Freeland-big. This has, IMHO, some improved tiles. Click on the image below to see the new graphics I'm talking about (this is the default tileset). And another one, this time on Linux, with Freeland-big tileset.
UPDATE: Using the svn/trunk version the huge memory footprint problem of the Linux client is solved, but I can't use the freeland-big tileset anymore. To compile it on Ubuntu, I first had to apt-get install automake1.8 and libgtk2.0-dev. After that, run autoconf.sh to start the configure script generation and then make install.
2007-02-21
Onwards to Gnome through Beryl and back to KDE
I like my Linux to stay "on the edge", I like the excitement of knowing that on the next update you'll get new or improved software, which happens a lot in the Open Source world. So I've updated yesterday my laptop (a Compaq NX 6125) to the yet unreleased Ubuntu Feisty Fawn, an experienced that took almost 24 hours to have a fully working system at the end. I'll give some details of the problems encountered below.
Having a newly updated system and already with the practice of rebooting the machine, I've decided to try and fix the 3d acceleration, for which I had the fglrx binary driver being loaded but which didn't give me 3d acceleration. First, I've tried the open source radeon driver (who's actual driver name in the xorg.conf file is still "ati"). It worked, but it still didn't give me 3d acceleration, as my card's 3d acceleration is unsuported (onboard ATI R200M).
Next on the list was to fix the fglrx. After I've uninstalled/reinstalled the fglrx driver and I've set the Composite option to Disable in the xorg.conf, I had 3d running. Plenty of details online, with guides and all, so this part was easy. While reading the documentation on the net about my card, it sparked my interest that some people had Beryl running on their laptops, with the same card, so I've set myself on trying to get that running, to see what it's about. To make a long story short, the AIGLX extension from X.org 7.1 is not supported by the fglrx driver, so I've installed the XGL server (which is a replacement for the regular X server), and even if you see that the DRI extension is not supported by XGL and direct rendering is off, you'll still get accelerated rendering and, of course, beryl-xgl running.
To make XGL the default X server, I've changed my KDM file to something like this (taken from a recipe from the opensuse site):
[X-:*-Core]
AllowNullPasswd=true
AllowShutdown=All
NoPassEnable=true
NoPassUsers=tibi
#ServerArgsLocal=-nolisten tcp
#ServerCmd=/usr/bin/X -br
ServerCmd=/usr/bin/Xgl :0 -fullscreen -accel xv:pbuffer -accel glx:pbuffer
ServerArgsLocal=-nolisten tcp
OpenRepeat=5
OpenDelay=15
OpenTimeout=2000
ServerTimeout=60
KDE was slow with beryl, and with it XGL used 40% of the memory (at least apparently), while with Gnome XGL used only ~8%. So I've set myself to switch to Gnome, just to have the nice beryl effects, but in the end I've realized that, even though my Gnome desktop is really beautiful (nice Vista based fonts, nice icons similar to MacOSX) and its simplicity in working and workflow is something to appreciate, I still enjoy more in working with a system that is less "flashy" (no beryl effects) and closer to my philosophy as hacker and programer. That and being pissed off that I can't properly standby the laptop from Gnome, only from KDE and I'd still have to use KDM as login manager because GDM couldn't properly work with XGL, at least from what I've configured.
So now I'm back to my relatively non-flashy (but still nice looking, after some work) KDE.
And now some words about the Edgy > Feisty upgrade. In itself it went pretty much pain-free, not too many broken packages. There was one which I had to manually uninstall it before the dist-upgrade could continue, I forgot which. After the system was installed and I made sure that there were no more packages left to install, I've rebooted. The first reboots took a long time to complete (and I think the first one didn't even "make it"), so I've had to reboot in single mode and try the system from there. There were some problems with the network (the system complained about too many arguments for an iface in the /etc/networking/interfaces file) and no matter how much I've tried from KDE and Gnome, I couldn't properly configure the network with a static IP (it would get reseted to dynamic) so I had to remember the ifconfig/route lines, something I haven't use for more then 6 years. Somehow things are now fixed, probably after I've erased most of the options from that faulty interfaces file. The Enterprise Volume Management System took a really long time to boot, which it does on all Ubuntu systems I have, so I've changed the /etc/init.d/evms file to exit right at the top, after I couldn't figure out how it gets loaded and why my system needs it. My boot loading times are much faster now without it :-).
There's not much new, visually, in Gnome, except for a relatively ugly config window instead of the menu options. Why did they change that? I think I liked the menu system better. Of course, in terms of configuration windows preffered, I'm a fan of the old KControl, which I still run it when I need to configure something in KDE.
2007-02-10
Zope buildout quickstart
One of the bigger players in the latest move to automate Plone and Zope development and deployment has been buildout, so I figured it's about time to start learning it and see how it can help me. I'm writing this short recipe as I progress through learning buildout to help me remember this stuff later on.
Installing buildout
The easiest way to install buildout is to get easy_install (a manager for python packages) on your system. In order to get it installed, I had to do: (based on a custom python 2.4.3 installation in /opt/python):
$mkdir ~/buildout_play
$cd ~/buildout_play
$wget http://peak.telecommunity.com/dist/ez_setup.py
$sudo /opt/python/bin/python ez_setup.py
Next, install the zc.buildout package, using easy_install:
/opt/python/bin/easy_install zc.buildout
This will install the buildout egg in the python site-packages folder and create a 'buildout' script in the scripts folder, in my case /opt/python/bin/buildout.
Next, transform the buildout_play folder in buildout folder, by running:
/opt/python/bin/buildout -v
This will "bootstrap" that folder and prepare it as a buildout environment, also installing the setuptools and zc.buildout eggs. The buildout script will check every time it's being ran if those eggs are at their latest version, run it with the -N option if you want to skip that.
As a simple test for buildout, I've modified my buildout.cfg to contain the following lines:
[buildout]
parts = checkout
[checkout]
recipe = zc.recipe.zope3checkout
url = svn://svn.zope.org/repos/main/Zope3/trunk
This tells buildout to include a part named checkout, which is defined to use the "zc.recipe.zope3checkout" recipe, that is configured with the "url" option. Running
/opt/python/bin/buildout -v -N
will automatically grab the zc.recipe.zope3checkout egg, do a svn checkout in the parts/checkout folder and then compile in place the zope 3 checkout.
When developing new projects, to make this process easier, it is possible to put a bootstrap.py script in the folder where you're developing, which will automatically install setuptools (easy_install) and zc.buildout, transform that folder in a buildout folder and put a bin/bootstrap script that can be ran to do the build.
These are the basics to get started, see below for further details.
Reference
2006-10-29
Pitfall of building python from source on Ubuntu
Zope 3.3 doesn't work well with the python 2.4.4 that comes with Ubuntu Edgy. Something about a readline change somewhere in the python standard library. So I had to build python 2.4.3 from source. Being an impatient being, I haven't give it much thought and just unpacked the python tarball, hit ./configure and make install. I ended up with python installed in /usr/local/bin/python, which would be really really cool if Ubuntu wouldn't depend on python and wouldn't place /usr/local/bin at the beginning of $PATH. The problem became apparent when a simple upgrade failed because of a missing xdg python package.
I changed the PATH and erased /usr/local/bin from it, restarted the update and everything was fine. Searching for a bit in /etc revealed a login.defs file that contains the PATH as it would be defined for the users. I changed this file, but I don't have the patience to update now, so I presume that on my next update /usr/local/bin would be moved to the back of the $PATH, as I have specified in it.
2006-10-01
Dapper + 1 = Edgy
I've upgraded my laptop's Compaq nx6125 Dapper to Edgy yesterday. These are some of the issues and highlights that I encountered:
- The update manager that did the upgrade it is impressive, but the update was not entirely automatically, one of the gtk engine packages kept spewing errors. The update manager was able to go over this incident in the initial phase, but terminated with an error when it was about 95% to finishing the update. The main packages were installed by then (kernel, X, etc), so I was able to run apt-get remove that package and then run the update manager to complete the setup.
- The newly installed kernel is the first kernel that workes for my laptop, after Dapper's 2.6.15-19 . All the others were maxing the CPU unless I booted with acpi=off, which slightly corrupted the display.
- I had to go and tweak grub's menu.lst because the default console resolution killed my console windows.
- Everything works pretty well, but I can't really see any major difference with Gnome, except the odd gray color on the window selector applet and the Gnome menu applet in the panel, which contrasts with the pale gray-yellow of the rest of the panel. The fonts look really good on my laptop, they are very readable and pleasant to look at. Anyway, I'm keeping close to KDE on my laptop, which got some pleasant improvements. The volume keys on the laptop now work perfectly with KDE, the only problem that I see is that KDE doesn't agree with Gnome on the sound volume and mute state.
- Konversation got an upgrade, which can only be good
- WhereIsIt work now a lot better with wine, I even get a window entry in my taskbar! :-)
- Firefox is now a 2.0 beta (Bon Echo Beta 2), which has autocomplete in the google search box, automatically saves browsing sessions, seems faster with Plone sites, has spellchecking for text input areas and a broken Dom Inspector. Oh, well...
- Another issue is that I can't install kdemultimedia. It has a dependency on libarts-audiofile which has a dependency on kdemultimedia-dev and they conflict each other on package versions. Adept Manager seems like a powerful tool, but its usability is not very good, and it's not capable of solving this issue. Synaptic can't fix this problem either, so I guess I'll wait for some updates or otherwise figure some solution for this problem.
- The composite extension for X.org was enabled by default, which disabled the 3d rendering for the ati r200 onboard card. I thought it's a problem with the included fglrx module from linux-restricted-modules, so I've installed the driver from ati.com. Which wasn't the real solution to the problem, but in doing so I've found enough clues to solve the problem. For sure I don't need composite without the accelerated OpenGL, so it's not a loss, but it's too bad that I still have to wait for ati to implement proper drivers (they claim to wait for xorg to flag composite out of experimental) for linux.
- Hibernate sometimes works, sometimes doesn't. Suspend doesn't work.
- There are a couple of interesting KDE apps, including Katapult and Yakuake, first is a software launcher bounded to alt+space and the second being a terminal that drops down quake style.
UPDATE:
- when the battery went off on the laptop it just shut down. No warning, no shutdown sequence, just cold shutdown. Ugly.
- I've upgraded to Edgy on the main workstation desktop. The update was a bit on the rough side, having had to run dpkg -r a lot to remove faulty packages, but in the end I pulled it through. Right now nvidia-glx won't work, so no accelerated desktop until I compile the nvidia driver packages myself. But otherwise things are good.
UPDATE II:
- I've moved from KDE back to Gnome on my laptop. I'll sure miss it, but I might be at the point where simplicity matters most, and Gnome offers that.
- I've installed Ubuntu Dapper and upgraded to Edgy on a friend's new Dell laptop, things seem to be working just fine. I still need to configure his wireless card, and I had to install the 915resolution from universe in order to get the proper resolution on the screen
- I've updated Ubuntu to Edgy on a friend's laptop, she had Ubuntu before but was using Windows, but now she's completely moving to Linux. She's in love with the interface and the thousands of software that she can install. The experience hasn't been the easiest, as the pppoeconf program is broken and there's no built-in UI based possibility to configure PPPOE in Ubuntu. Sucks!
2006-09-23
Kde applications vs Gnome applications
I'm switching a bunch of Gnome daily used apps to their KDE counterparts. Namely I've switched from *Liferea to Akregate, from **GnoCHM to KchmViewer and from ***GIMP to Krita (Gimp sucks too much for me in terms of workflow, while Krita is more conventional and less awkward from some points of view). I'm using already using Konversation for IRC (much better then XChat, I'd use Chatzilla but it doesn't go to the systray), Tellico to keep a database of PS2 games and K3b for burning dvds. Next switch is for the full desktop, Gnome > KDE, but I'm waiting for some free time and Edgy, to give the new Gnome a proper review first. I've been looking at some screenshots on KDELook (thanks to Akregate came with some feeds preinstalled) and I think I wouldn't have a problem, especially if I install some compiz goodness.
* Liferea was really really slow in marking feeds as read
** Although I can't copy & paste easily inside Gnome from this kde application, it is a far better chm viewer then its gnome counterpart.
*** Come on GIMP, fixed brush sizes? Windows all over the desktop and taskbar? Plus, Krita has layer groups, which is a step away (I imagine) from having layer effects just like Photoshop. I hate GIMP so much that I'm willing to use ImageReady under wine just to avoid it.
UPDATE: gnome-mag (magnifier) doesn't even give me the opportunity to test it (just maxes the CPU), while kmag works great as a screen magnifier. Koppete is really nice, even compared to the new GAIM 2.0 beta.
2006-09-22
Online tools to check DNS
Every now and then I need to check the dns settings for some servers that I look after. Not being an expert, I use these two sites frequently to check that I'm not doing anything stupid:
My preferate is dnsreport.com, but I always forget its name and its pagerank on google is not too high. So I'm doing my really really tiny bit in lifting up its page rank by linking to it on this page.
2006-09-16
Short checklist for Postfix + MySQL + Dovecot + SASL authentication on Fedora
1. Postfix needs to be rebuilt with Mysql enabled
Follow this tutorial: http://postfix.wiki.xs4all.nl/index.php?title=Virtual_Users_and_Domains_with_Courier-IMAP_and_MySQL
This one also helps: Virtual Users And Domains With Postfix, Courier And MySQL (Fedora Core 5) | HowtoForge - Linux Howtos and Tutorials
2. Instal cyrus-sasl and cyrus-sasl-sql.
Configure /etc/sysconfig/saslauthd to run with the rimap mechanism
3. Start saslauthd
2006-09-02
Trying KDE as the main work desktop
Until a year ago, when I had my first hands-on experience with Ubuntu, I was a KDE fan. I still admire the desktop and follow closely the development, but I was so impressed at that time by the uniformity and visual appeal that Gnome, under Ubuntu, offered, that I switched. Recently I found the Gnome desktop to be a bit on the slow on my laptop, so I've tried several lighter window managers. First, my trusted WindowMaker. I totally dig wmaker. But I became too used to a full desktop, and I don't feel that I can waste too much productive time configuring the window menu to be the way I like it, so I gave up on it. Next, I've tried blackbox & fluxbox, which I found to be ugly and quickly abandoned. I've played a bit with e16, as it was one of my old time favourites, but I didn't have the patience to configure it to my liking. So I've installed kde 3.5 and now I'm testing it (one note: I still haven't installed the kubuntu-desktop package, just the kde-desktop).
Impressions so far: first, I had some serious problems with the sound. It worked perfectly in Gnome, but I couldn't get anything from KDE. After I've played several times with various mixers and killed several applications, I got it to work. BUT... there's no support (as far as I could see) for the volume control buttons that my HP Compax NX6125 has. I don't know how to configure kmilo, so that's it. Luckily, I can configure some keyboard shortcuts in amarok's global shortcuts, so it's not all lost.
Amarok seems better in handling online radio streams. Rhythmbox became very unresponsive when the network choked. I still like the simplicity of the Rhythmbox interface better.
Although I spent some time trying to get KDE to look a bit better, it still feels ugly, compared to Gnome. There are a myriad of little things that make Gnome to feel "better integrated" and friendlier to me. On the plus side, KDE seems to be trying harder at integration: Firefox and all the other Gnome applications follow the KDE theme and KControl has several checkboxes to control this. I'm still giving KDE a chance, at least to prove that it works faster and better then Gnome. Also, I'm still using the "heavyweights": Poseidon, Firefox & jEdit, so it all comes down to the desktop environment to improve my workflow. I'll see what the results are in a few days.
2006-08-30
Improve Plone-based website performance with simple Apache caching
I won't go too much into details, and this is more for my own personal reference, but using this short recipe I was able to increase by up to 100 times the performance of a plone based website. For a lot more details and more advanced techniques for caching, integration with squid and cachefu, visit the Plone documentation HowTo section.
The website hosts mostly news updates, and is edited mostly by an editorial staff, under a 24 hours cycle. The configuration file is extremely simple and can be droped in for any website that has a similar profile (or any website that has a closed editorial staff)
Requirements: apache 2 + mod_disk_cache + mod_expires
<LocationMatch "^[^/]">
Deny from all
</LocationMatch>
<IfModule mod_disk_cache.c>
CacheEnable disk /
CacheRoot /var/cache/http
CacheSize 5
CacheMaxExpire 24
CacheLastModifiedFactor 0.1
CacheDefaultExpire 3
#expires in 3 hours
CacheGcInterval 3
#check each hour the cache and delete the obsolete files
</IfModule>
<IfModule mod_deflate.c>
SetOutputFilter DEFLATE
</IfModule>
ExpiresActive On
ExpiresByType image/gif A10800
ExpiresByType image/png A10800
ExpiresByType image/jpeg A10800
ExpiresByType text/css A10800
ExpiresByType text/javascript A10800
ExpiresByType application/x-javascript A10800
ExpiresByType text/html A10800
ExpiresByType text/xml A10800
2006-08-23
Short guide to dns with bind on Fedora
I'm replacing a tinydns server with bind9, so I may as well put the setup here, as future reference.
First,
yum install bind-chroot
to install the chrooted bind server.
Next, edit the /var/named/chroot/etc/named.conf
options {
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
recursion no;
};
//root global
//life
zone "life.org.ro" {
type master;
file "/etc/db.life.org.ro";
notify yes;
};
zone "0.0.127.in-addr.arpa" {
type master;
file "/etc/db.localhost";
allow-update { none; };
};
zone "58.77.82.in-addr.arpa" {
type master;
file "/etc/db.82.77.58.133";
};
zone "caleidoscop.org.ro" {
type master;
file "/etc/db.caleidoscop.org.ro";
notify yes;
};
include "/etc/rndc.key";
I'm defining four zones: life.org.ro, reverse localhost (127.0.0.1), reverse dns for the IP and an extra host, caleidoscop.org.ro.
Now, the content of db.life.org.ro
$TTL 86400
life.org.ro. IN SOA a.ns.life.org.ro. hostmaster.life.org.ro (
2006082102 ; serial
1h ; refresh
15m ; retry
15d ; expire
1h ) ; negative caching
; NAMESERVER
life.org.ro. IN NS a.ns.life.org.ro. ; nameserver
;
; hosts (canonical names)
;
life.org.ro. IN A 82.77.58.133
a.ns.life.org.ro. IN A 82.77.58.133
mail.life.org.ro. IN A 82.77.58.133
www.life.org.ro. IN A 82.77.58.133
;
; mail exchanger
;
life.org.ro. IN MX 10 mail.life.org.ro.
; SPF records
life.org.ro. IN TXT "v=spf1 a mx ~all"
mail.life.org.ro. IN TXT "v=spf1 a mx -all"
The domain is registered at RNC (Romanian central dns registry) with 82.77.58.133 a.ns.life.org.ro, so I'm setting a.ns.life.org.ro as the authoritative nameserver in line 2, then define the nameserver, the hosts, mail exchanger and the SPF records (thanks to the http://openspf.org wizard). The server in itself has only one internet connection, with only one IP address, (no redundancies), so I've just defined one nameserver.
Next, the reverse IP entry for 82.77.58.133, in db.82.77.58.133
$TTL 3h
58.77.82.in-addr.arpa. IN SOA a.ns.life.org.ro. hostmaster.life.org.ro (
1 ; serial
1h ; refresh
15m ; retry
30d ; expire
1h ) ; negative caching
; NAMESERVER
58.77.82.in-addr.arpa. IN NS a.ns.life.org.ro. ; nameserver
;
; hosts (canonical names)
;
133.58.77.82.in-addr.arpa. IN PTR life.org.ro.
Just added a PTR record for life.org.ro
Now, the file db.caleidoscop.org.ro. I've defined the host, primary name server and SPF record.
$TTL 86400
caleidoscop.org.ro. IN SOA a.ns.life.org.ro. hostmaster.caleidoscop.org.ro (
1 ; serial
1h ; refresh
15m ; retry
30d ; expire
1h ) ; negative caching
;
; hosts (canonical names)
;
caleidoscop.org.ro. IN A 82.77.58.133
www.caleidoscop.org.ro. IN A 82.77.58.133
;
; Aliases
;
;mail.life.org.ro. IN CNAME server.life.org.ro.
;
; mail exchanger
;
caleidoscop.org.ro. IN MX 10 mail.life.org.ro.
; SPF record
caleidoscop.org.ro. IN TXT "v=spf1 a mx ~all"
Finally, the entry for db.localhost
$TTL 3h
0.0.127.in-addr.arpa. IN SOA a.ns.life.org.ro. hostmaster.life.org.ro. (
1 ; Serial
3h ; Refresh after 3 hours
1h ; Retry after 1 hour
1w ; Expire after 1 week
1h ) ; Negative caching TTL of 1 hour
0.0.127.in-addr.arpa. IN NS a.ns.life.org.ro.
1.0.0.127.in-addr.arpa. IN PTR localhost.
That's about it. I may have made some mistakes, but checking the domains with dnsreport yields good reports, so I'll leave it like this.
2006-08-13
Miniguide to openldap
LDAP is a lot easier then one might think at first sight. First, reading this short introduction to LDAP will tell us that LDAP is just an object database, that holds trees of objects and schemas of those objects. This is nice and easy for anyone acustomed to ZODB and Archetypes.
Next, installing. The OpenLDAP server on Debian is called slapd, so apt-get install slapd. After that, run dpkg-reconfigure -plow slapd which will allow reconfiguring the domains. For example, I've set my domain to pixelblaster.ro and the organization unit (ou) to Pixelblaster, which would result in base dn of dc=pixelblaster,dc=ro for the server and ou=Pixelblaster,dc=pixelblaster,dc=ro for the Pixelblaster branch. Another common setup is to create the following base dn: ou=programmers,o=Pixelblaster
With a tools such as JXplorer a connection to the server, to the dc=pixelblaster,dc=ro base db, with a binding authentication of cn=admin,dc=pixelblaster,dc=ro
Some of the common shortcuts used by ldap:
o = organization
ou = organization unit
dc = domain component
cn = common name
sn = surname
To make an address book, I have created the following dn: ou=people,o=Pixelblaster,dc=pixelblaster,dc=ro Now I just have to add inetOrgPerson objects that will act as addressbook entries. Some tools dedicated to this tasks are:
- directoryassistant, a nice python based utility that can be used to search and edit this address book
- kaddressbook is a much more complex tool, integrated with the KDE desktop
- just as fun is luma, a python based Qt app that can be used, among many other functions, as addressbook
Next step is to put the LDAP server to work and make it serve samba and unix accounts
2006-08-12
Games for Linux
Following link from the PyPi, I've stumbled upon this page: http://emhsoft.net/index.html
The abstract shooters on that page are very nice. Also, a few of those games are implemented with pygame ;-) .
2006-07-22
My favorite development environment
I thought I'd add some words about the development environment that I feel most comfortable with.
First, I use AGX for most of my plone development. It's useful as a quick skeleton generator, but also as a way to structure the content. To generate the UML files I use Poseidon Community Edition. Up until recently it was buggy, and I still consider it to be, but I learned what to do so I won't trigger the bugs (quick tip: don't ever rename tagged values, delete it and recreate it. If you rename a tgv, it will rename that tgv in the entire model). I've tried ArgoUML and, despite having better support for AGX, it felt buggy. And I don't like the way you have to hunt down the tgvs in that long list when adding one.
I use JEdit as text editor. It's not the greatest python editor, but it's a good all-arounder. I like its xml support, it's great when editing page templates. It's fast, has a ton of plugins and a nice "hypersearch" bar that you can place at the top and use it to quickly search in the curent document. Lately I've started using SPE for a wxpython based project, and I'm also trying Eclipse with pydev.
When creating a plone skin, the Firefox Dom Inspector is invaluable.
I use Ubuntu Dapper as the main OS. Although I have dual boot, 99% of the time I spend it in Linux. It has been my main OS since Breezy Badger came out, and I like it a lot. It runs Java software really fast and Gnome is terific DE. I was a KDE (with WindowsMaker as window manager) fan until my first contact with Ubuntu. It's nice! I bind alt + 1, 2 and so on to the each desktop and so I can switch really fast to the application I'm interested in. I put Jedit on desktop 1, the gnome terminal on desktop 2 and firefox on desktop 3. I can run Internet Explorer 6 and Photoshop 7, to cover even the last Windows needs.
And last, I listen to Radio Paradise with Rhythmbox. When I feel like exploring, I use StreamTuner or head over to Radio Grassy Hill, BorderRadio or Deviant Audio. Either that, or listen to my extensive collection of Grateful Dead mp3 recordings.

