Older blog entries for Stevey (starting at number 574)

I will be awesome, eventually.

Earlier this year, in March, I switched to the bluetile tiling window, and it has been a great success.

So I was interested in seeing Vincent Bernats post about switching to Awesome, I myself intend to do that "eventually", now I've successfully dipped my toes into tiling-land, via bluetiles simple config and gnome-friendly setup.

One thing that puts me off is the length of my sessions:

skx@precious:~/hg/blog$ ps -ef | grep skx
skx       2237     1  0 Mar12 ?        00:00:01 /usr/bin/gnome-keyring-daemon ...

As you can see I've been logged into my desktop session for four months. I lock the screen when I wander away, but generally login once when the computer boots and never again for half a year or so. FWIW:

skx@precious:~/hg/blog$ uptime
 23:01:19 up 138 days,  4:44,  4 users,  load average: 0.02, 0.06, 0.02

ObQuote: "I'm 30 years old. I'm almost a grown man. " - Rocketman

Syndicated 2012-07-28 22:04:25 from Steve Kemp's Blog

Another day, another upgrade

Tonight I upgraded my personal machine to run the recently released 3.5[.0] kernel.

On my personal machine(s) I'm usually loathe to change a running kernel, but this one was a good step forward because it allows me to experiment with seccomp filters.

I've tested the trivial "no new privileges" pctl and I followed along with the nice seccomp tutorial which gave me simple working code which I married to my javascript interpreter.

On top of that I upgraded node.js, which meant I had to clean up a little depreciated code in my node reverse proxy - which is the public face of the websites I run upon my box. (The proxy tunnels to about 10 different thttpd instances, each running upon 127.0.0.1:xx).

Happily however my weekend was not full of code, it was brightened by the opportunity to take pictures of Aurora and her long hair - more to come as I've still got about 350 images to wade through..

ObQuote: "Don't you think I make a remarkable queen? " - St. Trinian's (2007)

Syndicated 2012-07-22 21:53:15 from Steve Kemp's Blog

Misc update.

I got a few emails about the status panel I'd both toyed with and posted. The end result is that the live load graphs now have documentation, look prettier, and contain a link to the source code.

Apart from that this week has mostly involved photographing cute cats, hairy dogs, and women in corsets.

In Debian-related news njam: Insecure usage of environmental variable was closed after about 7 months, and I reported a failure of omega-rpg to drop group(games) privileges prior to saving game-state. That leads to things like this:

skx@precious:~$ ls -l | grep games
-rw-r--r--   1 skx games   14506 Jul  8 15:20 Omega1000

Not the end of the world, but it does mean you can write to directories owned by root.games, and potentially over-write level/high-score files in other packages leading to compromises.

ObQuote: "Your suffering will be legendary, even in hell! " - Hellraiser II (Did you know there were eight HellRaiser sequels?)

Syndicated 2012-07-08 14:23:21 from Steve Kemp's Blog

Writing a status panel the modern way

So status displays are cool. Seeing what is happening in real time is cool.

As a proof of concept I put together a trivial load-graph:

This is broken down into three parts:

Load Client

The load client is a trivial script which reads /proc/loadavg, and sends the 1-minute entry to a remote server, via a single UDP packet.

Load Server

The load-server is a service which listens for UDP traffic, and when it receives a new integer records that in a redis data-store.

Load Display

This is a HTML page which has the values from the store in it, which is then plotted using javscript.

So the UDP-server which receives load will receive two things:

  • load:N - The load figure. The text "load:" is literal, and present in case I decide to extend the stats..
  • x.x.x.x - The IP address from which it received the message.

This is inserted into a Redis database as an array. This array could then be fetched via an AJAX script to update the HTML display in real-time, but at the moment I just have a shell script which updates it in near-real time.

The idea of having a UDP-server receive values from remote clients is interesting. We just need to define a mapping to redis. For me I've just done this:

receive a UDP packet with value "load:1.2" from source 1.2.3.4
append "1.2" to key "1.2.3.4-load".
append the value "1.2.3.4" to the global "known_hosts"

The values received can be truncated (i.e. keep only the most recent 60 entries) with ease, due to the available Redis primitives, and we can easily graph these using the qjplot library.

Adding more metrics just means updating the clients to send "memfree:400m", "disk-free:50%", "users:2", "uptime:12345s", or similar. The storage is wonderfully abstract - all you need to do is get the graph-drawing code to a) Know which source to display, and b) which metric.

For example, if we did extend the client to send that data I could draw a graph of the memory on host foo.example.com just by selecting "memfree" against the origin "1.2.3.4".

ObQuote: "Come here, damn you, I want to touch you. " - Hellraiser

Syndicated 2012-06-19 18:38:12 from Steve Kemp's Blog

Sometimes the important things are those you don't do

Usually in life we focus upon the things we do, and not the things we don't do, or avoid.

I don't have many "rules" for the way I behave, the things I do, but there are some.

  • I refuse, point-blank, to purchase any food which includes the phrase "low fat" upon the label.
  • I eat, fry, and cook with real butter.
    • I refuse to use any of the alternatives. Especially the low-fat alternatives.
  • I have yet to view a film in 3D.
    • I suspect this is something I'm semi-seriously avoiding, but I've not yet explicitly decided to skip them.
  • I refuse to watch any film which is "supernateral".
  • I refuse to buy anything from a pound-land, pound-stretcher, or similarly low-end store which is labeled either "deluxe" or "luxury".
    • I made this mistake when I was a young student.

I could go on, but the "rules" are surprisingly hard to remember, having been in place for many years, they're just part of the way that I do (or do not do) things!

Finally: As of this year I've now lived in Edinburgh for over half my life.

ObQuote: "I don't know. We should go and like, stalk him or something. " - Megan Is Missing

Syndicated 2012-06-16 10:32:13 from Steve Kemp's Blog

I've posted my javascript stuff

I previously mentioned some work I'd done with mixing Javascript & C.

The code is now visible here:

This consists of a binary which allows you to run javascript files, those javascript files have some extra methods available to them, allowing this sample file to execute and do things:

  • Fetch a web-page with curl.
  • Connect to a locally running memcached server.
  • Parse command line arguments.

Not great work, but still a useful exercise.

ObQuote: "Please! I don't wanna go back there, you don't know what it's like to be treated as a freak!" - Shrek

Syndicated 2012-06-01 08:56:19 from Steve Kemp's Blog

29 May 2012 (updated 29 May 2012 at 16:06 UTC) »

A heady mixture of photography and programming

The past few weeks have consisted of a heady mixture of taking interesting pictures of cute people, and writing code.

I spent a while getting to grips with seccomp filters, using the facilities present in recent GNU/Linux Kernels to filter system calls binaries are allowed to make.

My initial test was to patch GNU Less to only allow it to open, read, and close files. The side-effect of this was that the built in shell-escape was closed, thus allowing me to test it.

After that I toyed around with interfacing with spidermonkey|seamonkey. In this regard I was less succesful, but I did manage to write code in C that would invoke javascript functions loaded dynamically. Similarly I could call from my (loaded) javascript code into functions defined in C.

I don't have a use for a Javascript to/from C bridge, but I'm sure that time will come.

Photography has been a constant distraction, I took some fun shots of the Edinburgh Marathon, and then distracted myself with a volunteer to take an abstract fishnet photograph. We went on to do some more fun shots begin careful to stay on the safe side of the NSFW limit. I think this is borderline NSFW, but we were both clear exactly what we wanted and we got it perfectly there.

Next week will be quieter, but providing we don't have another mini-heatwave in Edinburgh I'll be cheerful regardless.

ObQuote: One, two, Freddy's coming for you. - A Nightmare on Elm Street (original)

Syndicated 2012-05-29 14:56:16 (Updated 2012-05-29 16:06:34) from Steve Kemp's Blog

On working from home

Recently an ex-colleague of mine changed jobs and suggested that I write something about the pros and cons of working from home. I've thought about this subject, off and on, for a few years and frustratingly I think most of the pros and the cons are the same:

  • When you work from home you're working from home.

I live in a two-bedroom flat in Edinburgh. (Having just spent thousands on a new bathroom I don't expect I'll be moving any time soon. A rough budget of £40-50,000 would let me convert my attic into two/three rooms. So there is growth potential!)

In my flat I have made one of the bedrooms an office. The office contains:

  • A huge desk with two PCs, and two telephones on it.
  • Several book-cases.
  • A wall-mounted fan.
  • Very little else.

One PC is for work. One PC is for me. One phone is for work. One phone is my own.

Every working day I switch on the work router, the work phone, the work PC around 09:30. I then work, taking a lunch-break between either 12:00-13:00 or 13:00-14:00, until 18:00 at which point I switch off the work toys.

I ignore my personal PC during the working day with the exception that it is the source of my music. I can reach across and hit the appropriate multi-media keys to select Play/Pause/Next Track/Previous Track/Volume Up/Volume Down. (When thenever the work-phone rings the first ring is ignored as I scramble to hit "Mute" or "Pause"..!)

So what are some of the advantages/drawbacks? Well I'm at home. So the environment is one that I've made myself, and enjoy. The music is mine. The colour-scheme is mine. The pictures on the walls are mine. I have a Steve-loving chair. There is no soulless air-conditioning, no horrible cubicles, and no noisy people talking.

The downside? No people talking. If I didn't leave my house at lunchtime I'd speak to zero people face to face in an average working day. That took a while for me to notice, but it is not nice.

Since I work from home "the commute" takes seconds. I tend to get out of bed and wander straight to the desk. I'll work non-stop, then get dressed around lunchtime so that I can go out for lunch. Hail, Rain, Snow, or Sunshine I leave the house for lunch every single day (unless waiting for an atypical delivery). Because if I didn't I'd have no human contact. In the afternoon if it is a nice day I'll get undressed again, because I can, so why the hell not?

Providing you're focussed working from home has several advantages that I can think of - I've no qualms about setting the washing machine going before I start work knowing that I can "spare" five minutes to empty it later in the day. Similarly I've no concern about ordering (even large) items, because I know what time the postman comes, and I know I'm never going to be out and miss a delivery.

When I first started working from home I had a laptop instead of a PC and there were mornings when I worked, lazily, from my bed, or from my sofa whilst watching TV. That didn't last for long because I just didn't do a good job. I think I got away with it in the sense that I don't think people noticed, but I expect if it had lasted for longer it would have been quickly apparent. I stopped because the line was blurring between "home life" and "work life".

Having a dedicated working area is essential in keeping me focussed. I don't do "home things" when I'm in "work time" - with very rare exceptions. Yes I wander around and pace if I'm thinking, yes I make more tea and coffee than I would in a real office, and yes I might open windows, phone a friend, read my gas meter, washup dishes, or similar as I'm "making coffee". But on the whole it only works if I work when I'm working.

I could save money by using my work-internet instead of paying for personal-internet, but keeping the two links separate is another way of being focussed. I don't do "dodgy" things on the internet, on the whole (haha), but if I do I'd want to be damn sure that that was via my link and not the work-link - and having two PCs and two network links I know that is the case. There have been times when the work link has broken and I've used my personal link + openvpn to continue working, or at the very least re-join our internal chatroom and say "Internet down, brb".

As a system administrator there are times when I have to do things either early in the morning, late at night, or even during a weekend. I guess a final advantage is that this is not a struggle - providing I don't schedule such operations at times when I'm in the pub, meeting friends, or taking pictures of cute strangers, it isn't a struggle to say "I'll do this after 8pm tonight", or set the alarm early. No long walk to an office, and if I've already got food cooking for my tea I can eat it nearby whilst still configuring things and testing sites/services/machines.

So pros: I'm in my own environment, I don't worry about receiving parcels, meter-readings, and have wonderfully pleasant music all day. Ancillory bonuses are really side-effects of being in my environment: I have my good coffee, my nice cups, I can eat food I enjoy. etc, etc.

Cons: You must be dedicated. You must be focussed lest you give in to temptation and cease working for minutes/hours at a time. You lose part of your home space - I can't turn this room into a childrens bedroom, for example.

Nothing earth-shattering. I've done this for five years now, and although I was a little skeptical initially I thought "Why not?" It has worked out well and I think if I ever did need to leave my current position I'd have no hesitation about working from home in the future.

Finally it has to be said that when I've had partners in my life they've traditionally been the type to wake up later than me. I get significant brownie points for being able to wake them up around 10/11AM with a cup of hot coffee & breakfast in bed every morning. By virtue of having a separate space I can close the door and not be disturbed by them walking around.

I'm sure I've forgotten things - but as an initial pass the benefits and disadvantages of working from home are the same: You're in your own house.

ObQuote: "Explorers in the further regions of experience." - HellRaiser

Syndicated 2012-05-12 08:23:29 from Steve Kemp's Blog

So I have a new bathroom

The work on my bathroom is complete. The two weeks of noise and mess were well worth it.

The old and unpleasant room is now completely different. The only issue I see is that I've managed to fill up the storage already.

I'm particularly impressed with the sink, but special mention must go to the step, and the light switch (this is touch-sensitive and apparently incapable of electrocuting me).

Rest assured that despite all the changes none of my dinosaurs are missing!

Oh well I can always mount a new shelf, or three.

ObQuote: - "Tell me of your homeworld, Usul.", Dune.

Syndicated 2012-04-25 23:05:08 from Steve Kemp's Blog

Work on my bathroom continues

Work on my bathroom continues. I had expected it to be complete on Friday but it lookse like the new completion date will be Tuesday or Wednesday.

It will be very nice to have a working shower, and a toilet I don't need to "flush" with a bucket.

The only interesting thing I've been doing is planning on a kernel to support long-term for some poor unfortunate souls who cannot use Debian-based kernels.

I know building, supporting, and maintaining a kernel will be a pain. But at the moment it looks like a valid thing to be suggesting.

Otherwise life goes on. I've been hit by the DIY bug, largely as the result of seeing all the bathroom work going on, and figuring I was going to live with dust/mess anyway - so I've erected some more book-shelves, and ordered a pair of ceiling fans.

The only other thing to report is that I've started deleting emails. (shock!)

I look after a few machines for myself, friends and so on. Each one will send me automated emails at times. I've got them going back years - but no longer:

#
#  Prune old mailboxes.
#
for maildir in .Automated.backups .machines.spotlight .machines.skx; do
   nrecent --keep=150 $HOME/Maildir/${maildir}/cur
done

Another new use for my nrecent tool. (Note: Only delete files from ./cur, to avoid deleting messages I've not read. Maildir is your friend!)

ObQuote: "I'm sorry I'm sweating on you... " - Knocked Up.

Syndicated 2012-04-22 14:27:11 from Steve Kemp's Blog

565 older entries...

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!