Archive for the 'Geekery' Category

irssi, bitlbee, jabber, openfire and ASCII Control Characters

Wednesday, August 7th, 2013

I’ve recently been hit by an issue where irssi (and bitlbee, and openfire) have been leaking non-printable ASCII Control characters to a Jabber chat room.

This has been triggering an XML Parse Error in Pidgin clients, which causes them to disconnect and reconnect to the Jabber server. This is especially annoying when the server replays chat history to clients. You end up with all Pidgin clients unable to stay connected to your Jabber server. Oops.

I’ve written a quick hacky script for irssi that filters out non-ASCII characters, so they’re not sent to the server and that warns you that you’re doing somethig wrong:

use Irssi;
use strict;
 
use vars qw($VERSION %IRSSI);
 
$VERSION = "0.1";
%IRSSI = (
    authors     => 'Andy Millar',
    name        => 'filter_charset',
    description => 'Filter Outbount Charset',
    license     => 'none',
    url         => 'none',
);
 
 
Irssi::signal_add_first 'send text', 'filter_charset';
 
sub filter_charset {
  my ($text, $server, $win_item) = @_;
  if ($text =~ m/[^[:print:]]/) {
    Irssi::active_win->print("Cannot send line - invalid characters: ##$text##", MSGLEVEL_CLIENTCRAP);
    Irssi::signal_stop();
  }
}

Put this in ~/.irssi/scripts/filter_charset.pl and then /load filter_charset.pl.

Logon failure: the user has not been granted the requested logon type at this computer

Saturday, November 12th, 2011

If you get the error:

Logon failure: the user has not been granted the requested logon type at this computer

When trying to add a computer to a domain or trying to map a network drive, then chances are someone has been stupid.

Check rsop to make sure that the following policy hasn’t been changed to anything silly:

Administrative Tools
> Local Security Settings
>> Local Policies
>>> User Rights Assignment
>>>> Access this computer from the network

This should probably be the list that is suggested in the explanation for this policy and at least include Authenticated Users.

Orange 3G with Fedora 13

Monday, June 27th, 2011

Orange’s 3G internet dongle is a HUAWEI E1752.

By default, this doesn’t appear to be detected by NetworkManager with Fedora 13.

This is because it requires usb_modeswitch to work. Installing the usb_modeswitch package fixed it and the dongle was picked up by NetworkManager.

disown: Bash Builtin

Thursday, October 28th, 2010
1
2
3
4
5
6
7
8
9
10
11
12
13
14
disown [-ar] [-h] [jobspec ...]
  Without options, each jobspec is removed from the table
  of active jobs. If jobspec is not present, and neither
  -a nor -r is supplied, the shell's notion of the
  current job is used.  If the -h option is given,  each
  job-spec is not removed from the table, but is marked
  so that SIGHUP is not sent to the job if the shell 
  receives a SIGHUP.  If no jobspec is present, and neither
  the -a nor the -r option is supplied, the current job is
  used. If no jobspec is supplied, the -a option means to
  remove or mark all jobs; the -r option without a jobspec
  argument restricts operation to running jobs.  The
  return value is 0 unless a jobspec does not specify a 
  valid job.

Quickly setting ERC accross all sd* devices

Sunday, April 11th, 2010

ERC (Error Recovery Control) is used to determine how long a hard drive should wait before giving up and declaring a sector as unreadable.

On most desktop drives, where you do not have another copy in RAID, you want the drive to keep re-trying for ever.

When you’re running drives in RAID, however, you want the drive to error out quickly and allow a spare to be mirrored in.

If you want to use a Desktop HDD in your RAID array, consider running:

smartctl -l scterc,70,70 /dev/sda

This will set the timeout to 7 seconds, a relatively reasonable length of time to wait.

If you’re in the situation of having a large number of drives attached via conventional SATA controllers, like I do, you’ll probably want to make this a little easier. You can run:

for i in `ls /dev/sd[a-z]` ; do 
    smartctl -l scterc,70,70 $i ; 
done

For more details, you will want to have a read of this page.

Installing Linux on a Thecus n8800Pro

Sunday, April 11th, 2010

The Thecus n8800Pro is a 2U, 8 drive, inexpensive storage array. It comes with a pretty GUI running what appears to be embedded Linux. Clearly I had to get a normal Linux distribution running on there!

A quick Google on installing Linux on other Thecus models suggests that they are standard x86 hardware and perfect to get Linux onto.

The first thing you’ll notice is that there’s no VGA port on the back of the device:

No VGA Port

Not to matter, there is a header on the motherboard for VGA:

There are headers!

First things first, you need a VGA cable, some pliers and other cutting instruments:

Tools you will need

Carefully remove the blue plastic case and as much metal as you can from the cable, you should end up with something looking like this:

Stripped Cable End

Next, you’ll want to ease your new plug into the holes on the motherboard. Use paper to insulate any metal parts of your plug from unintentional contacts on the motherboard. You’ll need to use something to hold the plug in place, paper works well. You may need to wiggle the cable a little to get signal:

The plug is in place with paper

Once you’ve got the cable in place, a quick reboot of the Thecus will give you the option to press DEL to enter the Phoenix BIOS:

Phoenix BIOS

Now you’ll need to change the boot order to allow your device to boot from USB CD-ROM before the Hard Disk. I couldn’t get LAN(PXE) booting to work. Then you’ll be able to boot from a CD and install an operating system of your choice.

A few useful bits of output:

lspci

00:00.0 Host bridge: Intel Corporation Mobile 945GME Express Memory Controller Hub (rev 03)
00:02.0 VGA compatible controller: Intel Corporation Mobile 945GME Express Integrated Graphics Controller (rev 03)
00:1c.0 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 1 (rev 02)
00:1c.1 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 2 (rev 02)
00:1c.2 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 3 (rev 02)
00:1c.3 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 4 (rev 02)
00:1c.4 PCI bridge: Intel Corporation 82801GR/GH/GHM (ICH7 Family) PCI Express Port 5 (rev 02)
00:1c.5 PCI bridge: Intel Corporation 82801GR/GH/GHM (ICH7 Family) PCI Express Port 6 (rev 02)
00:1d.0 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #1 (rev 02)
00:1d.1 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #2 (rev 02)
00:1d.2 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #3 (rev 02)
00:1d.3 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #4 (rev 02)
00:1d.7 USB Controller: Intel Corporation 82801G (ICH7 Family) USB2 EHCI Controller (rev 02)
00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev e2)
00:1f.0 ISA bridge: Intel Corporation 82801GHM (ICH7-M DH) LPC Interface Bridge (rev 02)
00:1f.1 IDE interface: Intel Corporation 82801G (ICH7 Family) IDE Controller (rev 02)
00:1f.2 SATA controller: Intel Corporation 82801GBM/GHM (ICH7 Family) SATA AHCI Controller (rev 02)
00:1f.3 SMBus: Intel Corporation 82801G (ICH7 Family) SMBus Controller (rev 02)
01:00.0 Ethernet controller: Intel Corporation 82574L Gigabit Network Connection
02:00.0 Ethernet controller: Intel Corporation 82574L Gigabit Network Connection
03:00.0 Mass storage controller: Silicon Image, Inc. SiI 3132 Serial ATA Raid II Controller (rev 01)
04:00.0 Mass storage controller: Silicon Image, Inc. SiI 3132 Serial ATA Raid II Controller (rev 01)
05:00.0 Mass storage controller: Silicon Image, Inc. SiI 3132 Serial ATA Raid II Controller (rev 01)
06:00.0 Mass storage controller: Silicon Image, Inc. SiI 3132 Serial ATA Raid II Controller (rev 01)

cat /proc/cpuinfo

processor    : 0
vendor_id    : GenuineIntel
cpu family    : 6
model        : 15
model name    : Intel(R) Core(TM)2 CPU         T5500  @ 1.66GHz
stepping    : 2
cpu MHz        : 1000.000
cache size    : 2048 KB
physical id    : 0
siblings    : 2
core id        : 0
cpu cores    : 2
apicid        : 0
fpu        : yes
fpu_exception    : yes
cpuid level    : 10
wp        : yes
flags        : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca
                 cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm
                 syscall nx lm constant_tsc pni monitor ds_cpl vmx est tm2
                 cx16 xtpr lahf_lm
bogomips    : 3333.64
clflush size    : 64
cache_alignment    : 64
address sizes    : 36 bits physical, 48 bits virtual
power management:
 
processor    : 1
vendor_id    : GenuineIntel
cpu family    : 6
model        : 15
model name    : Intel(R) Core(TM)2 CPU         T5500  @ 1.66GHz
stepping    : 2
cpu MHz        : 1000.000
cache size    : 2048 KB
physical id    : 0
siblings    : 2
core id        : 1
cpu cores    : 2
apicid        : 1
fpu        : yes
fpu_exception    : yes
cpuid level    : 10
wp        : yes
flags        : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca
                 cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm
                 syscall nx lm constant_tsc pni monitor ds_cpl vmx est tm2
                 cx16 xtpr lahf_lm
bogomips    : 3333.13
clflush size    : 64
cache_alignment    : 64
address sizes    : 36 bits physical, 48 bits virtual
power management:

IPv6 is finally here!

Saturday, April 10th, 2010

caffeine is ipv6 ready

caffeine.andymillar.co.uk is now fully ipv6 enabled!

[root@caffeine ~]# host www.andymillar.co.uk
www.andymillar.co.uk has address 212.13.201.140
www.andymillar.co.uk has IPv6 address 2001:ba8:0:1c7::d40d:c98c