Some weeks ago a tool got my attention - pgstats. It was mentioned in a blog post, so I tried it out and it made a very good first impression. Now version 1.0 was released. It can be found in github. It is a small tool to get statistics from postgres in intervals, just like with iostat, vmstat and other *stat tools. It has a number of modules to get these, for example for databases, tables, index usage and the like.
Before SUN was bought by Oracle, OpenSolaris had ever newer versions and upgrading was just an $ zpool upgrade rpool away. But since then, the open source version of ZFS gained feature flags. POOL FEATURE --------------- tank1 multi_vdev_crash_dump enabled_txg hole_birth extensible_dataset embedded_data bookmarks filesystem_limits If you want to enable only one of these features, you may have already hit the problem, that zpool upgrade can only upgrade one pool or all.
After some time of using an Almond as our router and always having trouble with disconnects, I bought a small apu1d4, an AMD low power board, as our new router. It is now running FreeBSD and is very stable. Not a single connection was dropped yet. As we have some services in our network, like a fileserver and a printer, we always wanted to use names instead of IPs, but not a single router yet could provide that.
Four weeks ago I was askes to show some features of PostgreSQL. In that presentation I came up with an interesting statement, with which I could show nice feature. What I’m talking about is the usage of common table expressions (or short CTE) and explain. Common table expressions create a temporary table just for this query. The result can be used anywhere in the rest of the query. It is pretty useful to group sub selects into smaller chunks, but also to create DML statements which return data.
Nearly two years ago, Postgres got a very nice feature - range types. These are available for timestamps, numerics and integers. The problem is, that till now, I didn’t have a good example what one could do with it. But today someone gave me a quest to use it! His problem was, that they had id ranges used by customers and they weren’t sure if they overlapped. The table looked something like this: create table ranges( range_id serial primary key, lower_bound bigint not null, upper_bound bigint not null ); With data like this insert into ranges(lower_bound, upper_bound) values (120000, 120500), (123000, 123750), (123750, 124000); They had something like 40,000 rows of that kind.
Some weeks ago I read a blog post about rolling out your configs with ansible as a way to learn how to use it. The posts wasn’t full of information how to do it, but his repository was a great inspiration. As I stopped using cfengine and instead wanted to use ansible, that was a great opportunity to further learn how to use it and I have to say, it is a really nice experience.
For some weeks now I have been playing with Go, a programming language developed with support from google. I’m not really sure yet, if I like it or not. The ugly things first - so that the nice things can be enjoyed longer. Gos package management is probably one of the worst points of the language. It has an included system to load code from any repository system, but everything has to be versioned.
I thought I could write more good stuff about cfengine, but it had some pretty serious issues for me. The first issue is the documentation. There are two documents available. One for an older version but very well written and a newer one which is a nightmare to navigate. I would use the older version, if it would work all the time. The second issue is that cfengine can destroy itself.
Yesterday I bought a printer/scanner combination, a HP Officejet pro 8600. It has some nice functions included, but the most important for us was the ability to print to a network storage. As I did not find any documentation on how it is possible to get the printer to speak with a samba share, I will describe it here. To get started I assume, that you already have a configured and running samba server.
When you want to start with cfengine, it is not exactly obvious how some stuff works. To make it easier for others, I will write about some stuff I find out in the process. For the start, here is the first thing I found out. By default cfengine logs to files in the work directory. This can get a bit ugly, when the agent is running every 5min. As I use cf-execd, I added the option executorfacility to the exed section.
The new blog is finally online. It took us nearly more than a year to finally get the new design done. First we replaced thin with puma. Thin was getting more and more a bother and didn’t really work reliable anymore. Because of the software needed, it was pinned to a specific version of rack, thin, rubinius and some other stuff. Changing one dependency meant a lot of working getting it going again.
Postfix’ policy system is a bit confusing. There are so many knobs to avoid receiving mails which do not belong to any account on the system and most of them check multiple things at once, which makes building restrictions a bit of a gamble. After I finally enabled the security reports in freebsd the amount of mails in the mailqueue hit me. After some further investigation I found even error messages of dspam, having trouble to rate spam for receivers which were not even in the system.