Archive for the ‘Geek’ Category

(on Technorati , Del.icio.us)

Script: Wireless Strength Polling/Logging/Graphing

Initially, I wrote this script to give me frequent feedback on the signal strength. This is useful when adjusting antennas to that sweet spot that give stronger signals; especially if you’re testing some homemade tinfoil parabolic reflectors! 😉 If you have a portable wireless device, like a netbook, you can ssh into your (wireless) desktop and run wireless-strength to get realtime feedback on adjustments to the access point’s antenna… assuming the connection doesn’t break. 😛 And, of course, you can just walk around running it on your mobile device to create a kind of wireless heatmap.

If you have gnuplot, you can also generate graphs from the data with ws-plot. This is me walking around my house with my notebook:

I started in my room (40% 🙁 ), which is where the first peak is – near the window. Left my room, back to 40%, peak near window again, then bathroom… 40%. The climb from 40-80% is me walking towards the TV room (PS3 lives in a solid 80% zone, at least!). Walked upstairs, got 100% in most areas (that’s where the Access Point is) – tried a bedroom, dropped to 40%.

Download the scripts and get more details here: https://github.com/izm/wireless-strength

Nerdy Ramblings

This script originated years back, but I recently tried using it on my laptop and it didn’t work! Unacceptable! The original parsed the output of iwconfig. But what showed up as “Quality=30/70” on my desktop, would show up as “Quality:4” on my laptop. COMPLETELY DIFFERENT. Even the character after “Quality” was different! o.O The output of iwconfig is driver dependent, which is why I looked to network-manager. I figured there’s probably a nice dbus command I can send to network-manager for that purpose – but I got tired of looking and decided to just parse output again. :/ Luckily, network-manager includes nm-tool. It’s certainly not a clean solution, but it works for now.

I also used updating rewriting the script as an excuse to get better acquainted with git – which I’m really liking.

Every time I do a bash script, I vow to do the next script in Python. I like Python and I don’t like Bash… but there’s a certain… nativeness or dependency-free elegance to bash scripts. Still, I hate writing them, and the next script’s in Python! 😛

Theme updates

Made some adjustments to my blog theme.

Old

New

  • search box graphic and placeholder text
  • added jetpack subscriptions module and some css to handle it
  • gave page a max width so it doesn’t look ridiculous on wide screen monitors.
  • sidebar: removed dotted borders added white space, toned down colours – reduced noise
  • Removed grey post-meta-content (categories, tags) boxes. Put all post meta data in TOP, with comments repeated at bottom. (Similar to when I started this theme!)
  • Added hover highlight to gallery images (now consistent with image links not in a gallery). Cleaned up some of the code (to not generate HTML comments) and random fixes here and there.
  • Removed lots of black. Too harsh.

You might have to click refresh. And you might not even notice any changes. 😛

Feel free to leave a comment or use Markup to make suggestions. Markup’s a pretty cool tool.

It’s interesting to compare the progression of my themes. Well, interesting for me, at least. 🙂

I think the next time I decide to work on a theme, I will start from scratch. Clean slate. Make it more consistent with my root page.

On a related note, the latest version of WordPress, 3.3.2, is really nice.

Gedit 3.2 GDP Completions on Ubuntu 11.10 Oneiric Ocelot

Curiosity gets the best of me sometimes. Okay, most of the time. Did you know GNOME’s text editor, gedit, has a plethora of extensions which can basically transform it into an IDE? Something I’ve always wanted is intellisense-style autocompletion. The closest thing I’ve found for gedit is GDP Completions Plugin in the gedit-developer-plugins package in Ubuntu.

sudo aptitude install gedit-developer-plugins

However, there’s a bug in that package and the popup menu doesn’t actually work. Ctrl + Space is supposed to bring it up. So you want to add the Gedit Developer Plugins PPA and upgrade to the more recent version.

sudo add-apt-repository ppa:user/ppa-name
sudo apt-get update
sudo apt-get upgrade gedit-developer-plugins

If you try to run gedit now, you’ll notice it won’t… run, that is. Great. I know, right? The problem is that the bzr plugin (also included in the gedit-developer-plugins package) is trying to use the gtk2 version of bzr-gtk, but that doesn’t work in the gtk3 gedit. Anyway, you can pull a copy of the gtk3 bazaar plugin into your local bzr plugins directory. (I found this info here). Create ~/.bazaar/plugins/ if it doesn’t exist.

mkdir ~/.bazaar/plugins
cd ~/.bazaar/plugins
bzr branch lp:bzr-gtk/gtk3 gtk

The gedit-developer-plugins package and gedit should work after that! An alternative to the above would be to add a PPA that includes bzr-gtk 3. Not sure if one exists at the moment, but that would be a cleaner solution. And you thought it would be simple. I know I did. 😛

It’s not as polished or featured as other implementations, but it’s a good start. Here’s a screenshot after I type os. then hit Ctrl + Space:

Further reading

External tools plugin

Rolling your own gedit 3 plugin

GNOME 3.0 Beta v0.0.6 Impressions

GNOME 3.0 is due for release April 16 and I’m pretty excited by it. So I finally decided to check out first-hand how it’s progressing. My perspective is that of a GNOME 2.X user, but like many people, I was a little skeptical of the changes in 3.0. I tried the 0.0.6 image from the GNOME3 website and ran it off the USB key.

The Good

  • It’s pretty. And minimal. Love the new font.
  • High quality and scalable graphics and interface – tried it on both a 10″ netbook and a 23″ monitor with success. Large title bars and close buttons – easy to hit.
  • All the updated core GNOME programs! I especially like the progress with Nautilus, the file manager. Instead of using a status bar, it uses a floating alt-type yellow info box to display info. Plus it seems much faster.
  • Single stroke exposé-like effect that reveals all windows, scaled and tiled. This is bound to the Windows (Super) key, which actually makes it more appropriately named for GNOME3 than any version of Windows. Note: It can also be reached by clicking Activities in the top-left corner. From here, you can use your mouse to switch to a window or quickly close windows, launch/switch-to a program from the left sidebar, or you can start typing a substring of a program to run, or a string to search using wikipedia or google (these options appear after you type something… OR you can browse applications by clicking Applications. Additionally, on the right, you can manage workspaces. With the smart launcher and window manager functionality tied to a single key, I found myself actually starting to heart the windows key and its prime keyboard real estate.

  • Don’t worry, you can still alt-tab! 🙂 And it’s improved, with mouse input, and grouping instances of the same program.

  • Integrated chat with notifications is great.
  • Modal windows are now attached to their parent window (by default, this can be changed).
  • Slick animations with meaning. Like the modal windows that slide out of the parent window’s title bar. I think OSX does something like this….
  • Yelp, the Help browser is about a billion times faster. Seriously. This is largely due to the shift from gecko to webkit, I believe.
  • No more minimize/maximize buttons. At first, I wasn’t sure about this and thought I wouldn’t like it, but the way the new desktop is designed, I don’t miss them. You can add them back, if it’s a concern. And all the old window shortcuts still work: [Alt+F9] = Minimize; both [Alt+F10] and [double-click title bar] = Toggle Maximize; [Alt+right-mouse-button] = window menu.

  • GNOME is just much leaner than it has ever been before. Instead of starting 3 different programs at login (nautilus, gnome-panel, metacity), it simply starts gnome-shell.

The Bad

  • Requires 3D support. Unfortunately, this is not always a simple request for us Linux users. Tried it on my netbook and failed. Couldn’t run it and probably never will thanks to the terribly supported poulsbo integrated graphics.
  • And not just any 3D support… Tried it on my desktop, also with integrated graphics, but a better supported ATI x1250 – performance wasn’t stellar, but it was usable.
  • Not very mature and not very customizable (yet). Panel Applets in prior versions of GNOME are extremely popular. Now we have this huge piece of space we can’t do anything with. But I’m sure something like panel applets will come eventually.
  • It’s really hard to train myself to look to the middle of the top panel for the time/date… I keep looking at the top-right. 😛
  • Some of the changes had me fishing for functionality. Like, where is the control-center? It’s not in the Applications list under the Activities window. It’s under the user menu, under System Settings.

    And once you’re in the System Settings, you often want to change many things. At first, I was opening System Settings, selecting a component (they’re called Panels) to adjust (Background, for example), making changes, closing, repeat. When you open a panel from the System Settings window, that panel replaces the contents of the System Settings window. I didn’t notice the All Settings button that replaced the search entry in the dark grey area! After realizing that, it wasn’t so bad. 🙂 And to be honest, I think the theme or something is not quite finished. Looking at other screenshots on the web, the button is much more noticable.

The Ugly

  • BIG change in the way it expects people to use it. This will likely cause lots of frustration.
  • Doesn’t quite seem ready for prime time. I guess that makes sense, it’s still beta.
  • Some odd input lag every now and then. Visual artifacts. For both of these, I point my finger at my integrated graphics. Just a general lack of polish. But that’s to be expected with alpha/beta software.
  • Bold, black window titles with same-colour shadow. Ugh… I expect that will change soon. 🙂

After trying Shell, I’m actually more excited for it. It still lacks polish in areas, which is expected at this point, but I love the direction GNOME3 is taking GNOME. I’m hoping I can get by on my integrated graphics, but I’m probably willing to purchase a low-end video card to get better performance. Anyway, I’m really interested to see how Canonical’s Unity and GNOME Shell will evolve side by side. Now I have to try Unity, I guess….

DIY Wireless Booster

To access the Internet on my desktop computer, I must use wireless. Unfortunately, it’s about as far away from the access point as possible: opposite corners of the house and different floors. And the wireless card I’ve got in my desktop is a little old and pretty cheap. Basically, I’ve had to battle with a poor connection for years. Often, I would have to manually move the antenna an inch this way or that, try reconnecting, and repeat. I vented to my friend, Shirley, about my connection, and she said her friend was having similar issues, so Shirley recommended she make a signal booster. That’s something I’d been thinking about doing, and thought it was about time. I googled how to make a booster. Enter the Parabolic Reflector available here. I’m sure there are lots others, but this is the one I decided to try out.

Desktop antenna with booster

I made 3 of them. the first was made entirely with paper and tinfoil and it worked fine, but I figured I would try making a couple more with different materials: 2 different strengths of card. It’s good I did that too, as I ended up using 2 of them and giving the paper prototype to Shirley’s friend who most likely has better things to do than build paper parabolas. 🙂 (I, on the other hand, do not.)

Gluestick?  Check.  Scissors?  Check.

Access point hidden away, with booster pointed down slightly (towards my room)

What does it do? It turns your omni-directional antenna into a directional antenna with a stronger signal. The tinfoil does the radio wave reflecting and the shape (the parabola) just happens to be an efficient way to do that. Using this new direction, I’ve “pointed” the antenna on my wireless router towards my room – even on a bit of an angle through the floor. In my room, on my desktop PC, I’ve just pointed it horizontally in the direction of the access point.

Wireless signal strength over a few days

The results have been great. Without any home-made boosters, I received 25-35%, with one on the access point, i received 35-55%, and with one on both the access point and my desktop antennas, I’m receiving a pretty steady 62-68% (see the graph, above). I still receive disconnects, but it’s now much easier to reconnect… usually happens automatically on the first try – I don’t even have to do anything!

So if you’re having wireless issues, give it a shot! It certainly doesn’t cost much. 🙂

Canadian Income Tax 2009

If you have any trouble understanding how income tax works or is calculated, play around on this webpage and see if it helps you. (It probably won’t, but you might have fun not learning anything!) It lets you dynamically compare different income taxes within Canada using a pretty graph and it lets you calculate your own (simplified) tax results, whether your income is salary or hourly based.

canitax

Why Did I do this?

I didn’t do my taxes; an accountant did. But when I was reading about them, I stumbled upon a couple webpages and became interested in the differences among the provinces and territories within Canada and
different income ranges. That’s what started this mini Javascript project.

This is not a work of art

I wrote it mostly on the bus using my recently acquired Dell Mini 12 netbook (on Windows XP… ew). And from that experience, I can firmly say that writing even very simple things, it’s good to have a fair amount of time set aside in a relaxed environment. I would write a couple things here and there for 20 minutes or so… then not look at it again for a few days… it took me 5 minutes to figure out what I wanted to do the next time I opened it. The only times I made significant progress was when I sat down for more than an hour. The code wasn’t really designed, it was just… written. It’s messy, there’s lots of hard-coding, poorly named fields and variables (didn’t help with figuring out what I was doing last time), and if it were anything serious, I’d rewrite large chunks of it. And make it prettier. But as it stands, it’s just kinda fun. 🙂

In addition to being curious about the taxes in Canada, I was also interested in trying a javascript graphing library. I had been impressed with different javascript-generated graphs on the web and wondered how difficult they were to create. I used FLOT (with lots of copying and pasting from examples), and it seemed to work alright, but it depends on JQuery, which I wasn’t familiar with. Actually, I’m still not very familiar with it… and wrote almost everything in regular javascript. I know it’s worth learning, but I guess I’ll save
that for another time. 🙂

Let me know of any errors in tax calculation.. or code design, for that matter. There’s lots of those, but I’m sure I’m not aware of all of them! hah.

(I’ve been sitting on this post for about 2 months now. hah! Figured I might as well publish it.)

File List Applet – now with more autotools!

I decided that before I did any more work on the applet, I would improve its installation process to make it easier for people to try it out. So, the process to get and build the source now looks like this:

Download

  • Browse source here.
  • Download the source: bzr branch http://stevenbrown.ca/src/FileListApplet

Install

  1. Install dependencies (Ubuntu package names given): sudo apt-get install python-xdg python-gnome2-desktop python-gtk2 python-pyinotify
  2. Branch the source using the bzr command, above.
  3. cd into the directory.
  4. ./configure --prefix=/usr (the prefix is important!)
  5. make
  6. sudo make install
  7. If the applet does not show up in your Add to Panel menu, try restarting the bonobo-activation-server: killall bonobo-activation-server.

Autotools

Autotools is pretty much the standard in source package management on linux. Except for the name, there is nothing automatic about autotools. Every encounter I’ve had with autotools has usually defeated me and left me frustrated and leaving whatever I was working on to do something else. For me, because I had labeled it the next step, it basically stalled the entire project for a while. Most people tend to copy and paste other projects’ autotools setup, but I figured that was overkill for my purposes and I didn’t find anything that quite suited me. I looked at gnome-blog, but it seemed like some stuff wasn’t quite working properly and some was completely unnecessary… in fact, this seemed to be a trend when looking at the autotools stuff in projects. Why is this? Autotools is not simple and due to this simple fact, I think it fails completely on many levels. Developers massage it enough to get it working, but few actually understand it all – I know I sure don’t! So please forgive the sloppiness and feel free to send patches. 🙂 I gave up doing a couple things, like getting the revision number (bzr revno) and including it in the version string (see configure.ac). I know it’s probably something super simple, but I couldn’t seem to pass a variable containing a string as the version….

I feel that GNOME, as a platform for development, could seriously benefit from some kind of frontend to autotools that handled GNOME development nicely and hid as much as possible from the developer (including all those nasty config files that pollute the package tree). Anyway, I did not have an enjoyable time grappling with autotools, but I’ll end this mini-rant here.

Laptop’s New Life

My laptop has had its fair share of problems, mostly because it’s aging; I bought it nearly 6 years ago!! I’m actually impressed it’s aged so well! A few days ago, the display started to flicker with increasing frequency and become distorted shortly after turning it on. Here’s a video showing the problem: (Warning: contains a little bad language – woops…)

(Link to video here if embedded object doesn’t show up.)

Last night, I took it apart and tried wiggling every LCD-related wire I could find, hoping to affect the display’s output and conclude it was a fixable loose connection.

Laptop in Pieces

Nope. Fine. Who needs a screen anyway?

Screenless Laptop

I now have a very compact desktop – it even includes wireless, keyboard, mouse and speakers! It just needs a monitor. I haven’t decided whether I will make it a pseudo media PC to stream things from my desktop to the TV (a little work), or just to have it replace the family computer (almost no work!). The family usually gets my computer hand-me-downs. 🙂

Anyway, looks like I’ll need a new laptop sometime soon. I vowed to go smaller with my next laptop, but I’m not sure if a netbook would suffice. Of course, I would like it to run Linux (Ubuntu?), have long battery life, reasonable storage, support WPA2, have a built-in 1.3MP camera, and all that good stuff. Bluetooth would be nice, too. Let me know if you have any suggestions.

Reading – XP and Design Patterns

I got a few books out from the library, recently, which I’ve been reading on the bus. I’m currently alternating between Extreme Programming Explained: Embrace Change and The Joy of Patterns: Using Patterns for Enterprise Development. I wish I had read the XP book before being project manager for my Software Engineering project at University, a couple years ago. But perhaps having gone through that experience allows me to relate to the material more directly. It’s easy to read and the author, Kent Beck (one of the fathers of XP), identifies the reasons behind the development methodology, and the problems they help solve. I’ve always had this feeling of agreement with XP practices, many of which seem like common sense, but haven’t always been able to articulate the reasons. Thankfully, the author does not have this problem. 🙂 I’m about 50 pages in, and it’s quite good, so far.

I picked up the Design Patterns book because the one I wanted, Design Patterns: Elements of Reusable Object-Oriented Software, wasn’t there. (The library has 3 copies of it, but it’s always out with a wait-list of people requesting it. This list now includes me. 🙂 ) Anyway, the one I picked up is extremely terse. There are UML diagrams provided, sample code, and a problem description… but not much in way of explanation. It’s format is kind of like this: there’s this problem, how do we address it? Boom, here’s a pattern. Boom, here’s a diagram. Done. Next. Or… but we could improve on this pattern with this other pattern. Boom, another diagram. Why? Figure it out.

This book is fine if you’ve been exposed to the patterns previously, and need a refresher, but it is not a good source to learn from. I’m familiar with some of the patterns, but even then, they may be called something different, or implemented slightly different, and it’s been a while, so it takes me longer to understand than if there was more explanation. Looking forward to picking up the other patterns book. If you have not been exposed to design patterns before, or are a relative beginner programmer, and definitely if you are not familiar with UML diagrams, avoid this book. It’s a book on design patterns (not a simple topic) that’s less than 200 pages, so you can’t really expect a thorough resource. I’m about half way through it. On one hand, I’m curious what such a small book has to offer, but on the other, I’m not sure I’ll finish it. I’ll probably concentrate on the XP book, for now.

2008 In Review

Life

This year has been pretty big. Naturally following up with lots of events from last year, these are some quick memories. My nephew, Rayden, was born on Feb 12th, six weeks early! This caused the father (my brother) to be indisposed for my dad’s (2nd) marriage on Feb 14th. I got bumped up to best man (but didn’t have to do much) and had a rather empty hotel room to myself in Vegas. I attended the Open Web Vancouver conference. I went to Whistler mountain for the first time in years and plan on going again soon. I went on a fantastic road trip down the west coast of the United States, something I will never forget. I slacked off most of the summer but managed to do quite a bit of rollerblading and outdoor activity hanging out with Kurt (visiting from Brazil). My brother, now a father, married the mother of his child on August 3rd. I was best man at this wedding, as well – with more responsibilities, but they were well received and totally worth it. Our beloved cat, Sky, met an early and terribly unfortunate end. We had our first encounter with bed bugs who are now the sworn enemy of our household. Vancouver, a city that sometimes doesn’t get snow all year, had its whitest Christmas ever with 60cm (2 ft) of snow! Perhaps we should have seen snow in April as a sign….?

That reminds me: Happy Holidays for 2008! Guess I was a little late on that… Here are some pictures of our insane weather in Vancouver.

Geekery

With my free time, I think I was able to really exercise my geekiness in 2008. I released a couple updates to the Rhythmbox Jump-to-Playing plugin, which led me to submit my first patch to an upstream project! Said patch was accepted and will be in the next version of Rhythmbox! Yay. 🙂 It was just for some XML UI description, but it feels nice to have helped improve (even a tiny bit) a project that will be installed on thousands of computers in the next cycle. I also released a usable proof-of-concept GNOME Panel File List Applet which has stayed on my panel and I find quite useful. And I’ve done a couple little scripts and how-to’s that fall under the “nerd” category quite nicely. Oh yeah, and significant website updates. Next website todo item is to customize the attachment page for my theme, I think…. Also, I joined Twitter. And Identi.ca. And LinkedIn….

Art

Not many artsy things done this year. But with the significant improvements of tablet handling in Linux, I did some random doodles and a birthday card. I may not do it very often, but I still enjoy drawing, thank goodness.

Blog Stats for 2008

My Blog is by no means high traffic, but stats are fun! (These stats were obtained using the wordpress.com Stats plugin, and exclude the Feed stats, because I use Feedburner for that… although, I’m thinking I should revert that, now that I mostly use wordpress.com Stats.)

Top 3 Referrers:

  1. http://live.gnome.org/RhythmboxPlugins/ThirdParty (402)
  2. live.gnome.org/Boston2008/GUIHackfest (209)
  3. siuyee.com (126)

Top 3 Posts and Pages:

  1. Pidgin 2.1 UI Ideas (1,053)
  2. 2D Game Art and the Virtual Console (580)
  3. Rhythmbox Plugin: Jump to Playing 0.2 (455)

Top 3 Search Engine Terms:

  1. rhythmbox (327)
  2. bug (174)
  3. pidgin (165)

Top 3 Clicks:

  1. Pidgin UI screenshot attached to a bug (57)
  2. Pidgin UI mockup (50) by Hylke Bons
  3. SF2 HD Ken (42)
  4. The fourth was launchpad.net/desktopdrawers with 38 clicks, so it’s kinda cool I helped advertise a small project a little. (A project I’ve submitted patches to, no less. 🙂 )

Thanks

Thank you, everyone, for a wonderful 2008. It’s been interesting, and despite a failing economy, I’m looking positively toward 2009.

Happy New Year! (????????????????) 🙂