July, 2011

  1. [POST] Homebrew having an micky fit

    July 26, 2011 by Brian Kenny

    After I upgraded to Lion, something weird happened. It stole or removed git on me. I had to reinstall the bitch. Now when I try to update homebrew I get:

    Aborting
    Error: Failure while executing: git checkout -q master

    Annoying but here’s a simple fix:

    cd /usr/local && git reset –hard HEAD


  2. [HARDWARE] Replacing a disk in a linux software raid

    July 22, 2011 by Brian Kenny

    You have a dead disk and it needs replacing. This is going to be done on a CentOS box but it’s pretty distribution none specific.

    First, lets have a look at whats dead:

    [server ~]# cat /proc/mdstat

    Personalities : [raid1]
    md0 : active raid1 sdb1[1] sda1[0]
    104320 blocks [2/2] [UU]

    md2 : active raid1 sdb5[1] sda5[2](F)
    226291456 blocks [2/1] [_U]

    md1 : active raid1 sdb2[1] sda2[2](F)
    10482304 blocks [2/1] [_U]

    unused devices: <none>

    OK so we can see that sda has failed for both md1 and md2. Lets replace it.

    First we need to take sda out of the RAID completely which we do by the following commands:

    # First we fail the drive
    [server ~]# mdadm –manage /dev/md1 –fail /dev/sda2

    # Then we delete it from the RAID
    [server ~]# mdadm –manage /dev/md1 –remove /dev/sda2

    # And the second and third partitions
    [server ~]# mdadm –manage /dev/md0 –fail /dev/sda1
    [server ~]# mdadm –manage /dev/md0 –remove /dev/sda1
    [server ~]# mdadm –manage /dev/md2 –fail /dev/sda5
    [server ~]# mdadm –manage /dev/md2 –remove /dev/sda5

    OK so the drive has been removed from the RAID, next we need to setup GRUB on sdb so that it can boot without issue.

    # We will set it up on the second HD, sdb.
    [server ~]# grub
    grub> root (hd1,0)
    grub> setup (hd1)
    grub> exit

    OK, now we’ve grub installed. Shutdown the server and replace sda.
    You may need to set the boot sequence in the BIOS to boot the second HD instead of the first.

    Once the server comes back online – we need to partition the second HD the same as the first and then reintroduce it back into the array. We do this as follows:

    # Copy the partition table from sdb and apply it to sda
    [server ~]# sfdisk -d /dev/sdb | sfdisk /dev/sda

    # Reintroduce to the array.
    [server ~]# mdadm –manage /dev/md0 –add /dev/sda1
    [server ~]# mdadm –manage  /dev/md1 –add /dev/sda2
    [server ~]# mdadm –manage /dev/md2 –add /dev/sda5

    Your done!


  3. [CODE] URL Shortening with Ruby

    July 20, 2011 by Brian Kenny

    I always wanted my own URL shortener. There pretty damn sweet – like me.

    I grabbed a domain from Blacknight – http://bkenn.me and installed some sweet assed Yourls. I noticed it was a rather pain in the ass to hit up the admin interface and shorten some links.

    I spend much of my time in the terminal – so I ruby’d some shit. First of all much love to threestage for their yourls gem.

    This allowed me to rub for example

    ruby shorten.rb http://url.to/shorten

    Boring – lets shorten that up some more.

    vim ~/.bash_profile

    Then add in some niceness

    shorten () {    ruby ~/shorten.rb $1}

    Done! I can now go to any of my terminals and type “shorten http://www.whatever.com” and it’ll be in my clipboard ready to paste.


  4. [DESIGN] CoffeeCoders

    July 15, 2011 by Brian Kenny

    So I’ve been playing around with the idea of CoffeeCoders for a bit. The basic idea is that anyone can walk into a coffee shop and buy a couple of hours worth of time from a web designer on site. There would basically be a couple of designers that hung out at the coffee shop during the day.

    Grab a latte and get some changes done on your site that you need on a Saturday morning etc.

    So I’ve been getting the ducks in a row for that and talking to different coffee shops and throwing together a small pitch email for the coffee shops:

    Hi,

    I’ve come across your coffee shop and I’d love to pitch you an idea to hopefully generate some great buzz for you business, lots of new customers and revenue.

    The idea is to bring both web designers and web site owners together under one roof. Hopefully your coffee shops.

    We will ensure that a group of high end web designers are present at your coffee shop on an arranged date. Customers can then arrive and purchase your beautifully brewed coffee and an hour or two of a web designers time if they so choose.

    This is just an idea at present. We’re looking for excellent barista’s and coffee shop owners to work with to make this happen.

    We will publize the event dramatically to ensure as many people are informed of the day as possible. If it’s a hit we’ll launch further dates with the hope that it will become a regular sought after date for web site owners to get some work done on their websites.

    We’ve got the web designers and if you think your coffee shop would be up for the challenge we’d love to hear from you.
    Thanks for taking the time to read this email, we understand how busy you are. It’s greatly appreciated.

    Thanks,
    Brian & Keith

    I got some great responses back from this. Including one kick ass coffee shop that I hoped would come on board.

    I asked Keith from Clear Designs to mock up some logo’s for a website. A website that web designers could log their interest on and go from there.

    Check these guys out for some amazing logos:


  5. [COMPANY] Slicehost – The full story

    July 14, 2011 by Brian Kenny

    He’s a great interview between David H. and and the guys who created and sold slice host. Some very inspiring stuff:








  6. [CODE] Scan a range for servers that accept an SSH key

    July 12, 2011 by Brian Kenny

    A small piece of bash scripting that will search through a list of defined networks for open ssh ports and then try to connect to them with a specified ssh key.


  7. [CODE] Using findstr to find a pattern and delete the file

    July 11, 2011 by Brian Kenny

    If your looking for a method to use findstr search every file in every directory your in for a pattern within the file and then delete it, use:

    for /f %q in (‘findstr /s /i /m “pattern” file.name’) do (del “%q”)


  8. [VIDEO] Chris Sacca talks with Kevin Rose

    July 6, 2011 by Brian Kenny


  9. Vodafone Sure Signal License Declaration

    July 5, 2011 by Brian Kenny

    The Vodafone Sure Signal box carries licensing for the following softwares. Some of them are pretty strange.

    * Linux Kernel
    Fairly obvious it would run on linux.

    * db4-libs-4.3.28
    This is a debian package so she’s running some version of debian. It’s a set of tools for manipulating databases.

    * less
    A standard tool for allowing backward movement in a file when your printing it to the screen.

    * libcap
    This is a tool for capturing network traffic.

    * libstdc++
    Standard C++ compiler

    * smail
    This is a application for sending emails.

    * ntp
    This application gets the current date and time from a remote server and sets the time on the device.

    * openssh
    This allows remote users to connect over SSH to the device. This also contains multiple licenses for encryption algorythms and the likes.

    * openssl
    This allows encrypted traffic over http. Basically the goodness that allows secure payments online.

    * ssleay
    This is a perl extension for openssl mentioned above.

    * shadow
    A password and privledge management tool

    * strace
    Allows debugging of programs on the linux system by tracing processes.

    * tcpdump
    A packet analyzer for TCP. Works with libcap mentioned above.

    * u-boot
    A universal boot loader.