Adrian's Blog

[ Home | RSS 2.0 | ATOM 1.0 ]

Sat, 01 Oct 2011

Some information about South African redditors

I took a look at the data from the Who in the World is reddit survey to see what it says about South African redditors. Only 83 survey entries listed their country of residence as South Africa, compared to 409 subscribers to /r/southafrica, so this data might not provide a complete picture.

To start off, it will surprise no-one to learn that most SA redditors are men in their twenties and thirties.

Despite the “forever alone” stereotype, just about half are in a relationship.

We’re a pretty well-educated lot, with almost two-thirds having some type of degree. I’m a little curious about the one associate’s degree, since I don’t think such a thing exists in South Africa. Could be an American expat, I suppose.

Income has quite a varied distribution. The original income ranges are given in multiples of US$20 000 — for the sake of having relatively round numbers, I used an exchange rate of seven rand to the dollar.


(And yes, I know this is a bad histogram, but it seems to be impossible to get Libreoffice Calc to draw a better one.)

I didn’t draw a chart of the answers to the “favourite subreddit” question, because the answers were widely varying. The top seven were:
SubredditResponses
fffffffuuuuuuuuuuuu8
askreddit7
pics4
truereddit4
askscience3
iama3
programming3
(I counted “f7u12” responses towards fffffffuuuuuuuuuuuu.)

Finally, there are the two really serious questions. It turns out that South African redditors are mostly dog people:

But we are a divided nation when it comes to the issue of cheese:

posted at: 19:39 | path: / | permanent link to this entry

Fri, 08 Jul 2011

I'm gay

This is not a metaphor for anything. I've been pretending for far too long - I don't really know why. In retrospect, I've known for about eight years, but it's taken this long to accept it for myself; the process of telling others has been quite quick.

To those who feel that I should have told them in person, rather than on my blog or via Facebook, I apologise; this is the way that is easiest for me - I'm not good at talking about my personal life face-to-face, but I can deal with it at the keyboard. I have, of course, already told my parents, and as they have been entirely accepting (no disappointment about grandchildren (though that's possible these days, of course)).

There's not much more to say here, really. I'm very thankful to be living in a country where we have full (legal, at least) equality, and amongst a community of people who are (I hope and fully expect) OK with it. If you are not, and you feel compelled to warn me that I will burn in hell: don't bother. I am a charter member of the UCT Atheist Students' Society; if hell were to exist, I would be well on the way there already!

posted at: 11:33 | path: / | permanent link to this entry

Wed, 20 Oct 2010

Radio frequency finder

Long ago, I used to have a website which listed the frequencies on which FM radio stations are broadcast from the various radio towers in the Cape Town area. That website died some years ago, but in the past I've had a couple of emails enquiring about it.

Anyway, I recently discovered FMSCAN, which allows you to select a location anywhere in the world and find out what radio stations you should be able to pick up there, and on what frequencies. So if you need that sort of information, now you know where to get it.

posted at: 05:00 | path: / | permanent link to this entry

Tue, 19 Oct 2010

New blog

I've switched from Wordpress to the much lighter PyBlosxom, and moved my blog to the adrianfrith.com domain. In the process, I decided to drop most of the blog posts, keeping only those that might still be of some interest. Sorry if this clutters up your RSS reader with three-year-old posts.

posted at: 23:39 | path: / | permanent link to this entry

Tue, 19 May 2009

Ubuntu on an HP Compaq dx2300 Microtower

My new desktop at varsity is, as described in the title, an HP Compaq dx2300 Microtower. First thing I did when I got access to it was, of course, to install Linux - Ubuntu 8.10 in this case. It's a pretty nice machine (although not particularly high-spec) and pretty much everything worked straight away from install. The graphics card is Intel, so I'm not going to be doing any serious gameplaying (this is a work computer, anyway) but it runs Compiz pretty well. Being a desktop, suspend and hibernate aren't terribly important, but as it happens they work fine.

The only problem - and this is the main point of this post - was with the soundcard (an Intel HDA). The box has three audio outputs: headphone plugs front and back, and a tinny built-in speaker. Under Ubuntu all three outputs were switched on all the time, and it wasn't possible to adjust them separately. The purpose of headphones in a shared lab environment is entirely defeated if the built-in speaker is always on! I tried fiddling with all of the multitude of ALSA settings, but nothing worked. It couldn't have been a hardware problem, because it did the right thing under Windows.

So, the problem was narrowed down to the audio driver, snd-hda-intel to be specific. Some googling established that changing the model parameter to the module might have some effect on the output selection behaviour. Further searching established that the possible values are listed in Documentation/sound/alsa/HD-Audio-Models.txt in the kernel source. To find out what the possible values are, you have to know which codec your card uses. This you can do by running

cat /proc/asound/card0/codec#0 | grep Codec
For the dx2300 the result was Realtek ALC888. Indeed, under the list of models for the ALC888, there is one called "3stack-hp" for "HP machines with 3stack". Guessing that this was the correct one, I added to /etc/modprobe.d/alsa-base the line
options snd-hda-intel model=3stack-hp
and rebooted. Hey presto, suddenly the internal speaker switches off when headphones are plugged in.

tl;dr summary: If you have a dx2300 and you're having problems with the audio under Linux, then add the line options snd-hda-intel model=3stack-hp to the file /etc/modprobe.d/alsa-base (at least in Ubuntu; your distro might put module options in a different file).

posted at: 14:23 | path: / | permanent link to this entry

Wed, 14 Jan 2009

HSDPA modem and custom routing

So, for my Christmas present to myself I got a Huawei E220 HSDPA modem - it's one of the Vodafone-branded ones, but I reflashed it with the generic firmware. Anyway, it's an awesome thing to have for a geek like me - I can be connected to the Internet at broadband speeds almost anywhere in the city. It's particularly useful when i'm on campus, so I can avoid the dog-slow UCT internet connection.

Problem is, I'd like to stay connected to the UCT network as well so that I don't use up my precious* data bundle for UCT services, and this requires a bit of custom routing magic. So I have a script:

#!/bin/sh
GATEWAY=137.158.32.97
route add -net 137.158.0.0/16 gw $GATEWAY
route add -net 196.24.192.0/24 gw $GATEWAY
route del default
route add default ppp0

137.158.0.0/16 and 196.24.192.0/24 are the UCT netblocks, and 137.158.32.97 is the router on the subnet that I'm mostly using at the moment. ppp0 is, of course, the name of the interface associated with the HSDPA connection.

The problems with this script currently are that I have to edit it to change the gateway for each subnet that I'm on, that I have to run it manually each time I connect, and that it doesn't restore the original routing when I disconnect. The first and third problems should be reasonably easy to solve, but the second will probably require that I dig into the mysterious world of NetworkManager. (Cue dramatic music.)

*It's ourssss, my preciousss... they wants to take it from us, the nasssty Vodacom...

Update: On the old blog, Simeon from ICTS pointed out to me that I was using the wrong IP ranges for UCT, so I've fixed that. He also pointed out that simultaneously connecting a host to the UCT LAN and directly to the internet is forbidden by university policy.

posted at: 01:40 | path: / | permanent link to this entry

Mon, 01 Sep 2008

Only in Cape Town...

...are trains cancelled due to rough seas.

Rough Seas
(Taken from the Cape Metrorail Traffic Report.)

For those of you not familiar with the Simon's Town line, this is actually entirely reasonable. In places, the railway line runs right next to the beach; with a spring tide and a heavy storm surge, the sea can wash right over the tracks.

posted at: 21:14 | path: / | permanent link to this entry

Tue, 27 May 2008

A "poster" to drive any... "English Teacher" MAD

Rondebosch Village Shopping Centre is in the process of building a new parking deck to double their parking capacity. As a result, the Rondebosch Pick 'n Pay has put up several copies of this sign:

Pick n Pay
(click for full size)

posted at: 02:41 | path: / | permanent link to this entry

Thu, 06 Dec 2007

XRandR - finally, simple monitor configuration for Linux

The most recent Linux distribution releases - Ubuntu 7.10, Fedora 8 and so on - are now shipping with version 1.2 of the XRandR extension for the X server. This allows the user to dynamically change resolutions, refresh rates, and - this is the really impressive thing - switch monitors on and off on the fly. All of this, without ever having to edit xorg.conf, or restart the X server, or reboot. This was one of the major things that the Linux desktop lacked compared to other major operating systems.

Until very recently, using my external monitor with my laptop required several irritating customisations.

  1. To have it switch on, and run in Xinerama mode along with my laptop panel, required fiddling with MetaModes and other fiddly settings of the radeon driver.
  2. To drive it at its native resoution (1440x900) i had to add a custom modeline to xorg.conf (except on Fedora, for some reason).
  3. If the X server originally started without the external monitor attached, then it would have to be restarted to detect the monitor once it was attached. And restarting X means having to log out and lose all my application state.
XRandR 1.2 has removed all three of these irritations. It requires (almost) no preconfiguration, autodetects all resolutions correctly, and detects monitors when they are plugged in without a restart. Let's take a brief look at some of what XRandR can do: this is basically what I do with it daily. Note that at the moment graphical tools to control XRandR are still under development and none are really at a releaseable state (in my opinion); but now that the infrastructure exists in the X server and the drivers, tools to control it will come soon. What I use here is the command-line tool, sensibly named xrandr. Let's say I boot the computer without the external monitor plugged in. As you would expect, my desktop is automatically set to the native resolution of the laptop panel (in my case, 1024x768). I can see what resolutions and refresh rates are available:
$ xrandr -q
Screen 0: minimum 320 x 200, current 1024 x 768, maximum 2464 x 1024
VGA-0 disconnected (normal left inverted right x axis y axis)
DVI-0 disconnected (normal left inverted right x axis y axis)
LVDS connected 1024x768+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
   1024x768       60.0*+   60.0  
   800x600        60.3  
   640x480        59.9  
S-video disconnected (normal left inverted right x axis y axis)
This tells me that the only attached monitor is the laptop panel (called LVDS); that it can run at the three different resolutions listed, and at the refresh rates listed next to the resolutions. The "*" indicates the mode that is currently in use, and the "+" indicates which mode is preferred by the monitor. If i wanted to, I could switch to some other resolution:
$ xrandr --output LVDS --mode 800x600
But that looks horrible, so I switch back to the preferred resolution:
$ xrandr --output LVDS --auto
Now everything's back to normal. There are various rotation and reflection options as well, but I won't discuss them because (a) they're silly, and (b) you can look them up in the man page if you need them. Here comes the interesting part. Now I plug in my external monitor. Nothing happens immediately; but if I run the query command, there's some new information:
$ xrandr -q
Screen 0: minimum 320 x 200, current 1024 x 768, maximum 2464 x 1024
VGA-0 connected (normal left inverted right x axis y axis)
   1440x900       59.9 +   75.0     59.9  
   1280x1024      75.0     59.9  
   1280x960       74.9  
   1360x765       59.8  
   1152x864       74.8     60.0  
   1024x768       75.1     70.1     65.7     60.0  
   832x624        74.6  
   800x600        72.2     75.0     60.3     56.2  
   640x480        75.0     72.8     66.7     60.0  
   720x400        70.1  
DVI-0 disconnected (normal left inverted right x axis y axis)
LVDS connected 1024x768+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
   1024x768       60.0*+   60.0  
   800x600        60.3  
   640x480        59.9  
S-video disconnected (normal left inverted right x axis y axis)
So I can now see all the modes supported by the external monitor (called VGA-0). I switch the monitor on:
$ xrandr --output VGA-0 --auto
This switches on the monitor in a sort-of clone mode: the output from the laptop panel is duplicated on the external monitor; but because the external monitor is larger, it appears in the top left, and the desktop size expands to the size of the external monitor. (At the moment, GNOME doesn't handle this too well, and the GNOME panel stays in the same place, meaning that it's in the middle of what's visible on the external monitor.) So now I can switch off the laptop panel:
$ xrandr --output LVDS --off
(GNOME handles this correctly and moves the panel.) Now, if you look at the query output above, you'll see that the monitor claims that its preferred mode has a refresh rate of 59.9Hz, although it also supports a 75Hz mode at the same resolution. I find the latter mode more friendly on my eyes, so I switch to it:
$ xrandr --output VGA-0 --mode 1440x900 --rate 75.0
I want to use the extra desktop space available on my laptop panel; but by default it would just be cloning the output of the external monitor, which wouldn't help. So I use another option to position the outputs:
$ xrandr --output LVDS --auto --left-of VGA-0
This places the panel to the left of the external monitor. There are corresponding --right-of, --above and --below options. Finally, I want to switch off the external monitor so that I can take my laptop away from the desk:
$ xrandr --output VGA-0 --off
Now I'm back where I started. This is all very cool, but there are a couple of cautionary notes. The necessary drivers are only included in very recent distro releases (Ubuntu 7.10 and Fedora 8 in particular). Currently only the open-source Intel, Radeon and NV drivers support XRandR 1.2; neither the ATi nor the NVIDIA proprietary drivers support it. For now, you pretty much have to use the command-line tool - though that will change quickly. Finally, you sometimes have to set the Virtual option in xorg.conf to indicate the largest possible size of your desktop - but this is a one-off setting, and I hope that distros will start setting it to a sensible default automatically.

posted at: 04:05 | path: / | permanent link to this entry

Powered by PyBlosxom