My current activities occasionally need me to look at the kind of files GTKWave groks. Works well and all that, but this particular UI quirk is a little puzzling...
Mmhmm ... I'm sure this makes sense to the particular (special) kind of mind that writes GUI applications. Pretty amusing.
Christophe blogs (vaguely) about preparing and hardening laptops for (security) conferences. I wonder why a laptop shouldn't always be "hardened" though?
I've blogged before about how I prefer to use deterministic scripts over fragile background magic for configuring networking on my laptop.
The @conference script on my laptop is as follows:
#!/bin/sh rm -f $HOME/@* sudo iwconfig wlan0 essid conf_essid sudo iptables -P INPUT DROP sudo iptables -P FORWARD DROP sudo iptables -P OUTPUT ACCEPT sudo iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT sudo iptables -A INPUT -i lo -j ACCEPT sudo iptables -A INPUT -p icmp --icmp-type 3 -j ACCEPT sudo iptables -A INPUT -p icmp --icmp-type 8 -j ACCEPT sudo iptables -A INPUT -p icmp --icmp-type 11 -j ACCEPT sudo iptables -A INPUT -p icmp --icmp-type 12 -j ACCEPT sudo iptables -A INPUT -p tcp --syn --dport 22 -j ACCEPT sudo dhclient wlan0 tunnel
Instead of spending a lot of time identifying and disabling unnecessary services, I just drop packets I don't care about on the floor. Much simpler!
Christophe and others also forget to mention the following:
Regarding physical security:
Common sense, I think?
I run a business. This means I often have to print stuff for my accountant. I also feel that for the prices I charge my customers, the least I can do is send them an invoice on a piece of paper.
Unfortunately, Firefox still can't print.
With the exception of three countries (of which I am aware) everyone in the world uses ISO-standard A4 paper. For some reason however, Firefox continues to insist that I should be using "Letter" paper. I can't imagine where it gets this idea. It can't possibly be my "locale" (which is set to C) and I've certainly not configured this crazy papersize anywhere.
When will this be fixed?
I don't so much mind a default -- even if it's stupidly set to something only three countries in the world use -- if I could override it. I can click on "file" and on "page setup" until I'm blue in the face. The PostScript being sent to my printer continues to be wrong. Even if I "print to file", it's wrong. I can then fiddle with the PostScript to make it right, but I should not have to do that.
I really don't feel like grepping through the hundreds of megabytes of source code that Mozilla is to find where this silly papersize is coded to change it. Software should have sensible defaults. If software gives an option to override defaults, it should actually accept the override, not just ignore me.
Grumpy. Very very grumpy.
The web sucks. Browsers suck. I'm told that as technologies advance, humans regress as a form of self-defence. Have humans regressed too far? Is technology having to catch up with the dimwits?
Let's go back to simple.
A couple of months ago, I installed awesome 3. I initially held off upgrading for a while because some of the features scared me. It turns out it wasn't so scary after all, but I just didn't have time to properly adapt my world to the new config file format.
Tonight I finally took the plunge and kicked awesome 2 off my system to force myself to use awesome 3 and properly configured it.
Mostly, I just had to delete stuff I don't want from the default config file. For the time being, I'm also sticking with dmenu rather than using the awful (what's in a name?) prompt bits. The latter wants to rely on bash and that makes my teeth hurt. On FreeBSD systems I don't install bash at all and on Linux I move it out of my PATH where it can't hurt anyone. When I have another moment, I will take a look at making awful complete in a more sensible way.
I'm very happy with the way everything now nicely hooks into Lua. That means I can do away with the silly awesome-status script I had to run every minute to update my clock and some widgets.
I'll put my config files online eventually.
I spent much of today doing my annual "winter cleaning". For some reason, I have a feeling there should be a periodic script for this, preferably one which can read my mind.
Some notes:
Productive day! In a tidy sort of way.
I also found a number of local pkgsrc patches, but I think I've sent most of the relevant ones (ie: suitable for human consumption) to Geert for committing to pkgsrc and/or upstream. I'll go through those in a bit more detail tomorrow and Thursday.
I admit it: I'm a static analysis junkie. :-)
In addition to getting the FreeBSD Coverity builds into shape again (about which I'll have more to say again in a couple of days), I use FlexeLint fairly religiously on most of my code. Everyone should decide for themselves if running a lint is worth it but for myself, I can say with full confidence that it improves the quality of my code.
Of course, FlexeLint is fairly expensive if you don't have anyone to pay for it for you. There are free alternatives however, like splint or even the venerable xlint by Jochen Pohl or one of the ancient lints included with certain Unix operating systems I won't name.
Recently, Gimpel have released a new version of FlexeLint. One of the main new features in this version is thread analysis. It is nowhere near as thorough as Coverity (I wouldn't expect it to be), but it's remarkably good at checking for balanced locking -- every lock needs an accompanying unlock -- even across fairly tricky code paths.
Over the past couple of days, I've been setting the new version loose on some multithreaded code I wrote a while back (some of which has been fairly widely deployed with few reported bugs) and it has been finding some surprising issues. Surprising in the sense of how can this ever work?! even. Concurrency is a funny business.
If your only excuse not to run static analysis is fear of the copious output a first lint run generates, perhaps you should reconsider. That's often "only" a matter of proper configuration -- which admittedly is a bit of a black art.
Maybe the bugs of the month on Gimpel's website can turn you into a static analysis junkie too?
Waiting for other (useful) stuff to compile today, I spent some time setting up my own Jabber server. I've had jabberd compiled on a machine for a long time, I just hadn't gotten around to setting it up yet.
This was surprisingly simple, except for the SSL bits. I spent a good half hour wondering why BitlBee refused to connect with a very strange message:
jabber - Couldn't log in: Stream error: host-unknown: service requested for unknown domain
Turns out that the example <id... parameter in c2s.xml was formatted in such a way to make it non-obvious that I also had to change an example.net on the last line:
<id realm='example.net'
pemfile='/usr/local/etc/jabberd/server.pem'
mumble-mumble
>example.net</id>
Silly of me. Even sillier of me to have hacked XMPP STARTTLS support into OpenSSL s_client to try to debug it... As soon as I saw the example.net, a simple grep found the config bug immediately. Difficult works too. :-)
If anyone is interested, the patch is here: openssl_xmpp.diff.
I'll try to con Ben into including that upstream. :-)
Anyway - please replace philip@jabber.belnet.be with philip@paeps.cx on your Jabber roster.
I've been quiet. Mmhmm.
Currently, I'm rewriting an application for a customer which is presenting me with at least a couple of WTFs every day. Most recently, I've been puzzling over the original author's creativity in decoding a binary protocol without using bitwise shift operators.
Everywhere you would expect "shift left by n bits", there is a "multiply by 2^n". This makes understanding the protocol a bit tricky because the brain wants to be in "it's a number" mode rather than "it's a stream of bits" mode.
Of course, the original application is rife with sign-bugs too. :-)
In other news, it appears that I'll be giving a talk at EuroBSDcon. Warner won't be able to make it to France next week, so I will give his "Embedding FreeBSD" talk. I spent a good part of the weekend working on that.
Busy busy.
An application I've recently inherited is making my eyes bleed. Its authors felt it would be a good idea to write the application in "French C". All the comments are in French, and there are wrapper functions (like boucle) for for "English" C constructions.
I've said it before: localization sucks. French is a very nice language but not for software. Software is written in C and C looks a bit like English.
Live with it.
Copyright © 2005–2010 Philip Paeps
All rights reserved.