• URL Regex

    Justin sent over a regex he wrote for catching the various bits of a url:

    (http|ftp):\/\/((?:[^./]+\.){1,}(?:[^./]+))((?:/[^/]+)*/)([^/]+)\.([^./]+)
    


  • Parsing ftp xferlogs

    I need to parse ftp xferlogs and our current regex was broken by spaces in uploaded filenames. Have fixed it, is shown below with the names of the fields.

    $_ =~ /^(\w{3} \w{3} \s?\d\d? \d\d:\d\d:\d\d \d{4})
                    (\d\d?)(\S+) (\d+) (.+) ([ab]) (_|C|U|T) (i|o)
                    (a|g|r) (\w+) (\w+) (0|1) (\w+|\*) ([c|i])$/o;
    
            $current_time = $1;
            $transfer_time = $2;
            $remote_host = $3;
            $byte_count = $4;
            $filename = $5;
            $transfer_type = $6;
            $special_action_flag = $7;
            $direction = $8;
            $access_mode = $9;
            $username = $10;
            $service_name =$11;
            $authentication_method = $12;
            $authenticated_user_id=$13;
            $completion_status = $14;
    


  • London Tube and DLR Station Postcodes

    I recently needed a list of Tube and DLR station postcodes but couldn’t find one anyway. I ended up having to screen scrape a couple of sites, but now I have a list. Thanks to Paul Berry who commented on this post with a postcode for Heron Quays.

    Update February 2019

    After this file was moved around a couple of times and the link broken I finally made a Git repo for it which you can find here.


  • SCSI Connectors

    Found a nice page with pictures of SCSI connectors. I never remember which one I need…


  • Adding static routes to RedHat 8 and 9

    To add a static route to modern RedHat distributions you need to do the following:

    Assuming you want to add a route to the 192.168.1.0/24 network via the eth0 network interface to the gateway at 172.16.254 you would create a file called /etc/sysconfig/network-scripts/route-eth0 and in that file put the route:

    192.168.1.0/24 via 172.16.1.254
    

    Either ifdown and ifup the interfaces or reboot to see the changes.

    Of course you could just add the route manually until the next boot:

    route add -net 192.168.1.0 netmask 255.255.255.0 gw 172.16.1.254 dev eth1
    


  • Screen information

    Ells posted a nice site which details some of the features of screen, here (Broken link http://cosmic.homeunix.net/blog/old/00000018.html)


  • Wake on LAN

    Send your mac to sleep: macsleep (c) - from here

    … bring pretty much any WOL-provisioned host back to life again: wakeonlan (Broken link http://gsd.di.uminho.pt/jpo/software/wakeonlan/) (perl)


  • Useful command line tools

    For admining OS X, here (Broken link http://www.bombich.com/mactips/commands.html)


  • Samba 3.0.2a in gentoo

    The current gentoo ebuild has some issues with the latest version of smb_ldap tools which means that the config files (there was one; now there are two) are now installed in a different location (they have moved from the previous version that gentoo installed).

    For more information, have a look at this bug.

    This basically means that if you are upgrading you should expect to redo your configuration. As some basic hints the following may be useful:

    • the majority of paramteres in /usr/share/samba/scripts/smbldap_conf.pm are now in /etc/smbldap-tools/smbldap.conf
    • the authentication details that were in /usr/share/samba/scripts/smbldap_conf.pm are now in /etc/smbldap-tools/smbldap_bind.conf
    • the parameters no longer have ‘$’s in front of them (so be careful if you are cutting and pasting)
    • the scripts no longer have .pl extensions. For example: smbldap-useradd.pl is now smbldap-useradd so remember to change your smb.conf to this effect.

    Good luck!


  • Web Devleoper moz toolbar

    Web Developer (Broken link http://chrispederick.myacen.com/work/firefox/webdeveloper/index.php) is a rather neat toolbar component for Firefox or Moz.