SommitRealWeird

StarTech IP KVM - SV1107IPEXT

So, at work we have a little single port IP KVM, it is a StarTech SV1107IPEXT - it's not a "bad" bit of kit, if you're completely configured for using it in the way they expect... When you're not, then it throws a NullPointerException when you try to connect with it's Java applet.

This morning (mostly because the monitor and keyboard I had been using for building stuff on my desk has gone missing) I decided I'd try again with the device, it's not on our default office network range, mostly because it might not always be in the office, so I quickly added an ip alias using ip addr add 192.168.0.59/24 dev wlan0 on my laptop to bring up a route to it. Navigated to the page and asked it to fire up the Java applet. Straight off, a NullPointerException happens - hmm. So looked at what was being logged by the JVM - it was trying to run ifconfig (no, really, the java applet ran ifconfig... with no path...) which, on my debian laptop, is not in the default path... so I went and make a quick wrapper in ~/bin for it... right - now it can run that... still a NPE, hmm. So look a little closer, it's looking for the MAC address assigned to the IP that you're coming from... no, really! WTF! So I went and hacked my little ifconfig wrapper to rewrite the address for wlan0 to be what the KVM expected it to be, low and behold, I can now run the java client (hoorah!).

Why the heck are they doing that though - that's just plain insane! On the plus side, I now have a work around, on the minus side, egad that's ugly!

Posted: 2012-01-19 11:20 in Tech, and Work | permalink | Comments: 0

Things that annoy me #31294

I use rss2maildir.py to read rss feeds, it has a nifty feature whereby if a post is changed, it just gets tacked on to a thread for that post. There are 2 things that really annoy me with rss feeds, though - 1 is the people that don't include the full post in the rss feed, and the other is people that include a comment count in the rss feed.

I don't care how many comments are on the post, dammit. I'd deliberately go follow the post if I did, but having that comment count means that I get another one in the thread for NO REASON, the content of the post hasn't changed, dammit. This means that until that post drops out of the feed, every 30 minutes if the comment count has changed (and so the "content" of the feed changes) I get that post yet again and marked as new in my mailbox. Why does anyone put the comment count in the feed, does anyone really care?! If you want to link to comments from the feed, that's fine, just drop the count from it, and the content of the post wouldn't change, and I'd be happy.

Erm, comments are currently turned off here, until I manage to get round to turning on all the little spam prevention fun... just thought I'd have a whinge, really!

Posted: 2011-07-22 14:20 in Random, and Tech | permalink | Comments: 0

IPv6 Woes...

So, I'm in a bit of an odd situation where I've got 2 (sometimes 3) stateless ipv6 configurations hitting my laptop a lot of the time - I need to prefer only one of them for the default route, but obviously I'm getting served default routes all over the shop (because each radvd on that network is advertising itself as a default route too)... Now, on my laptop I actually deliberately set one of my own machines as a DNS server on the bringing up of a certain interface which happens to be v6 only, the problem is that only does recursive if you come from a fixed set of IPs, so I get sporadic dns failures if the laptop decides to use one of the other default v6 routes.

Now, being spoilt as I usually am by the kernel, I thought "Hmmm, obvious way to get round this would be to tell the kernel that $interface should have a default routing metric for the default route of 512 rather than 1024". Apparently that was a pipe dream, from what I can tell from the kernel source, routes added are given a metric of 256 if they are a directly advertised prefix, and 1024 if they are a default route, I couldn't see a way that you could at any point change that.

As this doesn't actually exist, and I just realised that I could advertise the route to the dns server (which is on a different /64 to the vpns /64), I'm now advertising that route - note, however, that for this to work you have to have enable a sysctl option to let it accept router advertisements for things that aren't the prefix it's getting or the default.

The way to enable that is

sudo sysctl net.ipv6.conf.interface.accept_ra_rt_info_max_plen=64

Which will enable anything up to a /64 prefix to be advertised at us.

Looking at how the kernel handles default routing tables, what would be really useful (to me at least) would be to be able to set default metrics per interface so that when a route is advertised at it it used the per interface metric rather than the (sortof) hardcoded kernel metrics.

Posted: 2011-04-06 14:03 in Tech | permalink | Comments: 0

Discovering Netgear ProSafe switches and IP Power 9258 devices

So, we have some netgear prosafe switches and some IP Power 9258 devices where I'm currently working, unfortunately, these don't always get the IP configuration that you'd expect (or, they get a DHCP lease from a DHCP server that I can't query the leases from...), however both come with little windows utilities that "magically" find the devices and give back (quite a lot, really) information on the IP configuration of the device. Being somewhat of a "oh god, I don't want to use windows, please don't make me" type person, and knowing the the IPPower 9258 boxes were going to a remote site where I'll only have linux machines on the same network as them, I figured that it would be a good idea to sit with wireshark and find out how the heck these tools worked.

Turns out that both just send out a UDP broadcast packet (or two) and then sit and wait for responses - this meant that to get the information that I wanted out of them I could get away with writing very little python, taking the UDP packet that I got back, taking the payload and dismantling it piece by piece so that I could display that information. The scripts aren't at all polished, but if anyone happens to need something (that should work multi-platform, too) to discover either of these, let me know and I can throw you what I've got.

Posted: 2010-09-07 22:00 in Tech | permalink | Comments: 0

So... shortened urls then...

Turns out that I do get shortened urls in twirssi if I manage to install libwww-shorten-perl, so having now installed that it appears that I've got a fairly much fully working twirssi, which is rather nice.

Posted: 2010-03-23 10:30 in Tech | permalink | Comments: 0

Twitter and irssi...

So, from the last post, it appears that most people got fed up with trying to get twirssi working in Lenny, and it was suggested that twircd was the viable alternative - I've not tried that (yet) mostly because it's PHP based, and (strangely) I try to avoid running any PHP unless I absolutely have to. Might be of interest to others though!

I'm likely to see about making a cleaner package of libnet-twitter-lite at some point over the next week (for Lenny), but for the moment it's mostly working (I'm fairly sure the URL shortening bit won't, but I haven't tested that yet... right - tested and it doesn't work - fairly sure that's because it relies on a newer version of LWP than in stable... so I'll add that to the list of things I need to work around :)

Posted: 2010-03-15 17:05 in Tech | permalink | Comments: 0

Getting twirssi working in Debian Lenny

So, I finally gave in and got my self a twitter account, it is (as one would guess) http://twitter.com/sommitrealweird, me, being me, I hate having to have lots of browser tabs open for things that I should be able to access in my IRC client, with twitter this is even more obvious that an IRC client is better for reading it, lots of short messages that are text, why would you need a browser tab for that? Also it means that I've got a log of the twitter messages and can look when I feel like it. All of my IRC is done from my main virtual machine, which is also my e-mail server and web server, and thus, it's running Debian stable (currently lenny), unfortunately this does not include the Net::Twitter library that twirssi relies on.

So, first step first, how much of a PITA would backporting Net::Twitter be... well, I took a look at the dependencies and went "Well, that looks like rather more effort than I want to put in right now", however I then found Net::Twitter::Lite, which you can satisfy the dependencies (well, sortof) in Lenny... they're a few versions out, but they're close...

First part was doing :

dh-make-perl --cpan Net::Twitter::Lite

Once that's finished you'll have a Net-Twitter-Lite-blah directory, which in turn contains a debian/ directory, so you can go in there and do:

dpkg-buildpackage -rfakeroot

That should tell you roughly what you're missing etc, from there you can check for the debian packages providing the missing libraries, and what versions they are. Install them and edit Makefile.PL to have the version numbers of the debian packages, you might also need to update debian/control to change some of it's restrictions.

Once all that is done, you should have a libnet-twitter-lite-perl package, install that and you're most of the way there.

I then cloned the twirssi source, and edited it to use Net::Twitter::Lite rather than Net::Twitter, my source is available via gitweb at http://git.sommitrealweird.co.uk/gitweb?p=twirssi-net-twitter-lite.git;a=summary. To clone do:

git clone git://git.sommitrealweird.co.uk/twirssi-net-twitter-lite.git/

or

git clone http://git.sommitrealweird.co.uk/twirssi-net-twitter-lite.git/

Hope that helps someone else out there! If you want my Net::Twitter::Lite package, let me know!

Posted: 2010-03-15 00:26 in Tech | permalink | Comments: 2

Of networking, bridging and ipv6 tunnels...

So, as I'm not always sitting directly in front of machines that I'm working on I've been using various tools to get temporary network connections between completely seperate network blocks, for example, sitting on wireless outside of my home, connecting back in to the desktop at home, and then connecting to the virtual machines on that desktop - the virtual machines are on their own private network, which is bridged and then routed through the desktop. The desktop machine has an ipv6 tunnel setup using tinc to my main VPS. That in turn has a tunnel setup to he.net's ipv6 network... I then have my laptop configured to also use tinc to connect to my VPS, so lots of ipv6 over ipv4, really.

From that I can then get a 'direct' ssh connection between my laptop and my desktop (OK, so it's actually going over 2 ipv6 over ipv4 tunnels to get there, but it "looks" direct), so, that gets me as far as the external network on that box. From here, we can run a vde_switch which is connected to a tun/tap interface that's part of the internal bridge, once we've got that running, I bring up another vde_switch on my laptop attached to another tun/tap interface purely for that network with a static ip configure on that interface... using the magic of dpipe I then connect the two vde_switches together using vde_plug, and as if by magic, I then have access to the internal networking of my virtual machines, meaning that I can now ssh directly in to the virtual machines without having to do anymore interesting ssh bouncing and port forwarding.

It's a little sick, but it really does make remote working a lot easier to do, it's a vpn of sorts, I suppose, as all traffic is being thrown over ssh pipes or tinc (which in turn is encrypted using x509 certificates)... probably not the quickest of networks, but very very nice all the same.

Posted: 2010-01-22 16:16 in Tech, and Work | permalink | Comments: 0

Firefox Paper Size

It appears that no matter what the system papersize is set to, and no matter what cups says is the default paper size, firefox, in its infinite wisdom locks it to being letter - this would probably be fine if I was in the US, but I'm not, and I want it to be A4...

So, the stages to go through to get it to do the right thing appear to be:

  • Goto about:config

  • Filter on print_paper_size

  • Change any bold (i.e. set) entries that are wrong to A4

This seems like something that should be much easier set, apparently using Page Setup only affects the current tab/window you are in and doesn't change the default, which is just odd.

Posted: 2009-10-09 10:03 in Tech | permalink | Comments: 1

Random Storage Idea...

So, I was reading some random mumblings on the interwebs, and the pigeon with USB stick being a quicker method of data transfer in SA than their intertubes... then there was a thread on a mailing list discussing this, and someone mentioned using stacks of microSD cards... so then my brain decided to launch itself orthogonally, as it often does. What we end up with is wondering just how much storage you could fit in to the space a 3.5" drive would normally take - not taking in to account any method of attaching it at this point. So, a 3.5" drive is approx 102mmx147mmx26mm, a microSD card is 11mmx15mmx1mm, so, assuming that we're just lying them side by side, and not optimising the way they're stored at all, you can fit (with space round the sides) 9*9*26 = 2106 microSD cards in the area of a 3.5" drive. Assuming that each of those is 16G that's just shy of 33.7TB of storage!

So, that set me thinking a bit further... I reckon that in that space you could do a 6*6 grid of cards with room for connectors, and just about get it to 10 high...so, that's 360 microSD cards, and probably enough room for some control gear (haven't worked out quite what we'd use for that), I then went in to wondering if we could then create a small embedded system to talk to those 360 microSD cards, if we did that then you could potentially do RAID0 across the "platters" with RAID6 on each platter. Now, to my poor head that meant that there should be 340*16G of available storage, which is 5.44TB... of course, that involves somehow interfacing the 360 microSD cards... I'm thinking that it might be possible with some form of embedded system...

Unfortunately, it appears that to actually build this with consumer components... and without including the interface gear which I haven't even begun to work out yet... we're talking around about £26 per microSD card, so, erm, £9360... but I still think it'd be a really neat project... now, if someone can arrange for me to win the lottery, have lots of spare time, and some more brain power... :)

Oh dear... my brain appears to have ticked further through, and I've realised that with spacing between each microSD card, you could, in theory, easily fit 400 of them upended in the space available. Erm. Of course, this still doesn't answer the "how the hell do you then get them all to talk in any sane manner" question... but I'm sure that will work out in my head sometime...

Posted: 2009-09-13 20:01 in Random, and Tech | permalink | Comments: 7

LVM weirdness - solution found...

ARGH! So, now I know the issue, the disk was created with a standard dos partition table... this won't extend past the bit that I'm at... it needs to be GPT, so there's going to need to be some downtime to sort it out. SIGH.

Posted: 2009-09-09 18:25 in Tech, and Work | permalink | Comments: 0

LVM weirdness

I'm having some issues with LVM, basically it appears that I can't assign over a certain amount of my pv, where that certain amount is somewhere around 1.5TB... output from all the relevant chunks are:

ensenada:~# lvdisplay
  --- Logical volume ---
  LV Name                /dev/main/root
  VG Name                main
  LV UUID                ZR33WS-glE2-bUn6-adCX-n50C-37eX-Fc7Pde
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                7.45 GB
  Current LE             1907
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           254:0

  --- Logical volume ---
  LV Name                /dev/main/voldemort
  VG Name                main
  LV UUID                DrT0co-THRw-6Zcy-Q3PT-OiQj-4KBz-xfV0Un
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                1.37 TB
  Current LE             358400
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           254:1

ensenada:~# vgdisplay
  --- Volume group ---
  VG Name               main
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  56
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                2
  Open LV               2
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               5.45 TB
  PE Size               4.00 MB
  Total PE              1428053
  Alloc PE / Size       360307 / 1.37 TB
  Free  PE / Size       1067746 / 4.07 TB
  VG UUID               ddVSIr-W9BU-XOWJ-gdSo-HZ4m-vw3M-S33Q3s

ensenada:~# pvdisplay
  --- Physical volume ---
  PV Name               /dev/sda3
  VG Name               main
  PV Size               5.45 TB / not usable 1.54 MB
  Allocatable           yes
  PE Size (KByte)       4096
  Total PE              1428053
  Free PE               1067746
  Allocated PE          360307
  PV UUID               sFxRYg-Ua60-zpMT-DMqo-tpD5-d24W-qfW31p

ensenada:~# lvcreate -n test -L 74G main
  Logical volume "test" created
ensenada:~# pvs
  PV         VG   Fmt  Attr PSize PFree
  /dev/sda3  main lvm2 a-   5.45T 4.00T
ensenada:~# lvs
  LV        VG   Attr   LSize  Origin Snap%  Move Log Copy%  Convert
  root      main -wi-ao  7.45G
  test      main -wi-a- 74.00G
  voldemort main -wi-ao  1.37T
ensenada:~# lvremove /dev/main/test
Do you really want to remove active logical volume "test"? [y/n]: y
  Logical volume "test" successfully removed
ensenada:~# lvcreate -n test -L 75G main
  device-mapper: reload ioctl failed: Invalid argument
  Aborting. Failed to activate new LV to wipe the start of it.
  LV main/test in use: not deactivating
  Unable to deactivate failed new LV. Manual intervention required.
ensenada:~# lvremove /dev/main/test
Do you really want to remove active logical volume "test"? [y/n]: y
  Logical volume "test" successfully removed
ensenada:~# lvcreate -n test -L 74G main
  Logical volume "test" created
ensenada:~# lvremove /dev/main/test
Do you really want to remove active logical volume "test"? [y/n]: y
  Logical volume "test" successfully removed
ensenada:~#

Please, someone, put me out of my misery - this is driving me nuts!

Extra info:

ensenada:~# uname -a
Linux ensenada 2.6.26-2-amd64 #1 SMP Fri Aug 14 07:12:04 UTC 2009 x86_64 GNU/Linux
ensenada:~# dpkg -l lvm2
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name                  Version               Description
+++-=====================-=====================-==========================================================
ii  lvm2                  2.02.39-7             The Linux Logical Volume Manager
ensenada:~#
ensenada:~# cat /etc/debian_version
5.0.1

(Erm, just remembered that I haven't got comments enabled at the mo, so if you've got fixes, please mail me! iDunno@sommitrealweird.co.uk - thanks!)

Posted: 2009-09-09 16:07 in Tech, and Work | permalink | Comments: 0

XKB and xsessionrc

So, for a while now I've been using xmodmap to remap my caps lock key off to mod4 to make using awesome just that little easier... although my laptop has got a 'Windows' key, it's in an awkward place for general use, whereas caps lock is in a somewhat more convenient place. Also, not wanting to make it system wide (you never know, someone else might want to use the laptop at some point, at which point it'd be a different user), I wanted to keep with something close to the xmodmap method of just replacing bits as we needed 'em.

As I upgraded the laptop yesterday, various things broke (not least of all, my awesome config, as the theme format had changed to lua, and my theme, erm, broked it), I changed from it using my ~/.xsession for starting the things that I want to using the default Xsession foo, fortunately this sources a .xsessionrc file, which is handy.

So, using hints from madduck's post about extending xkb, I setup a very simple mapping that just adds in the Caps Lock -> Mod4 override, which is nice and handy.

I then just use:

[ -r $HOME/.xkb/keymaps/default ] && xkbcomp -I$HOME/.xkb $HOME/.xkb/keymaps/default $DISPLAY

in my .xsessionrc to setup the keyboard with the right settings, the default keymap in $HOME/.xkb/keymaps is simply the output of setxkbmap -print, edited to add +brettp(caps_mod4) to the symbols, the +brettp(caps_mod4) is a copy of madducks partial for that, i.e. there is a file $HOME/.xkb/symbols/brettp that contains:

// caps_mod4: make capslock generate the mod4 modifier
partial modifier_keys
xkb_symbols "caps_mod4" {
  replace key <CAPS> {
    [ VoidSymbol, VoidSymbol ]
  };
  modifier_map Mod4 { <CAPS> };
};

Looks a little cleaner than using xmodmap, and might mean that firing off Xnest sessions might stop breaking things!

Posted: 2009-08-16 14:13 in Tech | permalink | Comments: 0

New Website Design...

It's been a long long time since I last posted anything at all, so this is a post to warn of impending doom. I've switched from a static html website (well, it was statically generated when I edited source files I then ran a bash script that fired off a perl script several times...) to a fully dynamic, django 1.0 backed website - this might mean that I manage to update things more often!

I've also taken the opportunity to convert the previous content in to ReST, so it's actually easier to edit too. There's still work to do - but it's now "good enough" to be used, and I'll split the code out in to better chunks later on.

So, anyways - that's what I've done with my day - so I expect all the aggregators to now break on the new feeds...

Posted: 2009-04-04 17:40 in Life, and Tech | permalink | Comments: 0

More on rss2maildir.py...

Just to confirm, yes, I do know of rss2email - it has the unfortunate side effect of needing an MTA configured to process the rss feeds and seperate them in to seperate maildirs, basically I wanted something that would write straight to the maildir for me because then I don't have to think about the config for the MTA on each machine that I want to use it on.

Thanks to Martin for the suggestion of pandoc, I'll take a look at that over the next few days to see if it'll make the "plain text" generation slightly neater than the current HTMLParser based code.

Posted: 2007-12-21 12:12 in Tech | permalink | Comments: 0

rss2maildir.py

I've been looking for a decent way to read rss feeds for a bit, I've finally given in to the fact that there's actually nothing about that I feel comfortable with... so, what I've started is writting a simple rss to maildir convertor (I know there's toursst, but that appears to want a galleon bookmarks file and appears to use deprecated bits of python). At the moment it is very very basic, there's still a way to go before I'll be fully happy with it, but it's much nicer being able to read rss using mutt than Yet Another Random Program, I'll be hacking up a mutt config to make it look different to e-mail later, but for now as it's still in testing phases, I'm just testing with a bog standard mutt config.

I've made the code available through a git repository that should (when DNS has finished updating) be available with a git clone git://git.sommitrealweird.co.uk/rss2maildir.git/ before that it should be available from git clone http://miranda.sommitrealweird.co.uk/~brettp/rss2maildir.git/ .

The HTML -> Text parser still needs some work, I'm mostly aiming for it to take HTML and generate almost OK ReST which is easier to read in a text mail client. It still needs paragraph wrapping etc, but I'll work on those over time.

If anyones interested, or wants to get involved, or has some nicer ideas for how to make it work, as always I can be contacted at iDunno@sommitrealweird.co.uk :)

Posted: 2007-12-20 21:31 in Tech | permalink | Comments: 0

Update to bpgallery

Just after having made the 1.1.0 release I discovered an annoying bug in that version that meant using caption files made it fail in new and interesting ways, I've now fixed the bug and released bpgallery 1.1.1 which fixes this.

Posted: 2007-05-14 08:32 in Tech | permalink | Comments: 0

New bpgallery available, and xmms-scrobbler work...

I've taken over upstream development of xmms-scrobbler, it's now hosted at http://xmms-scrobbler.sommitrealweird.co.uk/ and has a public readonly git repository for the code. Since taking over development I've dropped a lot of the tag parsing code and replaced it with taglib, found some "interesting" locking issues and am now looking at making it so that we don't need to restart it when adding username/password. It'd also be good to get it to actually report a username/password breakage at least once rather than being totally silent about it!

In other news, I've just released a new version of bpgallery, this version adds in medium sized pages - i.e. you can have the index page, the index page links to pages that have a resized image on the page, and has next/previous links. If you also generate full sized pages then the link from the image on the medium sized page goes to the full sized page, otherwise it'll go straight to the origional image.

Also thinking about making a last.fm "client" for xmms so that I can keep all my music playing in the one place (lastfmproxy appears to have stopped working for me :/)

Posted: 2007-05-13 12:00 in Tech | permalink | Comments: 0

Stuff, potentially a bit random

So, found GlusterFS today, looks quite interesting, may have to play when I've got some spare tuits...

Also, I'm about to take over upstream development of xmms-scrobbler, so currently thinking of which revision control system to use... I'm very tempted to use tla because I know it and use it for everything else that I do, but I've been tempted by the evils that are git, hg and bzr... most likely going with tla because it makes the most sense to my often broken little mind, and I like the abrowse command rather too much :)

What else? Probably lots of stuff, oh, looking for a nice multiple project group type build daemon - we've got 4 main branches of a piece of software at work, and packages should be auto built for each of the branches on a commit (ish) - we're currently running 4 copies of cruise control to build the debian packages, that's a little bit on the heavy side, though - and all it'd need to make it actually work for me would be to have a project group config option, so you can assign a number of processes per project group... but it doesn't have that - I just discovered CruiseControl.rb, which is a bit lighter, but it's still not quite what I'm after. May end up writting a small python buildd to deal with it instead, and hook it in to the svn repository with some post commit hooks.

Also got a whole lot of Nagios configuration to finish off to monitor a bunch of servers.

So, that's a small brain dump... more when I remember what the hell it was that I was supposed to be doing - been a hectic day!

Posted: 2007-04-19 17:56 in Tech | permalink | Comments: 0

Oh Noes! This means lots of work!

Debian GNU/Linux 4.0 has been released - congratulations to all those involved in the release process, you've all done a fantastic job (as always ;). Now I've just got to test the upgrade for the NFS root desktop machines at work (that's going to be sooo much fun!) and make sure that nothing obvious breaks - I'm not expecting many problems, it should go quite smoothly (probably!).

Might also use the "official" non-free packages for the sun j2sdk rather than using java-package, haven't decided yet (and actually, as we also use sun-j2sdk1.4, I'm going to have to use java-package for that anyways!).

Hmmm, I suppose I should update all of my various build chroots and set up all the scripts that I'm going to need also - feh - that can wait for a bit.

Ahh - and I'm going to need to compile an etch version of ion3 from unstable, can't be having my workstation running one of those dodgy window managers that makes it almost impossible to get anything done without using the mouse, afterall!

Right - anyways - I think I shall just go faint, that was far too quick between sarge and etch!

Posted: 2007-04-08 14:40 in Tech | permalink | Comments: 0

Pages: 1 | 2 | 3 | 4 | Next