logo

ShrimpWorks

// why am I so n00b?

This is a small follow-on on from the Kodi on Debian Sid guide I did earlier this year to get lirc (IR remote support) working once more, following an upgrade to version 0.9.4, which changes how the lirc services and configuration work (shakes fist at systemd).

After upgrading and following all the instructions in /usr/share/doc/lirc/README.Debian.gz, I was left with the problem of Kodi not responding to any remote input at all.

Firstly, I had to re-source my remote’s configuration (mceusb) from the lirc git repository. Place the *.lircd.conf file from there into /etc/lirc/lircd.conf.d/ and remove/rename other .lircd.conf files already in that directory.

Now, running irw and pressing some buttons on your remote should show you the button pressed and the configuration used.

Next up, Kodi fails to connect to the IR device. There are two trivial but non-obvious solutions:

Firstly, without changing any of the default configuration generated by the migration process outlined in the lirc README file, simply change your Kodi starup command as follows:

$ kodi --lircdev /var/run/lirc/lircd

Alternatively, you may change the lirc configuration, to put the device file back where Kodi expects it:

# in /etc/lirc/lirc_options.conf:
output = /dev/lircd

Then end result should be you happily continuing with your life.

I recently went through the process of reinstalling the media PC connected to my TV, which I use to run Kodi for movies and TV, and Steam in Big Picture mode, which allows me to stream Windows-only games from my desktop to the couch.

I thought it would be useful to describe my setup and the process to achieve it, in case anyone else is interested in creating their own custom Kodi/Debian/Steam builds.

arrow Continue Reading ...

Recently, I’ve made the switch from KDE being my preferred Linux desktop environment/window manager, to i3, a tiling window manager, for both my work and private development environments (my home desktop is still Windows 7, since I do still game enough for it to become painful to dual-boot - so I do most of my development within a VM these days).

I really like it’s absolutely minimal approach - essentially it does nothing itself, it provides a simple window manager, and near limitless configurability. This has proven an excellent learning experience for me, since it’s forced me to get a lot closer to system components usually “hidden” behind sliders and widgets in KDE or Gnome, as well as a host of alternatives to applications those environments provide by default. It’s also resulted in a much cleaner and faster system, containing only the applications and services I actually want.

We recently installed fresh new desktop machines at work, so I thought I’d share some of my setup, in case it’s of some value to anyone else (and my own future reference!). The following steps assume you know how to operate a basic Debian system. I’m not going to go too deep into any usage details for i3 either, since there’s an excellent user guide and comprehensive FAQ system which should answer any questions you may have.

I’d also advocate using “aptitude” as an alternative to “apt-get” for all package installations, updates and removals.

The Basics

I always start off with a Debian “netinst”. Post-install, this provides an incredibly basic bare-bones OS with a few system utilities (during the installation, de-select the pre-configured “Desktop”, “Web Server”, “Mail Server”, etc. options, just keep the “Standard System Utilities”).

First thing to to after installing is install sudo and add your user to the sudoers group, to avoid having to be root to get things done. Now’s also a good time to install vim.

I also like seeing Aptitude’s “visual preview” of changes when doing package management, so to avoid having to call $ aptitude --visual-preview install ... on every invocation, we can edit root’s aptitude config:

/root/.aptitude/config:

Aptitude::CmdLine::Visual-Preview "true";

Upgrade to Unstable/Sid

Perhaps a bit reckless, but I’ve honestly never experienced any crippling issues running Debian Unstable (“sid”). You’ll only need to modify /etc/apt/source.list and replace references to “wheezy” or “testing” with “unstable” or “sid”, and disable the updates and security repositories, leaving you only the main deb and deb-src repositories (I’ve enabled non-free and contrib, since I want to install FlashPlayer and nVidia drivers later):

/etc/apt/source.list:

deb http://cdn.debian.net/debian/ unstable main non-free contrib
deb-src http://cdn.debian.net/debian/ unstable main non-free contrib

After saving the above changes, execute the following:

$ sudo aptitude update
$ sudo aptitude dist-upgrade

The dist-upgrade step will upgrade all installed packages to whatever’s newest in unstable.

Desktop Install

With the base system as up-to-date as it can be, it’s time to install the desktop environment.

$ sudo aptitude install xorg lightdm i3-wm i3status suckless-tools

After installation, I’d reboot and ensure a nice graphical login prompt appears. After login, you’ll be asked some initial i3 setup questions (which are easy to change later) and land in the default i3 workspace. Press Mod+Enter (Mod being whatever you selected in the aforementioned setup questions - likely “windows” key, or Ctrl) to open a new terminal window. It’s probably xterm, which is sort of OK, but I switched to lxtermial - it’s nice and lightweight but still has a fair number of configuration and convenience features (like URL detection - useful for IRC).

If you install another terminal, and opening more terminals results in more xterms rather than your installed terminal, do the following to set your preferred option:

$ sudo update-alternatives --config x-terminal-emulator

Desktop Tweaks

Before digging too deep into installing additional software, it’s a good time to configure some additional options to make life a bit more pleasant.

Look and Feel

In order to make sure your eyes are not offended by the default GTK theme which you may end up seeing a lot of, set up the GTK theme and icon theme:

~/.gtkrc-2.0:

include "/usr/share/themes/Adwaita/gtk-2.0/gtkrc"
gtk-icon-theme-name="Adwaita"

In addition, I found it a lot cleaner and space-maximising to disable i3’s window titles and thin it’s borders down, by addition the following to ~/i3/config:

new_window 1pixel
new_float normal

py3status

Install python-pip via Aptitude, and then $ sudo pip install py3status. I use py3status since it provides some nice additional modules, is more flexible, and is fully compatible with the default i3status configuration. It’s also a good time to check out the i3status configuration documentation and do some tweaks, since a couple of the default entries here are likely not too useful.

Wallpaper

Randomised (of fixed if preferred) wallpapers can easily be achieved by installing feh (which makes for a good i3-friendly picture viewer in general) then adding the following to ~/i3/config:

exec --no-startup-id feh --recursive --randomize --bg-fill ~/Pictures/wallpaper/

Incidentally, the imgur wallpaper gallery is a good place to find some wallpapers.

File Management

Sometimes a GUI file manager can be useful, and for this, a nice light-weight alternative to the bigger desktops’ Nautilus and Dolphins is PCManFM, installed as pcmanfm.

A nice companion application for (compressed) archive management is xarchiver. You may need to install additional tools (such as zip, unzip, unrar-free, etc, depending on the files you commonly work with).

Conclusion

The entire setup to this point should not have taken more than 1-2 hours, depending on download speeds (really, most time is spent just waiting for downloads…), so you can get this kind of environment running with minimal effort and downtime.

I haven’t included anything about multimedia, custom key bindings, lock screens, or others here, but there are loads of other resources around which can fill you in on those and the myriad ways you can configure your i3 environment.

Your next step, if you’re new to i3, should probably be to take a read through the i3 user guide, which is impressively comprehensive.

I wanted to add a unit conversion plugin to ZOMB and would really have liked to use an off-the-shelf existing API, but because this didn’t seem to exist in a nice hosted format already - I had to make it :).

The Units API is written in PHP, and is intended to provide an extremely simple and easy-to-use HTTP API for the conversion between various units of measure. Usage documentation is available on the project’s Github page.

I’m also hosting a publicly usable version, at the following URL, so hopefully next time someone needs this they don’t need to reinvent the wheel (again, refer to documentation linked above for usage):

As an aside, this project served as my first introduction to PHPUnit for PHP unit testing, and CI is once again provided by Drone.io which has performed admirably. Design-wise, it was another exercise in defining the public-facing API before a line of code was written, which served as an excellent guide and source of documentation as I worked on it (plus, there’s no need to worry about writing documentation when you’re done :D).

zomb-web

As mentioned, I’ve resurrected an old idea, and began work on it as a bit of a learning/practice exercise. I think it’s working out rather well.

The primary application itself, hosted on GitHub here, is essentially complete, barring the ability to persist your plugin configuration (pfft, who needs to store things anyway).

Some stuff learned along the way:

API-driven development:

Designing the external-facing API (actually defining and completely documenting the exact request and response data structures, not just “there will be a request that does things and a response that looks something like X”) was a huge help. Defining the API allows you to see how the system will actually be used up-front before writing a single line of code, and allows you to easily spot gaps and shortcomings. Once done, the “user documentation” becomes the same documentation I used to implement the back-end, which made it incredibly easy.

Git:

Still learning, getting more comfortable with it. IntelliJ IDEA has excellent built-in Git support out-the-box, and although painful to use in a Windows shell (it’s basically Bash, inside cmd.exe), I’m getting more used to the Git CLI.

Free/online continuous integration:

Initially, I started off using Travis-CI. This requires you to store a “.travis.yml” file within the root of your Git repository which I was rather uncomfortable with (I don’t like “external” metadata type things hanging around in my source repository). As an alternative, I’ve switched to using Drone.io, which just “feels” like a nicer solution. It also has additional features like the ability to store artefacts for download, or publish your artefacts to external services or servers - so you could have successful builds automatically deploy the latest binaries.

Persistence/Storage:

Persistence is hard, so once you start a service up, it should run indefinitely so you never need to write anything to disk. Sigh. Also, this part was not designed at all up-front, and my flailing around trying to get a workable solution is evidence of the need for proper design and planning before jumping in with code.

Aside from that, there are additional projects which were spawned:

zomb-web

The first front-end for ZOMB. A simple single-page HTML UI. Had some good practice remembering how to HTML and Javascript here…

zomb-plugins

A growing collection of plugins for ZOMB. At present, they’re all PHP (again, refreshing old skills…) and pretty simple. Currently, there’s time (simple current time/time-zone conversion), lastfm (see what someone’s currently listening to, find similar artists), weather (current and forecast conditions for a given city) and currency (simple currency conversion).

None of the above cannot be achieved without a simple web search, so next up I’d like to create a CLI client - weather updates in your terminal!

(Re-)Introducing ZOMB, an IRC bot back-end, which I planned, started work on some years ago, then promptly lost interest after it became vagely usable.

The general idea of ZOMB (like “zomg”, but it’s a bot, not a god [maybe version 3], and it sounds like “zombie” which is cool too) is to provide a client interface-independent bot framework, where bot functionality can be implemented in remotely hosted plugin scripts/applications, unlike a traditional bot where normally you’d need all the code running on one user’s machine/server.

Being interface-independent means a ZOMB client (the thing a user will use to interact with ZOMB) may be an IRC bot, a CLI application, or a web page. Since I’ve been less active on IRC than I’d like lately, the additional options would be useful to me personally, but since almost nobody uses IRC at all any more, ZOMB should hopefully be useful outside of that context.

So how does ZOMB work? From a user’s point of view, it’s exactly like a traditional bot - you issue a query consisiting of the plugin you want to execute, the command to call, along with command arguments. For example, you’d ask a ZOMB bot:

> weather current johannesburg

Where “weather” is the plugin, “current” is a command provided by the weather plugin, and “johannesburg” is an argument. In response to this, ZOMB would provide you a short text result, something like this:

> The weather in Johannesburg is currently 22 degrees and partly cloudy

In the background, ZOMB looked at the input, found that it knew of the “weather” plugin, and made an HTTP request to the remote plugin service passing the command and arguments along. The plugin then did what it needed to do to resolve the current weather conditions for Johannesburg, and returned a result, which ZOMB in turn returned to the requesting client.

As always, a new project provides some practice/learning opportunities:

  • API driven development I know what I want ZOMB to be able to to, so I began by defining the client and plugin APIs, around which the rest of the design must fit. I normally write a bunch of code, then stick an API on top of it, but trying it the other way around this time. Seems to be working.
  • Test driven development just to keep practicing :-)
  • Git and Github since we’re hopefully going to be using Git at work in the near future, best to get some practice in.
  • Custom Ant and Ivy build scripts I like Ant and Ivy and need to practice configuring and maintaining them from scratch.
  • Travis-CI continuous integration for Github projects, since it’s cool to have a green light somewhere showing that stuff’s not broken, and I’ve never used any CI stuff outside of work.
  • More granular commits committing smaller changes more often - I don’t know if this is a good thing or not, but seeing how it works out
  • All on Windows I haven’t really built a proper project on Windows for years :D

So, being stuck without access to Photoshop and my regular Windows PC has taught me a little about GIMP – basically it’s exactly the same as Photoshop with a less slick UI :D.

Also, since I haven’t really written anything tutorial-ish in many many years, so this is as much about brushing up on those skills as anything else.

This is a guide for quick and simple photo enhancement using GIMP.

arrow Continue Reading ...

With all the anti-NSA “spying” and fears of big corporate data collection stuff flying around lately, a lot of interesting products and tools have been given a bunch of visibility as alternatives to the traditional offerings now see as somewhat  “suspect”.

Ignoring the paranoia, prism-break.org has a huge collection of fun stuff to play with.

A long time ago, in a galaxy not far away, I created a very small application named SaveScreen. Today I’m rather pleased to release a much-improved SaveScreen 2.

A couple of anti-virus applications complained that the .dll file distributed with SaveScreen which enabled detecting when “Print Screen” was pressed, was a virus or malware of some sort, so even I was unable to use SaveScreen, which made my cry.

Finally fed up, I set out to resolve the situation by creating a brand new application which did not rely on random keyboard hooks and stuff. The result is SaveScreen 2.

In addition to no longer being flagged as a virus, SaveScreen 2 features direct ImageShack posting (complete with automatic forum code creation and thumbnail support), and FTP uploads of screenshots. Something which may be rather handy (just don’t take a screenshot of your bank statement then complain when the whole world is exposed to it - use with care). Also, it can save screenshots in per-application folders, making organisation somewhat neater.

Heh, I guess there are already plenty of tools out there which do this sort of thing already (never seen them personally, but then I’ve never looked either, heh), but this only took me half an evening to throw together anyway.

Basically, it’s a Python (uses youtube-dl) and PHP-powered web-based YouTube video downloader and converter, you just stick in the URL to a YouTube clip you want to save, and it will download it and offer it for download as an MPEG which you can save on your PC and play in all it’s low-quality glory whenever you want.

Basically it automates the following, which can be run on any Linux PC:

# youtube-dl.py -o myvid.flv http://www.youtube.com/watch?v=123abc # ffmpeg -i myvid.flv -ab 56 -ar 22050 -b 500 -s 320x240 myvid.mpeg

As an added benefit, it stores a complete history of downloaded clips, so you and others can re-download them at any time without having to do the whole fetch/convert process over again. Plus it uses a nifty fake AJAX waiting effect :P.

Requires Linux with ffmpeg, Python 2.4+, and PHP 4.3+.

After the release of the “Dumb Image Browser”, (which worked/works very well for what it’s supposed to do), I thought of prettying it up a bit, and adding some extra features.

The result is the Nice Image Browser. It’s vastly improved in terms of visuals, as well as offering features like easier browsing around the galleries, easy creation of new galleries, and uploading files directly from the browser.

It maintains the same PHP5-powered, database-less, cache-less, auto-thumbnail generating system of the Dumb Image Browser, meaning it’s just as easy to get set up (copy the files to a directory you want to become your gallery).

Thanks to Korpse/k4y/K` for the new stylesheet used for displaying the thumbnails.

The ReadMe includes usage and setup instructions. Happy image browsing! :)

Alright, so I’ve been getting more and more spam in recent weeks, and they’ve been getting harder and harder to build basic filter rules for.

My mail works in a pretty round-about way:
I have multiple POP accounts all over the place, which have sort of accumulated over the years. It becomes a bit of a mission to always set up and check all these accounts, so what I have now is a small Python script that connects to each of the servers, grabs the mail, sorts them based on some simple filters (like, containing a [mailinglist] type subject), and places them within a Maildir structure based on that sorting. In addition, it does the same thing for deciding if it should delete a message - extremely basic spam filtering rules can be set up to check out certain headers for possible spam flags, etc.

The downloaded mail is then served via IMAP, using the Dovecot mail server. The great thing about that, is then every time I re-install any of the machines I use for mail access, or install a new one, I instantly have all my neatly sorted folders, all my mail from all my accounts, and only one IMAP account I need to set up.

Anyway, basically, the spam filtering of the above system was rather lame, so I went on the hunt for something a little more useful. Enter SpamBayes - a mail proxy application written in Python.

It’s already “in Debian”, so installing was as fun as always (aptitude install spambayes), after which I only needed to start the service, and then it’s off to a browser to configure it. Actually there wasone step before that - since I’m running this on my server, and SpamBayes is meant for use by a single user on their own PC, it doesn’t allow connections do it’s browser-based configuration from other hosts. Which is a bit of a problem when running a server which I have no interaction with beyond a command shell. Thanks to Lynx I was able to configure it to allow connections from my local network.

For starters, you need to tell it which POP3 servers you want to connect to, and assign local ports to each one, which will be stand-ins for port 110 when connecting to servers. The interface for this is a bit troublesome however, requiring you to enter each server into a single input field, separated by commas. The associated ports for each server are then entered into another input field in the same manner. It took me a while to get both the fields synced due tot he number of servers I intended using.

Next up, I fed it a few emails for training (saved emails out of Thunderbird as EML files, and these can be uploaded to the server for training via the browser interface) both ‘ham’ and spam.

Once it knew the basics, I simply updated the list of servers in my Python script to “localhost”, and whichever port each one was set to. Shortly thereafter, mail started passing through the system. Most of it was identified as “unsure”, as it hadn’t seen enough examples of ham or spam yet. Quite smartly, it keeps a record of each message that’s passed through, and you can easily train ham or spam from these.

Around 50 mails later, it was identifying almost every message perfectly. I’m going to leave it running for a day or two more, training everything that arrives, then I’ll just add a single filter to my mail fetching script, looking at the “X-Spambayes-Classification” header for “spam” (delete), or “ham” take no action.

I’m quite happy with this setup, looks like it’ll work quite well :D.

Created two very basic scripts this past week:

The first, a basic Image Browser:

Basically, I really hate trying to set up and use normal image publishing/gallery software. Something like Gallery is pretty nice and feature packed, but for putting a photo of your cat online, it’s pretty much a mission, with users, permissions, logins, galleries, categories, grouping, keywords, thumbnail options, etc, etc. I just want to upload a JPEG and say that’s the end of it, but still have ti browsable with some thumbnails that didn’t take me 10 minutes to create in Photoshop.

Anyway, yar. So I made this script. It’s actually a pair of scripts. A basic browser interface that simply goes through a directory, finds all images, links to them, and shows thumbnails of them via the second script - a basic thumbnail generator.

So ‘installation’ is simply dropping this pair of scripts into the directory you want to publish your images from, and it’s done. Any sub-directories will be navigable, so you can use them as ‘categories’ if you’d like. Since the thumbnails are generated on the fly as needed, there’s no database or anything, and adding a new image is as simple as dropping the file into your image directory.

The second script, is a Download Tracker:

Extremely simple again, simply does a count of hits on any file passed to the file.php script. The files can be located anywhere on the system (so if you really don’t want people getting at your files without going through the counter, they can be outside of your www published path).

Again, I was going for simplicity here, so there’s no massive upload manager UI, or snazzy hit monitoring UI, or a 5000 table MySQL database. It keeps track of the hits by simply storing them in a regular PHP array, and then serializing this array to a file. Next time the file it requested, the hit log file is loaded, then unserialized into the array, the array is updated and serialized again. :). So you’ll need to make sure the files.log file is writable by the web server (or the whole directory the tracker files are in). It also requires PHP5, unless you write replacement functions for file_get_contents() and file_put_contents() on earlier PHP versions.

Link to a file as follows: http://my-site.za.net/file.php?installer.exe, or even http://my-site.za.net/file.php?path/to/document.pdf

You can then view the hits and things via the file_stats.php which outputs a very basic tabular representation of the stats the hit log tracks.

Both of these packages’ code is pretty well documented, so if anything, they may be educational so you can build more exciting versions of these. However, as they are, they serve my needs, but just thought I’d share anyway ;).

Usage instructions are also within the code.

Yay, on Friday, I decided to take the plunge, and install Debian on my laptop. I’ve always wanted to try working in a Linux desktop environment, considering I do practically no Delphi development any more, everything’s either PHP or Python. Since Debian has plenty of support for both of these, it seemed quite ideal.

I’m not dumping the existing Windows install though, so I had to partition my drive. Now, partitioning drives is about the most nerve-racking thing I’ve ever done, no matter what software I’m using, no matter how little data I stand to lose, I’m always scared as hell something will go wrong. Doubly so on this laptop since I use it constantly for work, and it’s the default installation HP put on, which I’m not really eager to bugger up. Luckily, that all went smoothly though :D.

When it came to installing Debian though, I had a problem with the netinst installer I was using, in that a package or two would not install due to missing some authentication files or something. So, since that installer didn’t work, it was suggested that I try an older Sarge installer and upgrade to the Unstable branch from there.

As expected, that installation went without issue. Unfortunately I just had to try my best to keep the machine cool while waiting for the installation to complete and the ACPI applications to kick in so the fans would do their thing. Thanks Korpse for warning me about that in advance ;).

So anyway, after the base installation was done, it was trivial (as I have come to expect from Debian,) to get Gnome, X.org and GDM installed and running. Apache, PHP and the rest were even easier. I was very pleased to see that the Firebird SQL server (open source’d Interbase fork thingey) was available in Debian right away, so I plonked that in as well. All that was left was to install Subversion, and check out my work stuff. Once done, I was 100% ready for work :D.

There are a few things not working yet - I haven’t had much luck with the wireless LAN. Gnome’s wireless LAN configuration applet thing is missing WPA-PSK authentication options (which I’ve configured my wireless AP to use), it only supports WEP. I also can’t seem to get the WPA tools (wap_supplicant) to work correctly. Based on the output I’m getting though, it *looks* like it’s connecting to the access point - it manages to find the AP’s MAC address and everything just fine, and it reports the authentication was successful, but beyond that, I can’t actually ping anything, and all traffic still seems to be trying to go through eth0 (wired LAN) rather than eth1 (wireless). Guess I need to learn a bit more about Linux networking… heh.

Another thing that’s not quite working is Bluetooth. Again, it *seems* to be working, the hardware is detected, and is working fine. My phone can pair with the laptop fine, using the PIN I’ve defined, but I can’t seem to transfer files or anything in either direction. I’ll admit that I haven’t played with this much yet, but I’m not really sure where to go next. I haven’t even tried looking into infra-red yet :).

And yes, I do use all these things, that’s why I spent so much on this laptop :P.

I also haven’t installed the ATI drivers yet, it looks like it’s going to be a bit of a mission on it’s own though.

Along the way I’ve also discovered some interesting new applications I haven’t seen or heard of before. gDesklets seem like a nice way to waste some CPU time and memory if you like to keep your desktop busy. Beep Media Player seems like a very nice alternative to XMMS, seems a lot more stable, and the general feel integrates better with Gnome. RapidSVN looks like it’s trying to be a nice enough SVN front-end, however I find the good old command-line a lot more friendly and efficient (and it crashes less). Sylpheed is a rather nice little mail client, and works well as an alternative to Thunderbird - assuming you’re unhappy with Thunderbird though. ibWebAdmin is a neat web-based tool for managing your Interbase databases, not as feature-packed or good looking as phpMyAdmin, but it does what it needs to do pretty well.

All that’s left now is to give it a shot at work tomorrow, and see how it all goes :).

A few weeks ago, the Serious Sam 2 demo was release, and my clan, the Avatars, and I were dying to try out the co-op, since we had played the previous game though together (although some shocking networking code made it near impossible), and were rather looking forward to SS2.

Unfortunately however, the demo’s internet play functionality was rather broken. After some digging on various forums looking for a solution, someone found a rather useful little utility - Hamachi.

Hamachi is basically a very simple VPN system, which behaves pretty much like an instant messaging client. When you install it, you’re run through a very informative little tutorial to get you started. During the process, you’re assigned an IP in the 5.5.x.x range - though I’m not entirely sure where the range starts or ends, we all got IPs like that - and a new Hamachi network connection is created under Windows. You may then join or create as many private or public networks as you like.

Members on the network can ping each other on their “Hamachi IPs”, they can browse shares, and copy files backwards and forwards (shares even end up showing up in your “My Network Places” eventually), send messages back and forth, etc. And of course in our case, it registers in games as a LAN connection, so you can easily play any multiplayer game with LAN support, without the need for the person hosting the game to mess with their firewalls, routers, port forwarding, etc.

There is a Linux binary available, however I couldn’t get this to work on my Debian Sid server, there were various tunneling problems, which are a bit beyond my networking skills to resolve.

In general though, the possibilities are pretty endless. Anything you can do an a LAN, you can securely and easily do with Hamachi, on a network spanning the world if you really wanted.

“Oops, I just printed my bank statement to Joe in Australia’s printer!”

Ever since installing BattleField 2, I’ve had a problem with taking screenshots. Basically, the game completely freezes up when I press whatever key is assigned to screen captures, and I need to reset my computer completely. Also, I seemed unable to use Fraps to make screen captures since the game seemed to be blocking all requests to whichever keys I assigned to Fraps’ capturing options.

I decided to rather just create my own utility. A simple application that hooks into the “Print Screen” key’s press, so when you press Print Screen, this app takes the image out of the clipboard, and will write it to a folder as a JPEG image. You can customise both the output location and the JPEG compression quality. The images are named after the current date and time.

It doesn’t work only for games, ANY time you press Print Screen, a screenshot will be saved. I think that could actually be pretty useful.

Yes, there are a million screen grabbers for Windows out there, but writing something yourself is both educational, and you know exactly what it’s doing. Also, I now have a single screenshot button for games, and everything else as well :D.

Note this may not work for all games, as some games tend to dump quite a mess to the clipboard when attempting a Print Screen.

This post also serves as a test for the attachment plugin for WordPress I recently installed ;).

I only noticed this rather recently.. But you can set up Firefox’s ‘Homepage’ option to open multiple tabs when you open the browser.

Just enter the URLs you want to open by default, separated by the pipe (’|’) character. The same effect can be achieved by opening all the tabs you want, then use the ‘Use Current Page(s)’ button.

So you can now open Google and 200 random websites you probably won’t even look at anyway! Personally, it irritated the hell out of me, but maybe someone would find it useful…

Thanks to a link mithrandi posted in IRC, I’ve discovered this rather useful tool.

Gregarius is a web-based RSS/RDF/ATOM feed aggregator (oops, I didn’t copy/paste that from their homepage :P) which you can install on your own server, and manage as you like.

Setup was a breeze, I just checked out the latest version from their Subversion repo, copied the files over to /var/www, and created a MySQL database. First visit to your Gregarius URL prompts for database access settings, and creates the tables and everything for you.

It has an extremely clean interface, I suspect in fact that it’s highly influenced by WordPress (their “devlog” using WordPress further convinces me), but that’s beside the point. It’s extremely easy to manage categories, add feeds (it automatically fetches a “favicon.ico” file if one’s available as well), etc. I got my whole installation and 10 feeds all setup within around 10 minutes.

It presents the feed items nicely enough, sorted by date, with links to the full versions, as well as descriptions/summaries. It also keeps track of items you’ve left unread, making it easy to come back to them later. Another helpful feature is the ability to search within the feeds it’s downloaded and stored, allowing you to pull up any item at any time, I’ve already found this quite useful.

All-in-all, a pretty great little package. It sure beats Thunderbird’s RSS reader hands down. If you subscribe to any feeds, have the ability to host it (just PHP and MySQL required), and 10 minutes to set it up, throw away your existing RSS readers and get your own Gregarius aggregator up and running :).

I must say, I’m rather disappointed with my “SmoothWall experience” so far. I’ve been tasked with setting up a SmoothWall firewall/proxy machine at work, and from what I’ve read, it’s like the best thing since sliced bread.

Unfortunately I cannot agree.

The installation tends to go fine, it partitions the hard disk by itself, installs fairly fast, then steps through a simple setup ‘wizard’. Here we are prompted if we want to enable or disable ADSL. Now, I want SmoothWall to connect via our ADSL line. BUT, it seems the developer’s idea of “ADSL” is in fact “USB ADSL Modem”.

Anyway, after figuring that one out, and after much shuffling of subnets and IPs between the router, SmoothWall, and my PC, I finally get it to use the router as a gateway. I try visiting some sites - DNS lookups fail. I take a look in all the log options on SmoothWall, and find the firewall is blocking DNS traffic, and is trying to route everything through the same (“Green”) NIC, rather than the second (“Red”) one.

Sooo, turns out I can fix this by running the “setup” tool again, and ‘pretending’ to change the IPs, so it resets everything (re-writes the firewall rules maybe?). Cool, everything’s working again. Not quite.

Seems after that, the proxy magically stops working altogether, so from the web interface, I just disable it, and re-enable it. Cool, everything’s working now. Riiiiight.

A few hours later, suddenly the internet is dead. Hmm, seems the firewall is blocking all traffic again and routing though the same NIC. Sooo, I repeat the whole IP change/reset, proxy reset, etc, and everything’s cool.

A few hours later I find myself repeating the whole procedure again.

This is seriously lame, having to practically reboot the entire machine every few hours. So I think maybe I’ll try to set up a PPPoE connection. So I go and configure the router correctly, test ‘dialing up’ with my machine in XP, all’s cool. Now to set up SmoothWall. Running the setup tool again lets me set the “Red” interface to “PPPoE”, and that seems done. Now where do I put my username and password to dial up?

Apparently the “ppp settings” page of the web GUI is where it’s done. Now excuse my ignorance, but this looks like a modem dial-up page, asking for phone numbers, which COM port my modem is on, etc, etc. A bit of searching around the rather un-helpful support forums, reveals that this is indeed where you need to configure PPPoE usernames and passwords. Just leave all settings alone except for login details.

I give it a shot, tell it to connect, nothing happens. Check the logs, and not surprisingly, it’s trying to connect via ttyS0 (COM1).

Now, apparently there’s supposed to be an option to select the correct interface in the drop-list where you select which port your modem is on, on the “PPP Settings” page, but for some magical reason this does not exist for me.

Unfortunately their forums are also not very helpful it seems, and even after composing a very descriptive help request, I get a rather sarcastic “RTFM” response for a subject not covered in the manual.

Basically the manuals are not up to scratch, the support forums are full of leetbois, the options in both the setup tool and web UI are obscure, and the whole thing is bloody useless, needing a darn reboot every few hours. WTF.

I’d love to send the whole thing to hell, but unfortunately I have to get it to work. *sigh*

I haven’t really seen a lot of news about the OpenOffice.org 2 Beta release. It seems to me like a pretty important thing :P.

Anyway I popped by the OO site recently and grabbed the beta (which is actually version 1.9.79). Anyway, first thing to note is the loading time has unfortunately not really changed much since the 1.1 range. Next thing you’ll notice is the look. It looks a few million times better than previous versions, and actually looks like a native Windows application now. The toolbar icons all look much clearer - I never really liked the previous version’s icons much at all, they were all very unclear as to what they did.

Next up, Calc now supports 64000 rows!! This was my biggest gripe with previous versions - they were limited to 32000 before, which pissed me off no end when trying to work with large chunks of data. For me, this is the biggest improvement I could have hoped for :). I also found defining custom number and date formats somewhat easier than before.

I can’t say I’ve used Writer all that much, so I can’t comment too much on that, but I did note that the Print Preview has been properly overhauled. The Print Preview seemed to have been an issue when trying to convert people :).

I can’t say I care much for the new Open Document Formats, since most of my work requires me to use Excel and Word files, so I just write to those formats whenever I save. Lets see if MS will start to support the format in Office now that it’s been recognised and approved as a standard.

Overall, I guess the real version 2 can only get better :).

titleSquid

date 27 Jan 2005

I thought that it’s about time I messed around with proxies, so yeasterday I set up Squid on my server, xan.

The configuration looked like a bit of a mission for a first-timer such as myself :P, so I whipped out Webmin and slapped on the Squid module. I’ll take a look at the config options it generated some other time and do it by hand in future.

I must say the variety of options available is quite impressive. The access control lists are particularly exciting too, there’s a helluva lot that can be done with this stuff.

It’s only being used for HTTP at the moment, and is doing an excellent job. I’ve managed to get AWStats to do some basic reporting for it, so I can see who’s using how much bandwidth, viewing how many pages, what file types are being accessed, etc. I’m a bit of a stats junkie :P.

Overall I’m pretty impressed…