Peter's Blog 2004/5

2004-05-31

Window Blinds

I edit in Vim, I write Python command line programs wth no UI, I use two Debian Linux systems, neither having X because they are too old and slow but I still occasionally feel the need for gimmicks. The first gimmick is Incredimail which allows me to send email with dancing hamsters and my latest gimmick is Window Blinds that adds extended theming to Windows. I am tring the shareware version and am enjoying an elaborate mahogany and brass look to the interface. It seems very capable so far, I have noticed no instability and Microsoft seem happy with it (looks like the publishers, StarDock are in the stage of a business relationship with Microsoft before they get stabbed in the back and similar technology gets built into windows).

Most of the add-on themes available are grey or blue and I haven't found one yet that doesn't have unreadable black text on a dark coloured background somewhere but still it is amusing. The only new feature it adds is the roll-up effect that X windows managers have. I habitually maximise and minimise everything so roll-ups are no use to me.

I also tried their ObjectBar addon which allows you to create extended task bars and stuff. I wasn't bowled over by that, the standard XP taskbar is quite capable. It allowed me to add the date to the clock but it was buggy (taskbars overwrote balloon popups).

posted at 19:10:08    #    comment []    trackback []
 
2004-05-29

Sky Plus Repairs

Sky Plus is a wonderful combined satellite receiver and PVR box. It has dual satellite tuners so you can watch a recording while recording two other channels at the same time. Nice.

For a long time my box has been having problems playing back channels whereby the video would stutter, jump back a few seconds, forward again, show lots of compression artifacts and generally be annoying. I put this down to the hard disk failing and some internet research backed this theory up. The box takes a standard IDE drive and many people upgrade it to 120G for 60 hours of recording. The basic box has a 40G/20 hour capacity. I have not really wanted to spend the money on fixing the problem as I am mean, the problem wasn't too bad just irritating and I'm not really interested in having more than 20 hours recording (do people sit down for 60 hour playback binges?).

Last night watching EastEnders the playback was particularly bad and was spoiling my wifes enjoyment. On a flash of inspiration I remembered I had a largish hard disk from my desktop pc going spare, one I stopped using because of a major corruption that nearly lost me my wedding photos. I checked it out and it is indeed a 40G drive, an IBM Deskstar IC35L040AVER07-0 for the record.

The satellite box satellite box uses torx screws and I had a torx screwdriver so I wasn't too worried about doing the swap. The torx screwdriver didn't fit very well and the screws holding the drive in would not budge. I snapped a drill drilling the old screws out. I put the new drive in and did a system reset and it all seems to be working.

Time will tell whether it has solved the original problem or whether using a 7200rpm drive with dubious reliability is going to introduce more problems. Anyway, it was worth a try as the disk was lying around anyway.

posted at 13:18:08    #    comment []    trackback []
 
2004-05-28

Searching

At work I have set up Python Desktop Server for my project logs. I needed a server with a search engine so that other folk at work can search through my ramblings for the details I couldn't be bothered to tell them. I could not use a public server for this as there is confidential information in there.

I initially set it up to post to the file system into an Apache www directory and this worked nicely, instant website. The only problem was the lack of a search engine.

I thought about using Python Community Server and I fiddled about trying to install it but was thwarted by the cvs not wanting to give me the medusa code. I decided to go back to the simple Apache approach.

I had a quick look for a search engine tool and came across the awkwardly names ht://dig. This is an indexing engine plus necessary cgi. I installed the debian module at it was going in no time. I tweeked the html to use the Python Community Server style sheets and get rid of the nasty blue background, added a link from the weblog to it and everything is cool.

I can live with this setup now, as I understand it a community server would give me the following features:

  • XML interface

  • Multiple accounts

  • Search engine

  • Comments

Any comments my coworkers have are probably best said to my face.

posted at 14:11:28    #    comment []    trackback []
 
2004-05-26

Tunnelling In

At work I was inspired to find a way to get in from home through the firewall. Tunnelling out using ssh through the https port is tried and tested but I wanted a way in.

I've set things up so I can email myself at work with a certain subject line which triggers an exim .forward rule. This rule starts up ssh making a connection OUT to my home debian server. The outward connection includes a remote forwarded port so from my home debian box I can ssh back into the work box. I'm kinda pleased with this as it's secure so I won't get into trouble. The tunnel can only go to my home pc at my command. Even if someone else sent the magic email they would not get the ssh connection.

It took a couple of tricks to get this working:

  • I had to edit sshd_config to add a new port at 8022 for forwarding to the home box as this is not a priveliged port.

  • The .forward file does not run ssh directly (it cannot block and wait for the ssh session to finish) so it runs an 'at' command to launch ssh independantly in a totally separate process.

  • ssh is fired up with the -n and -N commands to stop it screwing up the console.

Getting this going prompted me to load samba so I can copy stuff from the windows workhorse to the debian box and access it anytime from home without the risk of exposing my windows box through the firewall. Now that would get me into trouble...

posted at 21:18:08    #    comment []    trackback []
 

Samba Install

I was inspired to install samba both at work and home. With debian this boiled down to:

apt-get install samba smbclient

After tweeking smb.conf to expose the home directories to browsing I could not connect from windows without repeated user/password prompts. trying to browse using:

smbclient -L <hostname>

In both situations I got an error:

session setup failed: NT_STATUS_LOGON_FAILURE

I found a fix for this here which boiled down to:

"May be dumb to ask but you did create the Samba password file and added passwords for

your users? Reason I ask is because I have searched quite a few links and the response to that error is usually just that. Here is the commands I used to add my users:

To make the password file:

# cat /etc/passwd | /usr/bin/mksmbpasswd.sh > /etc/samba/smbpasswd

Then add your users:

# smbpasswd someusername"

At work the debian stable install did create a passwd file but apparently it didn't do a good job. My debian unstable install at home didn't try but the above did the trick.

posted at 20:58:56    #    comment []    trackback []
 
2004-05-23

More Spambayes

I've set up a horribly complex email system:

  • fetchmail polls four pop email accounts and forwards them all to a single account under exim.

  • qpopper provides pop access to the mail account

  • SpamBayes pop3 proxy provides spam checking

  • IncrediMail accesses the single pop account

  • IncrediMail messages rule split the messages into various folders and also filters out the spam based on spambayes markup.

Seems like a lot of complexity, even more considering the URL redirection going on to give the email nice names. I could have exim pass the mail through Spambayes but the pop3 proxy includes a nice web-based review, training and configuration server.

I use IncrediMail because I get a stupid kick out of having little animated men in my email. It's also a nice robust email client. I used to use mozilla email it had trouble cancelling hourglasses which annoyed me. I was talking to someone recently who says ThunderBird is still doing that.

I find the Spambayes technology interesting. I'd like to run it on RSS feeds and the like to sort wheat from chaff.

posted at 20:44:00    #    comment []    trackback []
 

Rowing Machines

I quote the link above as it helped me a lot in my choice of rowing machine and where to buy it. I bought a Tunturi 710 Air Rowing machine from Exercise Zone (this link doesn't work for Mozilla or FireFox). I'm giving up going to a gym for various reasons so I wanted to buy a rowing machine to avoid turning into a blob.

THE benchmark rowing machine is the Concept 2 which is very well made and is calibrated so rowing 2km on two machines in different countries is directly comparable. If you look in the rowing machine newsgroups the advise is always to buy a Concept 2, nothing else is considered. I used to use a Concept 2 at the gym.

The problem with this advise is that in the UK a Concept 2 costs £939, about twice as much as in the US. The article I link above goes into this, the importers give themselves a nice markup and do not allow anyone to sell it for any less here. Looking on Ebay, even second hand ones cost £700-£800.

I wanted a good quality machine as I have worn out cheap crap exercise equipment before, a stepper that snapped with metal fatigue in 2 months. Again inspired by the article above I went to the site they mentioned and found a 'Catalogue Return' machine for £399, normal price about £520. The machine was brand new, all it's bolts and things were sealed in plastic bags. I have no idea why it was so cheap. Here is my bullet point review for anyone else considering NOT buying a Concept 2:

  • It is fairly well made, solid, it does not feel flimsy. I think it will last. It isn't as solid as a Concept 2. 2 year manufacturers warranty.

  • The computer is very basic. It gives strokes, strokes/min, distance, elapsed time and pulse rate. Concept 2 gives also calories/hour and metres/minute which are very useful.

  • Free heart monitor strap

  • No difficulty adjuster. In the manual it just says to work harder you just pull harder!

  • The footrests pivot which may stop my feet coming out of the straps. However there is nothing to stop feet slipping sideways.

  • It is huge. The rail folds up but it is still big.

  • I rowed for 20 minutes and the indicated distance was about 500m. On a Concept 2 I can row 2500m in 10 minutes. Don't bother comparing your performance on one of these to a concept 2.

Conclusion: I'm happy with my choice.

posted at 18:08:16    #    comment []    trackback []
 

Rowing Status Report.

I mentioned in P357_ how I bought a Tunturi 710 rowing machine. Now I've been living with it for 2 months it's time for a status report. I'm doing 1/2 hour rowing three times a week, I try to keep my heart rate at 160 for that time. It's hard, especially during the current humid weather. I don't enjoy it much, but when I don't do it I get a stiffness that is only fixed by another row. Pros: * All over feeling of fitness, not waist down like cycling. * Can listen to `Classic Comedy recordings`_ while doing it * Machine is plenty solid enough. Cons: * Hard, not enjoyable. I cycle to work and I used to use an exercise bike at the gym and they were much more fun. * Machine does not display speed apart from strokes/minute. This is like rpm in a car, it doesn't convey effort (6000rpm in first gear = easy 6000rpm in top = hard). This is why I go on heart rate, although it's good to know I am not working harder that I need to (i.e above anaerobic threshold). * I had to oil swivelling footrests to stop squeeking. .. _`Classic Comedy recordings`_: http://www.bbc.co.uk/radio/aod/comedy_promo.shtml
posted at 09:49:04    #    comment []    trackback []
 
2004-05-22

SpamBayes

I used to get very little spam at work since the company email was protected by SurfControl spam filter. It's a cruddy program with limited MTA features but it does a valiant job in fighting off the spam, most of which fails a DNS PTR record lookup.

Recently I was added to an email group which started 'it@' and since then I have started to get spam since this is fairly easily guessable compared to my initials. Also I started to get cron alerts, ISA server port attack alerts, Sophos sweep virus scan alerts (a 1Mb list of encrypted files that cannot be scanned, no viruses) and assorted other stuff, making it hard to find real email amongst the noise.

So I had a reason to setup SpamBayes. It's cool and it already doing a good job of getting rid of this stuff. I set it up as a pop3 proxy running on a debian box that uses fetchmail to read my email accounts, exim MTA and qpopper for pop3. I have Big Plans for the box to archive my project related email so I can hyperlink to it from my project notes. I like the power of using an exim .forward file to run a python script on my email: limitless power.

I have 270MBytes of email archives trapped in outlook proprietary format. I have dabbled in writing outlook macros but they are incredibly flaky: it randomly stops running then from mail rules for no apparent reason (silently unchecking the box that enables them). At least the .forward file activities get logged somewhere.

posted at 20:01:20    #    comment []    trackback []
 
2004-05-15

Honda

This isn't an advert but I have decided to sell my 1999 Honda CBR600FX motorbike. I haven't ridden it for a year, not even starting the motor. The battery has been on a trickle charger for most of the time that the bike has been off the road in the garage.
This afternoon I rolled it out to see if it would start. It took a few goes but it was running in under two minutes. I said this wasn't an advert but I hope it says something for Honda build quality. My wife wants a Honda car which here in england are considered quite boring (maybe they are boring everywhere) but I would be happy to buy her one if it means low maintenance.
CBR600FX
posted at 16:49:20    #    comment []    trackback []
 
2004-05-14

Firefox Extensions

Was reading a Wired Article about free ad blocking tools and noted that most of them seem to be for FireFox. I've dabbled with FireFox before, installing it on my desktop pc when mozilla stopped booting. I've given it another whirl and it may solve some minor Mozilla peeves I have:

  • Boots quickly.

  • A single click in the address bar selects the whole URL, ready for copying or overwriting. I often found I had to click about 10 times to get mozilla to do that while it selected various parts of the URL.

  • Downloaded tool to force 'open in new window' to open in a new tab. Now I shouldn't get 6 Mozilla windows in my task bar.

  • New tabs load up the home page (i.e. Google) instead of being blank.

  • Many tabs spill into multiple rows of tabs rather than narrow tabs.

  • Nice 'Edit CSS' tool to edit the style sheet of a page and see the effects interactively.

I'm happy with it for now and using it to post this.

posted at 18:21:04    #    comment []    trackback []
 

EasyDialogs

Found this on Python Daily URL. Easy to use dialog library for windows:

>>> import EasyDialogs
>>> fn = EasyDialogs.AskFileForOpen()
>>> fn
'C:\\Documents and Settings\\Peter\\NTUSER.INI'

This may finally stop me hard coding file names into scripts. I occasionally use the PythonWin librarys to access the common dialogs but that it is a lot like hard work. wxWindows is also hastle if all you want is a file name.

The site also mentions an interesting idea: packing python into executables and then using UPX to compress it.

posted at 07:26:08    #    comment []    trackback []
 
2004-05-11

Link Nugget

I modified my firstBelowCalendar nugget as follows to provide some links to wiki entries:

</p>
<p class="whiteboxsmall">
$macros.linkWiki( 'Index')
<br>
$macros.linkWiki( 'PythonDesktopServerNotes')
</p>

It seems nuggets can contain macros but not structured text markup.

Tip for the day: SilverCity does not seem to support HTML so I used XML above.

posted at 13:30:56    #    comment []    trackback []
 
2004-05-08

Old Blog Uploaded

I hacked up a Python script to merge my old blog with my new Python Desktop Server blog. It uses the PyDS MetaWeblogAPI. The script is here. Not pretty but it's something. It reads entries from my Natara DayNotez database, sees if they are already in the PyDS blog and if they are not it posts them. I had to make a small change to PyDS to give the posts the correct creation date. To do this I added one line to MetaWeblogAPI.py:

id = weblog.postNewEntry(
   
struct.get('title',''),
   
struct.get('link',''),
   
struct.get('description',''),
   
struct.get('source',{}).get('name',''),
   
struct.get('source',{}).get('url',''),
   
onhome=publish and not(struct.get('flNotOnHomePage',0)),
   
# PCW: allow published time to be specified.
   
pubtime=int(struct.get('pubtime', '0')),
   
categories=categories,
   
structured=structured)
return id

Uploading wentsmoothly after one tricky problem. The £ character caused problems with XML. I eventually got around this by converting the title and description fields to unicode before posting:

oPost['title'] = unicode( strTitle, 'ISO-8859-1')
oPost['description'] = unicode( strRtxNote, 'ISO-8859-1')

I fixed my vim posting script in the same way.

posted at 17:08:32    #    comment []    trackback []
 
2004-05-06

Not so broadband

NTL have put up the cost of their 1M broadband service £3 to £37.99 which has finally motivated me to downgrade to 600k which is still £24.99. I spend most of my online time reading about python which doesn't really justify the extra cost. I type at a laptop in front of a 37 inch TV so streaming audio or video isn't very interesting to me either.

Update: 15 May 2004: my maximum download speed has dropped from about 100kb/sec to about 67kb/sec. I think I can live with this. It still feels sweet using broadband, going back to dial-up would be like living without satellite tv and having to suffer with only 5 terrestrial channels.

posted at 20:18:24    #    comment []    trackback []
May 2004
MoTuWeThFrSaSu
      1 2
3 4 5 6 7 8 9
10111213141516
17181920212223
24252627282930
31      
Apr
2004
 Jun
2004

A blog documenting Peter's dabblings with Python, Gentoo Linux and any other cool toys he comes across.

XML-Image Letterimage

© 2004, Peter Wilkinson

Bisi and me