HOWTO: Use a v3i as a USB GPRS modem on t-mobile UK

First of all, set your USB connection to ‘Data/Fax Connection’ rather than MemoryCard (Settings -> Connection -> USB Settings) and connect to the PC. Wait for Windows to install the drivers. If you don’t have a driver CD, use connect to the internet to find the latest drivers. (This works under XP, other OSes are untested).

Configure the Modem’s INIT string
Start > Settings > Control Panel > Phone and Modem Options > Choose your modem > Click Properties > Choose tab Advanced > At Extra initialization commands, enter code: AT+CGDCONT=2,”IP”,”general.t-mobile.uk” > OK
Connection Installation
Start > Control Panel > Network Connections > New Connection Wizard > Next > Connect to the Internet > Next > Set up my connection manually > Next > Connect using a dial up modem > Next > Choose your modem > Next > Type ‘t-mobile GPRS’ > Next > Type *99***1# > Next > Type in box Username : wapuser > Type in box Password : wap > Type in box Confirm : wap > Next > Finish

These instructions may also work using the modem over Bluetooth, but you won’t have the handy advantage of charging the phone whilst using it as a modem from one cable.

Posted in Uncategorized | Leave a comment

Reinstalling XP on a Toshiba NB100

Sounds like a simple task, but I’ve battled this confounded machine most of this morning, however … I now have a solution!

1) Problems with Stop Errors during XP setup.
These were likely caused by a broken partition table (possibly caused by some nastyness that prompted the reinstall in the first place)
Solution: Boot Ubuntu-on-a-stick and toast the partition table using dd if=/dev/zero of=/dev/sda bs=512 count=1

2) XP Setup not finding any hard drives
Solution – Set SATA mode to compatible in the bios (note, doing this will mean ubuntu-on-a-stick will no longer see the drive!)

3) XP can’t see the CD drive during the GUI mode of the setup
Solution – Turn off Legacy USB support in the BIOS (The CD Drive will likely stop being bootable)

And this is just so far …!

Posted in Uncategorized | Leave a comment

Andrew’s Laws

1. The more user friendly an interface is, the more complex the SQL behind it is.

Posted in Uncategorized | Leave a comment

And it is done!

Copyright (c) 1992-2010 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 8.1-RELEASE #0: Mon Jul 26 09:38:12 BST 2010
root@skynet.avatastic.co.uk:/usr/src/sys/amd64/compile/SKYNET amd64
Timecounter “i8254″ frequency 1193182 Hz quality 0
CPU: Intel(R) Atom(TM) CPU 330 @ 1.60GHz (1601.97-MHz K8-class CPU)
Origin = “GenuineIntel” Id = 0x106c2 Family = 6 Model = 1c Stepping = 2
Features=0xbfe9fbff
Features2=0x40e31d
AMD Features=0×20000800
AMD Features2=0×1
TSC: P-state invariant
real memory = 1073741824 (1024 MB)
avail memory = 1016123392 (969 MB)
ACPI APIC Table:
FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs
FreeBSD/SMP: 1 package(s) x 2 core(s) x 2 HTT threads
cpu0 (BSP): APIC ID: 0
cpu1 (AP/HT): APIC ID: 1
cpu2 (AP): APIC ID: 2
cpu3 (AP/HT): APIC ID: 3
ioapic0: Changing APIC ID to 4
ioapic0 irqs 0-23 on motherboard
kbd1 at kbdmux0
acpi0: on motherboard
acpi0: [ITHREAD]
acpi0: Power Button (fixed)
acpi0: reservation of 0, a0000 (3) failed
acpi0: reservation of 100000, 3f700000 (3) failed
Timecounter “ACPI-fast” frequency 3579545 Hz quality 1000
acpi_timer0: <24-bit timer at 3.579545MHz> port 0×808-0x80b on acpi0
cpu0: on acpi0
cpu1: on acpi0
cpu2: on acpi0
cpu3: on acpi0
pcib0: port 0xcf8-0xcff on acpi0
pci0: on pcib0
vgapci0: port 0xcc00-0xcc07 mem 0xfe980000-0xfe9fffff,0xe0000000-0xefffffff,0xfe940000-0xfe97ffff irq 16 at device 2.0 on pci0
agp0: on vgapci0
agp0: detected 7932k stolen memory
agp0: aperture size is 256M
pci0: at device 27.0 (no driver attached)
pcib1: irq 16 at device 28.0 on pci0
pci2: on pcib1
pcib2: irq 17 at device 28.1 on pci0
pci1: on pcib2
re0: port 0xd800-0xd8ff mem 0xfdeff000-0xfdefffff,0xfdef8000-0xfdefbfff irq 17 at device 0.0 on pci1
re0: Using 1 MSI messages
re0: Chip rev. 0×28000000
re0: MAC rev. 0×00000000
miibus0: on re0
rgephy0: PHY 1 on miibus0
rgephy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, 1000baseT-FDX, auto
re0: Ethernet address: 00:25:22:34:93:30
re0: [FILTER]
uhci0: port 0xc400-0xc41f irq 23 at device 29.0 on pci0
uhci0: [ITHREAD]
uhci0: LegSup = 0x2f00
usbus0: on uhci0
uhci1: port 0xc480-0xc49f irq 19 at device 29.1 on pci0
uhci1: [ITHREAD]
uhci1: LegSup = 0x2f00
usbus1: on uhci1
uhci2: port 0xc800-0xc81f irq 18 at device 29.2 on pci0
uhci2: [ITHREAD]
uhci2: LegSup = 0x2f00
usbus2: on uhci2
uhci3: port 0xc880-0xc89f irq 16 at device 29.3 on pci0
uhci3: [ITHREAD]
uhci3: LegSup = 0x2f00
usbus3: on uhci3
ehci0: mem 0xfe937c00-0xfe937fff irq 23 at device 29.7 on pci0
ehci0: [ITHREAD]
usbus4: EHCI version 1.0
usbus4: on ehci0
pcib3: at device 30.0 on pci0
pci3: on pcib3
fxp0: port 0xec00-0xec3f mem 0xfebff000-0xfebfffff,0xfebc0000-0xfebdffff irq 21 at device 0.0 on pci3
miibus1: on fxp0
inphy0: PHY 1 on miibus1
inphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
fxp0: Ethernet address: 00:02:b3:eb:24:48
fxp0: [ITHREAD]
isab0: at device 31.0 on pci0
isa0: on isab0
atapci0: port 0x1f0-0x1f7,0x3f6,0×170-0×177,0×376,0xffa0-0xffaf at device 31.1 on pci0
ata0: on atapci0
ata0: [ITHREAD]
atapci1: port 0xc080-0xc087,0xc000-0xc003,0xbc00-0xbc07,0xb880-0xb883,0xb800-0xb80f irq 19 at device 31.2 on pci0
atapci1: [ITHREAD]
ata2: on atapci1
ata2: [ITHREAD]
ata3: on atapci1
ata3: [ITHREAD]
pci0: at device 31.3 (no driver attached)
acpi_button0: on acpi0
atrtc0: port 0×70-0×71 irq 8 on acpi0
uart0: <16550 or compatible> port 0x3f8-0x3ff irq 4 flags 0×10 on acpi0
uart0: [FILTER]
orm0: at iomem 0xcb000-0xcc7ff on isa0
sc0: at flags 0×100 on isa0
sc0: VGA <16 virtual consoles, flags=0x300>
vga0: at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0
atkbdc0: at port 0×60,0×64 on isa0
atkbd0: irq 1 on atkbdc0
kbd0 at atkbd0
atkbd0: [GIANT-LOCKED]
atkbd0: [ITHREAD]
p4tcc0: on cpu0
p4tcc1: on cpu1
p4tcc2: on cpu2
p4tcc3: on cpu3
Timecounters tick every 1.000 msec
ipfw2 (+ipv6) initialized, divert enabled, nat enabled, rule-based forwarding disabled, default to accept, logging disabled
load_dn_sched dn_sched QFQ loaded
load_dn_sched dn_sched RR loaded
load_dn_sched dn_sched WF2Q+ loaded
load_dn_sched dn_sched FIFO loaded
load_dn_sched dn_sched PRIO loaded
usbus0: 12Mbps Full Speed USB v1.0
usbus1: 12Mbps Full Speed USB v1.0
usbus2: 12Mbps Full Speed USB v1.0
usbus3: 12Mbps Full Speed USB v1.0
usbus4: 480Mbps High Speed USB v2.0
ad0: 76319MB at ata0-master UDMA100
ugen0.1: at usbus0
uhub0: on usbus0
ugen1.1: at usbus1
uhub1: on usbus1
ugen2.1: at usbus2
uhub2: on usbus2
ugen3.1: at usbus3
uhub3: on usbus3
ugen4.1: at usbus4
uhub4: on usbus4
ad1: 78533MB at ata0-slave UDMA100
SMP: AP CPU #1 Launched!
SMP: AP CPU #3 Launched!
SMP: AP CPU #2 Launched!
Root mount waiting for: usbus4 usbus3 usbus2 usbus1 usbus0
uhub0: 2 ports with 2 removable, self powered
uhub1: 2 ports with 2 removable, self powered
uhub2: 2 ports with 2 removable, self powered
uhub3: 2 ports with 2 removable, self powered
Root mount waiting for: usbus4
Root mount waiting for: usbus4
Root mount waiting for: usbus4
uhub4: 8 ports with 8 removable, self powered
Trying to mount root from ufs:/dev/ad0s1a

Posted in Uncategorized | Leave a comment

Cygwin/X and ssh forwarding with PuTTY

1. Install Cygwin/X as per the instructions at http://x.cygwin.com/docs/ug/setup-cygwin-x-installing.html
2. On the remote host, make sure that the xauth package is installed (apt-get install xauth / cd /usr/ports/x11/xauth && make install clean / etc)
3. In PuTTY make sure that ‘Enable X11 Forwarding’ is checked under Connection/SSH/X11
4. Enjoy.

Posted in Uncategorized | Leave a comment

The future is bright, the future is … green?

After years of hosting everything on Skynet on a series of home built PCs, I’ve migrated most of the hosted services to the good fellows at bytemark and I’m scaling skynet back to a leaner, greener machine.
Starting with a move to an ASRock A330GS. Future changes will include scaling back the PSU and getting a greener hard drive.

Posted in Uncategorized | Tagged , | Leave a comment

Things todo

* NSLU2 into 3g wireless modem
* Aberddu mail forwarder
* Finish nav for VMBU

Posted in Uncategorized | Tagged | Leave a comment

Moving from userland natd to kernel mode nat

For many many years, I’ve been happily running ppp, ipfw and natd on my FreeBSD router, starting in the early days with ppp -nat before needing more refined control and moving to userland natd.

Then I learned about kernel mode nat in ipfw2 so I thought I’d give that a go.

What had to be done:
Adding the following to the kernel config:
options LIBALIAS
options IPFIREWALL_NAT
If you don’t want to use a custom kernel, (and from looking at the rc.d script) you should be able to set firewall_nat_enable=”YES” in /etc/rc.conf and the correct module will be loaded on boot.

Removing:
add 50 divert natd all from any to any via tun0
from /etc/rc.firewall.script
Adding:
nat 1 config if tun0 log unreg_only
add 50 nat 1 ip4 from any to any via tun0
to /etc/rc.firewall.script

If you are using an Open or Client firewall, you can set:
firewall_nat_enable=”YES”
firewall_nat_interface=”tun0″
firewall_nat_flags=”unreg_only”
in /etc/rc.conf
And don’t forget to set:
natd_enable=”NO” in /etc/rc.conf if you’re switching from userland natd.

That’s got it working just as ipfw+natd used to, the stability/speed tests and real world usage remains to be seen …

Posted in Uncategorized | Tagged | 1 Comment

Fun with maildrop

Whilst I’m awaiting the resurrection of my /home drive I’ve had to resort to collecting my mail and storing it under a temporary account.

I decided to make a few changes to skynet based on the fact my spambayes db was stored on /home along with my .procmailrc so SpamAssassin was integrated with sendmail and maildrop was set as the system-wide LDA.

Here is a fun line from my new (and still developing) .mailfilter file.
if ( /^List-Id:.+\<freebsd-(.*)\.freebsd\.org\>$/ )
TARGET="FreeBSD."$MATCH1""

Which automatically puts FreeBSD mailing list items in to their own folder.

To clear up what was in my ever growing Inbox, it was a simple case of running

for file in *; do cat $file | maildrop; done in a copy of ~/Mail/cur

Whilst its not quite as defined as my old .procmailrc I think I may like maildrop …

Posted in Uncategorized | Tagged , , | Leave a comment

New skynet feature.

A new feature has been added to Skynet today, a self-managed service monitor.

The script is provided below and is free for use on a beerware license.

As usual its FreeBSD only.

Enjoyu!

—begin—
#!/bin/sh

PATH=/sbin:/bin:/usr/sbin:/usr/bin

. /etc/rc.subr
load_rc_config ‘XXX’

unset local_rc

find_local_scripts_new
servers=$(rcorder -s nostart ${local_rc} 2>/dev/null)

check_pid () {
if [ -z "$6" ]
then
# no 6th paramater, assume not running
return 0
else
pid=${6%%.*}
return $(ps -ax ${pid} | grep ${pid} | wc -l)
fi
}
for server in ${servers}
do
check_pid $(${prefix}${server} status)
if [ ${?} -eq 0 ]
then
${prefix}${server} start > /dev/null 2>&1
fi
done

Posted in Uncategorized | Tagged , | Leave a comment