Wednesday, June 25, 2008

Vista Caps-Lock to Control Re-Mapping

Abbreviated from here: Windows Scancode Mapping.

This is the caps/ctrl swap without the ctrl->caps side.

caps2ctl.reg:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
"Scancode Map"=hex:00,00,00,00,00,00,00,00,20,00,00,00,1d,00,3a,00,00,00,00,00

Sunday, June 15, 2008

IPV6 OpenWrt Kamikaze.

This is mostly an adaptation of various ipv6 install bits around.
Kamikaze is a little different, and the documentation isn't entirely
complete -- so I thought I would reproduce what I did in here. It isn't
perfect, but it is working for my /64 delegations of the /48 I have
routed to my fat-pipe machine.

Names changed to protect the innocent.


ipkg install kmod-ipv6
ipkg install radvd
ipkg install ip
ipkg install kmod-ip6tables
ipkg install ip6tables


/etc/hotplug.d/iface/10-ipv6:

. /etc/functions.sh
NAME=ipv6
COMMAND=/usr/sbin/ip
IPV6PREFIX="the:/48:subnet:here:2"
REMOTE="fat.pip.es.heh"

[ "$ACTION" = "ifup" -a "$INTERFACE" = "wan" ] && {
[ -x $COMMAND ] && {
VLAN=$(nvram get ${INTERFACE}_ifname)
IFNAME=eth0.${VLAN#vlan}
IPV4=$(ip -4 addr show $IFNAME | grep inet | cut -f6 -d' ' | cut
-f1 -d'/')
ip tunnel add fatty-ipv6 mode sit ttl 255 remote $REMOTE local $I
PV4
ip link set dev fatty-ipv6 up
ip -6 addr add ${IPV6PREFIX}::2/48 dev fatty-ipv6
ip -6 route add ::/0 dev fatty-ipv6 metric 1
}
}
[ "$ACTION" = "ifdown" -a "$INTERFACE" = "wan" ] && {
[ -x $COMMAND ] && {
VLAN=$(nvram get ${INTERFACE}_ifname)
IFNAME=eth0.${VLAN#vlan}
IPV4=$(ip -4 addr show $IFNAME | grep inet | cut -f6 -d' ' | cut
-f1 -d'/')
ip -6 route flush dev fatty-ipv6
ip tunnel del fatty-ipv6
}
}


/etc/config/network:

config interface lan
option type bridge
option ifname "eth0.0"
option proto static
option ipaddr 192.168.1.1
option ip6addr the:/48:subnet:here:2::2/64


/etc/config/firewall:

accept:proto=41


/etc/firewall.user:

iptables -t nat -D POSTROUTING -o wan -j MASQUERADE
iptables -t nat -A POSTROUTING --protocol ! 41 -o wan -j MASQUERADE


/etc/radvd.conf:

interface br-lan
{
AdvSendAdvert on;

#
# Disable Mobile IPv6 support
#
AdvHomeAgentFlag off;

#
# example of a standard prefix
#
prefix the:/48:subnet:here:2::/64
{
AdvOnLink on;
AdvAutonomous on;
AdvRouterAddr off;
};

};


/etc/init.d/radvd enable

Reboot, or whatever. {/etc/init.d/(network|firewall|radvd) restart}

Sunday, June 8, 2008

FreeBSD 7.0 on Thinkpad x60s

Installation (Borrowed/adapted from here).

  1. Grab a boot-only nfs image from here.

  2. Copy the cd contents into the filesystem:

  3. mount -o loop /path/to/7.0-RELEASE-i386-bootonly.iso /mnt
    mkdir /freebsd
    cp -rP /mnt/boot/ /freebsd
    umount /mnt

  4. Edit /freebsd/boot/loader.conf to add:
    vfs.root.mountfrom="ufs:/dev/md0c"
    to use ramdisk root instead of nfs.

  5. Edit /etc/dhcpd.conf to add:

  6. host x60 {
    hardware ethernet xx:xx:xx:xx:xx:xx;
    fixed-address 10.0.0.xx;
    next-server 10.0.0.2;
    filename "pxeboot";
    option root-path "10.0.0.2:/freebsd";
    }

  7. Copy the pxeboot image to your tftp root dir:
    cp /freebsd/boot/pxeboot /var/lib/tftpboot

    NOTE: I had trouble with the 7.0 pxeboot ("Can't work out which disk we are booting from"). Crawling the web indicated that it was a 7.0 pxeboot problem and pulling the boot/pxeboot binary from a 6.3 iso image worked.
  8. I already had a tftp server installed (I use the tftpd-hpa server).

  9. Install an nfs server (temporarily if necessary (apt-get install nfs-kernel-server)).

  10. /etc/exports:
    /freebsd 10.0.0.xx(ro,subtree_check)

At this point, installation worked for me.

Getting the hardware working
  • Wireless

    1. Get the drivers loaded

    2. /boot/loader.conf
      # See man if_wpi if you want to know what you are agreeing to.
      legal.intel_wpi.license_ack=1
      if_wpi_load="YES"
      wpi_load="YES"
      wpi_amrr_load="YES"
      wpifw_load="YES"
      wlan_xauth_load="YES"

    3. WPA:
      /etc/wpa_supplicant.conf
      network={
      ssid="yourssidhere"
      psk="Your clever passphrase with lots of character variation
      }

      /etc/rc.conf
      ifconfig_wpi0="WPA DHCP"
      To start it, you can run /etc/rc.d/netif start

  • Sound

  • /boot/loader.conf
    snd_hda_load="YES"
  • X.org

  • Xorg -configure
    cp /root/xorg.conf.new /etc/X11/xorg.conf

  • Finger Print Reader

  • To be explored.

Miscellany
  • /etc/make.conf
    CPUTYPE?=core