TechBlog
leaflet
#js1k entry finally complete - AsciiBrot1K:http://urlm.in/flii - from T-SQL to JavaScript and then down to just 1KB of hand-compressed code

Windows file sharing stupidity

Posted on 9 January, 2011 by maximinus in Linux

A couple of months back, I did a nice fresh installation of Ubuntu 10.10 on my laptop - on a shiny new Seagate Momentus XT drive. All was well, and I could connect to my Windows machine's file shares just fine.

Fast forward to today. I hadn't tried connecting to the Windows file shares for a while, but wanted to grab something off my desktop machine. No matter what I tried, I couldn't get the laptop to connect to the Windows machine's file shares. I ended up attempting to manually invoke smbclient, with the debug flag set to maximum debug level, in the hopes that it would shed some light on the situation. The best that I got from that was these two lines:

SPNEGO login failed: Invalid parameter
session setup failed: SUCCESS - 0
which didn't really shed much light on it.

A bit of googling around found a few people who'd done the same thing to debug smbclient connection failures, but they mostly turned out to be trying to create null connections (no user/pass - not even the "guest" user), which Windows doesn't like. Then, I managed to find this post, which gives the actual solution to my problem.

The solution? Uninstall "Windows Live Essentials" from the Windows 7 machine. Seriously. I'd installed Windows Movie Maker - which, these days, is part of Windows Live Essentials - a month or two back, and that was apparently enough to completely prevent samba/smbclient from connecting to that machine. Upon uninstalling Windows Movie Maker, the shares started working again immediately!

No comments have been posted on this entry. Click here to post a comment.

Ubuntu 10.10 and laptop touchpads

Posted on 16 October, 2010 by maximinus in Ubuntu, Linux

After several iterations of not getting around to upgrading Ubuntu, and subsequently deciding that I may as well wait for the next version as it's nearly here now, I finally upgraded to Ubuntu 10.10 this week.

All was going well, until I tried to play Minecraft. I couldn't be bothered finding a mouse, so I was going to play using my laptop's touchpad. At first, it seemed to be working fine - but then everything was very jumpy, with my touchpad input seemingly freezing up and then jumping around. I figured it must be either lag or something wrong with the version of Java I was using, but then, on a whim, plugged a mouse in. The mouse worked fine.

I didn't think much of it at first, thinking that it's not a huge deal if it's just Minecraft - I can use a mouse for that. Then I noticed that it was happening everywhere - even on the desktop. I wondered if there was something wrong with the touchpad driver, causing it to lock up whenever there was keyboard input, but soon discovered the real culprit - a new setting, and its default value.

To fix the issue, all you need to do is untick the "Disable touchpad while typing" checkbox on the "Touchpad" tab of System -> Preferences -> Mouse.

One comment has been posted on this entry. Click here to view.

Smoothwall, cbq.init and bugs

Posted on 5 February, 2010 by maximinus in Linux
I've recently been attempting to get per-IP ratelimiting implemented on a Smoothwall Express 3.0 box, with very limited (if you'll excuse the pun) success. The stock SWE3 kernel is lacking many things which are needed for such ratelimiting, so I had to resort to setting up a virtual machine with the development version of smoothwall and compiling a new kernel and a bunch of modules for myself - more on that later, probably.

Once I got the kernel and modules sorted, I discovered that cbq.init (version 0.7.3), the script I intended to use to perform the ratelimiting, has a bug in it - one which prevents it from working at all. After making a couple of minor adjustments to the script, it works quite well. For future reference, the "-maxdepth 1" arguments on lines 579 and 585 need to be moved up to just after the $1 in the previous lines.

The error in question was repeated once for each config file in /etc/sysconfig/cbq, and read as follows:
find: warning: you have specified the -maxdepth option after a non-option argument (, but options are not positional (-maxdepth affects tests specified before it as well as those specified after it). Please specify options before other arguments.

Source: noidea.us
No comments have been posted on this entry. Click here to post a comment.

Axdroid kernel for X50v

Posted on 26 August, 2009 by maximinus in Linux
As you may already know if you've been following the AxDroid project, Ertan has just released a patch for the Android 2.6.29 kernel, to boot it on the Axim X50v/X51v.

Anyone who tried Ertan's original AxDroid alpha on an X50v will be familiar with the touchscreen coordinate inversion - the X and Y coordinates are swapped, which makes it very tricky to use the touchscreen.  Now that the kernel patch is available, I've recompiled the kernel image with the touchscreen driver tweaked to swap the X and Y coordinates to be correct on the X50v.

If you wish to run Google Android (i.e. AxDroid) on an Axim X50v, follow the instructions for installing the AxDroid alpha, except use my patched X50v version of the zImage instead of the one linked in the post:
http://drop.io/x50v_zImage

You should now be able to boot Android using HaReT by following the instructions on the AxDroid blog - and touches on the screen should be registered in the correct locations!
No comments have been posted on this entry. Click here to post a comment.

Xen swap issues

Posted on 12 June, 2009 by maximinus in Linux
Note: This is mostly for my own future reference, but I thought I'd post it here in case somebody else might find it useful.

The Problem
This website (and a few others I run, such as ShrinkThisLink, the free link shrinker) runs on a /Debian VPS, running on Xen.  It had a swap partition configured, but was not using it, and didn't seem to want to.  I found that different methods of getting partition information seemed to be returning conflicting information:
  • the VPS control panel stated that /dev/sda1 was a 1GB swap partition, and that /dev/sda2 was a 5GB ext3 partition
  • `fdisk -l` seemed to agree with the VPS control panel, but added that each drive "doesn't contain a valid partition table"
  • parted also seemed to agree with the VPS control panel
  • `df -h` listed /etc/sda1 as mounted on / and being 5GB
  • /etc/fstab listed /dev/sda1 as a 5GB ext3 partition to mount on /
  • `swapon -a`was returning "swapon: /dev/sda2: Invalid argument" - which seemed to state that /dev/sda2 was the swap partition
So, of those I tried, three methods suggested that sda1 was swap; three methods suggested that sda2 was swap.  With it being a dead heat, I wasn't willing to try anything such as running mkswap on either partition (not that I'd have tried it with any inconsistency at all).

The solution
It struck me that if I could determine the actual swap partition's UUID, I might be able to do something of use with it.  Running `blkid` provides a convenient list of partitions, their types and their UUIDs - so I looked for the partition listed as having TYPE="swap" (which was listed as /dev/sda1).

Armed with the swap partition's UUID, I modified the line of /etc/fstab relating to the swap partition - changing "/dev/sda2" to "UUID=" followed by the swap partition's UUID.  Once this change was saved, `swapon -a` returned with no errors, having successfully enabled the partition as swap.
No comments have been posted on this entry. Click here to post a comment.

Asus Eee PC

Posted on 9 January, 2008 by maximinus in Linux, Rant
I'm sure you've seen them - just about every man and his dog seems to have bought an Eee lately.  A lot of people seem to be modding in touchscreens - which I think is a really cool idea, and makes it much more usable (personally I think the touchpad, no matter how sensitive, is far too small to use properly).

Asus have now announced that they will be releasing Eee PCs with 8" and 8.9" screens - which I think is a good move, since the existing 7" screen looks as though it's swimming in an ocean of wasted space.  What surprises me, especially given the number of people modding them in, is that they have not announced a touchscreen version.  Also, the 8" version will have the same resolution as the 7" version - it would have been good for them to knock it up a notch; I certainly hope they do for the 8.9" version.

If Asus can pull off an 8.9" touchscreen with a decent resolution, with decent battery life, I'll be very tempted to buy one - and I'm sure many other people who are currently interested, but not enough to buy one, will be too... I'd say it'll increase sales quite nicely if they get it right.
No comments have been posted on this entry. Click here to post a comment.

Permission Problems

Posted on 28 January, 2007 by maximinus in Linux
I've been running IRSSI within screen on my home server for a while now, so that I remain connected to IRC.  With my decent ADSL modem/router currently out of action, and thus reduced to using a "DeLink" (DLink) DSL-302G (which drops out randomly for no reason), remaining connected was getting difficult, so last night I decided to set up IRSSI+screen on my new VPS, since it's easy because it's running Debian Sarge (so I don't have to try to hunt down CentOS 3 RPMs for stuff).

For some reason, whilst both screen and IRSSI worked fine as root, neither would work properly as a non-root user.  At first, screen would error saying that it couldn't get a PTY - so I changed the group ownership of a bunch of PTYs to the "tty" group and added the user to this group.  This left me with screen still not giving me a prompt - just a blinking cursor.  I could, however, run "screen irssi" - which would attempt to start IRSSI inside a new screen.  IRSSI, however, had a different idea entirely.  Whenever I tried to launch it as the non-root user, whether it was in or out of screen, it would give the cryptic error:
Can't open perl script "-e": Permission denied
and then segfault.  After much googling around, I eventually found the solution in some IRC logs that a Google search turned up:
chmod a+rw /dev/null
Nobody seems to know why /dev/null may have lost these permissions, or indeed why restoring them magically makes Perl work properly for non-root users and thus allows screen and IRSSI to work nicely - but hey, it does work.
3 comments have been posted on this entry. Click here to view.

Where Am I?

Posted on 18 October, 2006 by maximinus in Ubuntu, Linux
Ubuntu's networking system has something which Windows XP lacks - locations.  These allow you to toggle between multiple configurations - for example, "Work" and "Home" - so that you don't have to manually change all of your settings when you change networks.  This is very useful for laptops and other portable computers.

However, it has one very major oversight - once you've saved a configuration, that's it.  You can't rename it or edit it - only delete it and create another.  Neither can you reorder the locations within the dropdown list - they're just in order of first-last created.  Also, you can't delete a location (or view it in order to derive a new one from it) without first activating it - a task which can take a considerable amount of time to happen, if the default gateway or DNS server (I'm not sure which; maybe either) is not reachable - i.e. you are not at that location, or one of these has changed and you need to update it.

Just how much effort would it take to actually make it possible to do these simple things?  The settings must be stored somewhere - so why can't there be a simple interface for reordering, viewing, editing, renaming, deleting and creating locations without activating them?

To be honest, I haven't searched around to see if there are any applications out there which would do this nicely - I don't really care if there are.  Now that I've got everything set up how I need it at the moment, it should be fine (for the time being) - so I don't need to reconfigure my locations any time soon.  Consider this to be both a retrospective rant and a suggestion for an improvement which could be made to Ubuntu's network manager.

Update:
Since this post was originally written, the network manager in Ubuntu has been upgraded and most, if not all, of the improvements mentioned above have been implemented.  Now all that's needed is a quicker way to swap locations - preferably without having to authenticate using gksu, as I don't see why I should have to type a password just to change network location... automatic switching based on available wireless networks (switch to whichever location has the currently connected wireless network specified, upon connection to a wireless network) would be great too, but should probably be a togglable option (perhaps on a per-location basis, i.e. "Auto-select this location when connecting to this wireless network").
No comments have been posted on this entry. Click here to post a comment.

Ubuntu wins again

Posted on 13 August, 2006 by maximinus in Ubuntu, Linux
When my laptop hard drive died (from overheating - again) I tried everything I could think of to get the data off it.  I froze it, hit it, banged it on the desk, turned it upside down - all the usual tricks.  Nothing worked at all.  Whether I put it in the laptop or used a USB enclosure, I just couldn't get to the drive.

I decided that since I was going to have to reinstall everything from scratch anyway, I may as well try Ubuntu - Ryan had been hounding me to install it for a while.  It was a breeze to install, and I could even sit there playing games while it installed - beat that, Microsoft!

Anyway, after a minor niggle with the wlan not supporting WPA-PSK (which is resolved), everything seems to be working fine - Compiz gives me graphical effects which Windows wouldn't be able to perform nearly as well on the processor (Compiz even did it fine when the CPU was locked at 600MHz).  There is only one exception - the built-in (well, more like butchered-up PCMCIA) SD/MMC/MS reader doesn't work.

Anyway, back to the "dead" hard drive.  I decided to have another crack at it today.  I tried putting it back in the laptop and manually setting the drive parameters in the BIOS, since it detected it, but as a 0MB drive.  One problem - the BIOS on this machine doesn't allow manual parameter input - it's auto-only.  So, on a whim, I slapped it back in the USB enclosure - and plugged it into the laptop with Ubuntu running.  Ubuntu picked up the drive and automounted it - and I immediately had full access to both partitions on the drive.  I have now copied off everything I think I might want/need from it that I don't have elsewhere - it was running for upwards of half an hour with no problems.  I could probably just keep running it as a USB HDD under Ubuntu with no problems - but I'd rather not risk it, so it's just going to sit around in case I find the need for something else off it.

Overall summary: Ubuntu beats Windows hands-down (after a bit of setup, but hey - Windows takes longer to install and also requires tweaking to get decent performance).
No comments have been posted on this entry. Click here to post a comment.