Hats off to Godaddy

First, I would like to point out that this is not a paid blog, It is only my opinion.

I have been using Godaddy for my domain name registration now exclusively (except for one .ie domain name) for a few years, ever since I lost the first domain name I ever had due to a registrar cock-up. When I made the switch it was pretty bewildering, I didn’t know what I was doing with their control panel, I couldn’t find things, in fact I really didn’t like the console, however things have changed over there and the domain management tools are really quite nice, any time one of my domains is updated for new DNS servers or contact information, the change happens quickly and I receive a notification about it. Since switching I have never lost a domain or even come close to it, I can configure automatic renewal for ones I want, manual for others etc… so it really quite suits me, the most impressive thing I found with Godaddy though is the support they provide to their customers.

One night when I was bored online, I was looking at the Godaddy website and spotted Bob Parsons blog, the CEO of Godaddy. Now, while he does often give some good, solid advise, his video’s are never boring. This particular night I was feeling a little bit cheeky so I decided to leave him a comment thanking him for his good tips and the great service I received, and through in a sneaky ‘by the way, any chance of a free shirt?’ on the end. The following day, I received an email from Bob’s PA asking for my shipping address and shirt size. A couple of weeks passed and I had forgotten about the whole thing when a package arrived for me through Fed Ex. A package of two Godaddy t-shirts. Not alone was Godaddy / Bob / Bob’s PA kind enough to send little ‘ol me (the shirts were XXL, so maybe not that little?) two Godaddy t-shirts, but they also covered the $27.50 Fed Ex shipping and handling charges.

How’s that for customer service?

In short, Godaddy runs a tight ship, and runs it very well. The folks over there have successfully secured my past, present, and future business.

Share this post...
  • Print
  • Digg
  • del.icio.us
  • Google Bookmarks
  • Fark
  • HackerNews
  • Reddit
  • Slashdot
  • StumbleUpon
  • Technorati
  • Twitter

LED Matrix Displays

*Updated small bug where I forgot to enable the system afterwards…

I’ve managed to pick up a few LED matrix displays from Sure Electronics that use the HT1632 LED Matrix driver, as such, I have written a new library for the Arduino project to make use of the displays, I haven’t done anything in relation to generating characters for them or doing any scrolling, but I can now pretty much call all of the features of the handy driver. There is still some work to do on cleaning up the library and adding some more functionality, but it does indeed work as it should. Here is the source…

/*
 
    Holtech HT1632 Driver Class (Header)
    Values taken from Datasheet...
 
*/
 
#ifndef HT1632_h
#define HT1632_h
 
//Data Mode
#define HT1632_CTL_COMMAND      0x04    //Preceeds all _COMMANDS_ to the system
#define HT1632_CTL_WRITE        0x05    //Write data to the RAM
#define HT1632_CTL_READ         0x06    //Read data from the RAM
 
//Command Mode
#define HT1632_CMD_SYSDIS       0x00    //Turn off system oscillator and LED duty cycle generator
#define HT1632_CMD_SYSEN        0x01    //Turn on system oscillator
#define HT1632_CMD_LEDOFF       0x02    //Turn off LED duty cycle generator
#define HT1632_CMD_LEDON        0x03    //Turn on LED duty cycle generator
#define HT1632_CMD_BLINKOFF     0x08    //Turn off blinking function
#define HT1632_CMD_BLINKON      0x09    //Turn on blinking function
#define HT1632_CMD_SLAVEMODE    0x10    //Set slave mode and clock source from external clock, the system clock input from OSC pin and synchronous signal input from SYN pin
#define HT1632_CMD_RCMASTER     0x18    //Set master mode anc clock source from on-chip RC oscillator, the system clock output to OSC pin and synchronous signal output SYN pin
#define HT1632_CMD_EXTCLK       0x1C    //System clock source, external
#define HT1632_CMD_COM00        0x20    //N-MOS open drain output and 8 COM option
#define HT1632_CMD_COM01        0x24    //N-MOS open drain output and 8 COM option
#define HT1632_CMD_COM10        0x28    //P-MOS open drain output and 8 COM option
#define HT1632_CMD_COM11        0x2C    //P-MOS open drain output and 16 COM option
 
//Command Mode - PWM Settings
#define HT1632_CMD_PWM01        0xA0    //PWM 1/16 Duty
#define HT1632_CMD_PWM02        0xA1    //PWM 2/16 Duty
#define HT1632_CMD_PWM03        0xA2    //PWM 3/16 Duty
#define HT1632_CMD_PWM04        0xA3    //PWM 4/16 Duty
#define HT1632_CMD_PWM05        0xA4    //PWM 5/16 Duty
#define HT1632_CMD_PWM06        0xA5    //PWM 6/16 Duty
#define HT1632_CMD_PWM07        0xA6    //PWM 7/16 Duty
#define HT1632_CMD_PWM08        0xA7    //PWM 8/16 Duty
#define HT1632_CMD_PWM09        0xA8    //PWM 9/16 Duty
#define HT1632_CMD_PWM10        0xA9    //PWM 10/16 Duty
#define HT1632_CMD_PWM11        0xAA    //PWM 11/16 Duty
#define HT1632_CMD_PWM12        0xAB    //PWM 12/16 Duty
#define HT1632_CMD_PWM13        0xAC    //PWM 13/16 Duty
#define HT1632_CMD_PWM14        0xAD    //PWM 14/16 Duty
#define HT1632_CMD_PWM15        0xAE    //PWM 15/16 Duty
#define HT1632_CMD_PWM16        0xAF    //PWM 16/16 Duty
 
#include "wProgram.h"
 
class HT1632 {
    public:
        HT1632(byte data, byte wclock, byte chip0, byte chip1=NULL, byte chip2=NULL, byte chip3=NULL, byte rclock=NULL);
        void ChipSelect(byte chip);
        void ChipRelease(byte chip);
        void SendCommand(byte command, byte chip=0);
        void WriteBits(byte bits, byte mask);
        byte ReadData(byte address, byte chip);
        void Clear(byte chip=0);
        void WriteData(byte address, byte data, byte chip=0);
        void Init(byte chip=0);
        void BlinkMode(bool blink=false, byte chip=0);
 
    private:
        byte _DATA;
        byte _WCLOCK;
        byte _RCLOCK;
        byte _CHIP0;
        byte _CHIP1;
        byte _CHIP2;
        byte _CHIP3;
};
 
#endif
/*
 
    Holtech HT1632 Driver Class
    Some functionality inspired by westfw from this thread: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1225239439
 
*/
 
#include "wProgram.h"
#include "HT1632.h"
 
HT1632::HT1632(byte data, byte wclock, byte chip0, byte chip1, byte chip2, byte chip3, byte rclock) {
    //Set the I/O Directions
    pinMode(data, OUTPUT);
    pinMode(wclock, OUTPUT);
    if(rclock) {
        pinMode(rclock, OUTPUT);
        _RCLOCK = rclock;
    }
 
    pinMode(chip0, OUTPUT);
    digitalWrite(chip0, HIGH);
    _CHIP0 = chip0;
 
    if(chip1) {
        pinMode(chip1, OUTPUT);
        digitalWrite(chip1, HIGH);
        _CHIP1 = chip1;
    }
 
    if(chip2) {
        pinMode(chip2, OUTPUT);
        digitalWrite(chip2, HIGH);
        _CHIP2 = chip2;
    }
 
    if(chip3) {
        pinMode(chip3, OUTPUT);
        digitalWrite(chip3, HIGH);
        _CHIP2 = chip2;
    }
 
    _DATA = data;
    _WCLOCK = wclock;
}
 
void HT1632::ChipSelect(byte chip) {
    switch(chip) {
        case 0:
            digitalWrite(_CHIP0, LOW);
            break;
        case 1:
            digitalWrite(_CHIP1, LOW);
            break;
        case 2:
            digitalWrite(_CHIP2, LOW);
            break;
        case 3:
            digitalWrite(_CHIP3, LOW);
            break;
        }
}
 
void HT1632::ChipRelease(byte chip) {
    switch(chip) {
        case 0:
            digitalWrite(_CHIP0, HIGH);
            break;
        case 1:
            digitalWrite(_CHIP1, HIGH);
            break;
        case 2:
            digitalWrite(_CHIP2, HIGH);
            break;
        case 3:
            digitalWrite(_CHIP3, HIGH);
            break;
    }
}
 
void HT1632::WriteBits(byte bits, byte mask) {
    while (mask) {
        digitalWrite(_WCLOCK, LOW);
        if (bits & mask) {
            digitalWrite(_DATA, HIGH);
        } else {
            digitalWrite(_DATA, LOW);
        }
        digitalWrite(_WCLOCK, HIGH);
        mask >>= 1;
    }
}
 
void HT1632::SendCommand(byte command, byte chip) {
    ChipSelect(chip);
    WriteBits(HT1632_CTL_COMMAND, 1<<2);//3 bit command id
    WriteBits(command, 1<<7);//8 bit command
    WriteBits(0,1);//There's one extra bit in commands that dont matter...
    ChipRelease(chip);
}
 
byte HT1632::ReadData(byte address, byte chip) {
    //Do stuff here to read the data from the chip...
}
 
void HT1632::Clear(byte chip) {
    ChipSelect(chip);
    for(int i=0; i<256; i++) {
        WriteData(i, 0);
    }
    ChipRelease(chip);
}
 
void HT1632::WriteData(byte address, byte data, byte chip) {
    ChipSelect(chip);//Select the chip...
    //Send the WRITE command...
    WriteBits(HT1632_CTL_WRITE, 1<<2);  //3 bit command
    //Send the Address...
    WriteBits(address, 1<<6);   //7 bit address
    //Send the data...
    WriteBits(data, 1<<3); //4 bit data
    ChipRelease(chip);//Release the chip...
}
 
void HT1632::Init(byte chip) {
    SendCommand(HT1632_CMD_SYSDIS); //Disable system
    SendCommand(HT1632_CMD_COM11); //PMOS drivers
    SendCommand(HT1632_CMD_RCMASTER); //Master mode
    SendCommand(HT1632_CMD_SYSEN); //System Enable
    SendCommand(HT1632_CMD_LEDON); //Enable the display
    Clear(chip);
}
 
void HT1632::BlinkMode(bool blink, byte chip) {
    if(blink) {
        SendCommand(HT1632_CMD_BLINKON, chip);
    } else {
        SendCommand(HT1632_CMD_BLINKOFF, chip);
    }
}
Share this post...
  • Print
  • Digg
  • del.icio.us
  • Google Bookmarks
  • Fark
  • HackerNews
  • Reddit
  • Slashdot
  • StumbleUpon
  • Technorati
  • Twitter

Just a general update…

It’s been quite a while since I’ve posted  anything, I’ve been very busy lately but since I’m out sick now for a few days, I have a bit of time to update…

If you have tried to play Fallout 3 using an Asus branded NVidia card, and it crashes stating “Fallout 3 has stopped working” every time you try to load a new game, check and see if you have Asus Gamer OSD installed, if you do, get rid of it. Something the overlay does interferes with the game  and causes this to happen…

I have been doing some more work on the lighting for the man cave so I have some Python code that will pull the Average color (not the most predominant, yet, wont be hard, but I am lazy) so here it is, please keep in mind its not nice, fast or clean… for high res images it takes a few seconds to do its thing…

#!/usr/bin/env python
 
#
# PIL Image Module Handbook - http://www.pythonware.com/library/pil/handbook/image.htm
#
 
from PIL import Image
from optparse import OptionParser
 
def processImageAverage(imageFile):
    image = Image.open(imageFile)     #open the image for processing
    pixels = list(image.getdata())    #break the image down into a list of pixels, each pixel contains a list of red,green,blue
 
    totalpx = 0 #set some default values to start counting...
    redpx = 0
    greenpx = 0
    bluepx = 0
 
    for pixel in pixels:    #loop through the lists and build the values.
        totalpx += 1
        redpx += pixel[0]
        greenpx += pixel[1]
        bluepx += pixel[2]
 
    redavg = redpx / totalpx   #generate the averages
    greenavg = greenpx / totalpx
    blueavg = bluepx / totalpx
 
    print "\nTotal Pixels:\t", totalpx     #and write them out.
    print "Red Average:\t", redavg
    print "Green Average:\t", greenavg
    print "Blue Average:\t", blueavg
    print "HEX Color:\t#%x%x%x" % (redavg, greenavg, blueavg)
 
def main():
    parser = OptionParser("Usage: %prog source")
 
    (options, arguments) = parser.parse_args()
    if len(arguments) != 1:
        parser.error("Please specify a single input file.")
 
    processImageAverage(arguments[0])
 
if __name__ == "__main__":
    main()

I have a new job now, I’m no longer a software validation engineer (tester), I’m now an IT Support Engineer (IT Techie…) which is kinda nice….

Well… that is for now…

Share this post...
  • Print
  • Digg
  • del.icio.us
  • Google Bookmarks
  • Fark
  • HackerNews
  • Reddit
  • Slashdot
  • StumbleUpon
  • Technorati
  • Twitter

New addition to the ManCave for the bar…

http://img519.imageshack.us/img519/8719/p140210164301.jpg

Share this post...
  • Print
  • Digg
  • del.icio.us
  • Google Bookmarks
  • Fark
  • HackerNews
  • Reddit
  • Slashdot
  • StumbleUpon
  • Technorati
  • Twitter

€1366.07 down…

So I have been doing some serious work on my mancave during my two weeks off, so far I have all of the walls battened, the new door fitted, and two of the walls wired for mains sockets. I have even been picking up some additional parts that we are not quite ready yet, such as a roll of CAT6 cable, CAT6 wall outlets with faceplate’s, 17 double gang switched sockets and much much more… all in all its coming along nicely. No photo’s taken as of yet though, I really should have taken some at the start and all the way through as it would have been quite a good evolution slide show, but alas its too late now… we did run into a few issues though, the garage is still crammed full of stuff and there is not much room to move around in it so that has been slowing us down a lot, however there is nowhere else to put it so it has to be this way for now I’m afraid :(

Another issue we’ve encountered was that the cavity blocks haven’t aged all that well and are quite hard, like flint even, so masonry nails havent been working out too well on that, so as a more expensive, and time consuming work-around, we have been using nail-anchors and manually drilling for each baton… not the most fun thing in the world, but at least its progress…

As a side note, from working out in the cold weather all week I seem to have gotten another cold :(

Share this post...
  • Print
  • Digg
  • del.icio.us
  • Google Bookmarks
  • Fark
  • HackerNews
  • Reddit
  • Slashdot
  • StumbleUpon
  • Technorati
  • Twitter

I Hate Webdesign

Did I mention lately that I hate webdesign? no? let me explain…

While I am quite proficient at writing backend systems in PHP and mySQL, or even taking an existing design and twising it around, chopping it up and changing things, I have no artistic taste when it comes to actually designing things. I have taken on a job for a client, and I now feel that I am out of my depth, it doesnt help that I have absolutely no specification what so ever, none, nada, ziltch… but even still, I should be able to come up with something suitable, but I cant, its just not coming to me… It’s not a particularly complex website, its basicly an online brochure for a catering company so I have settled on using the website baker CMS for doing all of the backend management, it doesnt really need anything more complex than that to do what it needs to do, however this means that 90% of the work to be done on this site is purely design, look and feel… and I hate it.

So far, my design consists of a solid, light coffee color background, some red (to slightly pinkish) text, and a white box with a border… really… is this the best I can do?

Share this post...
  • Print
  • Digg
  • del.icio.us
  • Google Bookmarks
  • Fark
  • HackerNews
  • Reddit
  • Slashdot
  • StumbleUpon
  • Technorati
  • Twitter

To the Man Cave!

UPDATED: Syntax Highlighting for code blocks.

Purpose: A man cave is loosely a male-only space to retreat to, watch sports matches, or play video games. According to psychiatrist and author Scott Haltzman, it is important for a man to have a place to call his own, referring to a male area to retreat to. Some psychologists claim that a man cave can provide refuge from stressful surroundings and be beneficial to marriage.

Via: Wikipedia

So I have committed myself to building one of these, at present, I have a 15′ x 15′ garage space, ready for the taking. I plan on turning the space into a male friendly (read: full of beer) area with a home cinema setup, a bar and some cool and interesting technology. To date, I already have the Projector & Screen, some basic fittings, some decent insulation for the roof, 2x Wireless access points with which I will be building a P-T-P link, and lots of ideas…

One of the things that I want to do is to install an all LED lighting system composed of high output RGB LED’s – My idea for this is to use an I2C bus linking all of the LED modules with the info and the power over CAT5; as such, I have begun development. I bought some small 3W RGB LED’s from Deal Extreme for developing my proof of concept modules. My PoC so far is comprised of an Seeeduino Mega as the LED controller and unfortunately as I havent made as much progress with my BifferBoard as of yet, I’m currently using a Bus Pirate (v2go) for controlling the I2C bus, the protocol Im using is quite simple, you send the write address of the unit, a # character and then the hexadecimal RGB values, as such the full pallet of colors is available and can be looked up online or from the majority of graphics programs… There are a few points to consider for what you want to use as the LED Controller, if I beef up my C skills, I do intend on moving away from the Arduino plaform and migrating to a smaller lower specced Atmel or PIC uC – resulting in lower costs… the controller so far has a few features…

  • The Default (Startup) Color is programmable from the I2C bus so if there is a power failure etc… the lights will return automatically to a known state.
  • The controller is bus configurable to be Common Cathode OR Common Anode
  • There is more to add here as I complete them, such as disco mode or fade mode, or pre-defined sequences…

I have taken a photo of the test setup I have at present and will provide the sourcode below, I have also been working on a Processing application to play with the idea of doing something similar to the Phillips Ambilight tv where depending on the image on my screen, the lights in the mancave will be a particular color, while I will also post the code for this, its not commented, or pretty, or even working at this point so your on your own with it… I will update as time goes on… anyways, enough jibber jabber, time for some actuall images and real code…

General (Outdated)  Flowchart for the controller:

Picture of the test setup…

And as promised, here is the source for the Arduino:

/* 
 
Arduino I2C RGB LED Controller
 
EEPROM Map:
  0x00  configuration block
  0x01  red pwm value
  0x02  green pwm value
  0x03  blue pwm value
 
*/
 
#include
#include 
 
//PIN Definitions
#define addr0      2
#define addr1      3
#define addr2      4
#define addr3      5
#define redPin     7
#define greenPin   8
#define bluePin    9
 
//Global Variables
byte redPWM = 0;
byte greenPWM = 0;
byte bluePWM = 0;
byte configBlock = 0;
byte i2cAddress = 0;
byte i2cData[4] = {0, 0, 0, 0};
boolean processQueue = false;
 
void setup() {
 
  //Set PIN I/O's
  pinMode(redPin, OUTPUT);
  pinMode(greenPin, OUTPUT);
  pinMode(bluePin, OUTPUT);
  pinMode(addr0, INPUT);
  pinMode(addr1, INPUT);
  pinMode(addr2, INPUT);
  pinMode(addr3, INPUT);
 
  //Enable internal pullups
  digitalWrite(addr0, 1);
  digitalWrite(addr1, 1);
  digitalWrite(addr2, 1);
  digitalWrite(addr3, 1);
 
  //Set I2C Address...
  //i2cAddress = (digitalRead(addr0) | digitalRead(addr1) | digitalRead(addr2) | digitalRead(addr3));
  i2cAddress = 7;
 
  //Register an event to fire when we receive I2C data then join the bus...
  Wire.onReceive(grabData);
  Wire.begin(i2cAddress);
 
  //Grab previous settings from EEPROM...
  configBlock = EEPROM.read(0);
  redPWM = EEPROM.read(1);
  greenPWM = EEPROM.read(2);
  bluePWM = EEPROM.read(3);
 
  //Set the PWM outputs for the LED(s)
  setPWM();
 
  //I think we're ready to enter the main loop now...
 
}
 
void grabData(int data) {
  int i = 0;
  while(Wire.available()) {
     i2cData[i] = Wire.receive();
     i++;
  }
  processQueue = true;
}
 
void setPWM() {
    if(configBlock == 'A') {
    analogWrite(redPin, 255 - redPWM);
    analogWrite(greenPin, 255 - greenPWM);
    analogWrite(bluePin, 255 - bluePWM);
  } else {
    analogWrite(redPin, redPWM);
    analogWrite(greenPin, greenPWM);
    analogWrite(bluePin, bluePWM);
  }
}
 
void updateEEPROM() {
  EEPROM.write(0, configBlock);
  EEPROM.write(1, redPWM);
  EEPROM.write(2, bluePWM);
  EEPROM.write(3, greenPWM);
}
 
void loop() {
  //Check to see if we have something to do...
  while(processQueue == false) {
    //Do nothing... but do it quickly!
    delay(1);
  }
 
  switch(i2cData[0]) {
    case '#':
      //we have a color
      redPWM = i2cData[1];
      greenPWM = i2cData[2];
      bluePWM = i2cData[3];
      setPWM();
      break;
    case 'D':
      //We're setting the default startup color...
      redPWM = i2cData[1];
      greenPWM = i2cData[2];
      bluePWM = i2cData[3];
      updateEEPROM();
      setPWM();
      break;
    case 'C':
      //we're changing the LED type
      if(i2cData[1] == 'A') {
        configBlock = 'A';
      } else {
        configBlock = 'C';
      }
      updateEEPROM();
      break;
    default:
      //do nothing...
      break;
  }
 
  processQueue = false;
}

And here is the source for Processing:

import processing.serial.*;
 
PImage myImage;
Serial myPort;
 
float[] redpx;
float[] greenpx;
float[] bluepx;
 
float redtotal;
float greentotal;
float bluetotal;
 
int imgWidth;
int imgHeight;
 
void setup() {
    //println(Serial.list());
    myPort = new Serial(this, "COM13", 115200);
 
    myImage = loadImage("red.jpg");
    myImage.loadPixels();
 
    redpx = new float[myImage.pixels.length];
    greenpx = new float[myImage.pixels.length];
    bluepx = new float[myImage.pixels.length];
 
    for(int i=0; i> 16 & 0xFF;
        greenpx[i] = myImage.pixels[i] >> 8 & 0xFF;
        bluepx[i] = myImage.pixels[i] & 0xFF;
    }
 
    for(int r=0; r < redpx.length; r++) {
        redtotal += redpx[r];
    }
    redtotal = redtotal / redpx.length;
 
    for(int g=0; g < greenpx.length; g++) {
        greentotal += greenpx[g];
    }
    greentotal = greentotal / greenpx.length;
 
    for(int b=0; b < bluepx.length; b++) {
        bluetotal += bluepx[b];
    }
    bluetotal = bluetotal / bluepx.length;
 
    int serialData[] = { 91, 32, 48, 120, 48, 69, 32, 48, 120, 50, 51, 32, floor(redtotal), 32, floor(greentotal), 32, floor(bluetotal), 32, 93, 13};      //used for i2c control through a bus pirate
    //int serialData[] = { 'R', floor(redtotal), 'G', floor(greentotal), 'B', floor(bluetotal), 'C', 'A', 'U' };      //used for serial control through rs232
 
    for(int j=0; j 0) {
       String inBuffer = myPort.readString();
       if(inBuffer != null) {
        println(inBuffer);
       }
    }
 
    myImage.updatePixels();
}
Share this post...
  • Print
  • Digg
  • del.icio.us
  • Google Bookmarks
  • Fark
  • HackerNews
  • Reddit
  • Slashdot
  • StumbleUpon
  • Technorati
  • Twitter

It made me LOL

Just spotted this video online and found it quite funny…

Share this post...
  • Print
  • Digg
  • del.icio.us
  • Google Bookmarks
  • Fark
  • HackerNews
  • Reddit
  • Slashdot
  • StumbleUpon
  • Technorati
  • Twitter

Teamspeak 3 server on Ubuntu

Well, Teamspeak have finally released their new server platform for a public BETA test, although supposedly in this state the code is not meant to be stable, it appears to be working quite well on my Ubuntu server here at home. This is what I done to get it up and running – as a service from init.d no less. Before doing any of the following steps, please be aware that this IS BETA code and WILL contain bugs that may introduce security issues. The first step is to create a user that the Teamspeak executable can run as, this user should have a complex password for security reasons. This user will also not require a shell account.

sudo adduser teamspeak

Fill in the questions presented by the adduser application.

sudo usermod -s /bin/false teamspeak

The above command will change the users shell to be /bin/false ie. no shell. Now it is time to go and get Teamspeak… visit http://www.goteamspeak.com and find the correct package for the architecture you wish to use ie. Teamspeak_3.0.0-Beta5-32bit…

wget http://ftp.4players.de/pub/hosted/ts3/releases/beta-5/teamspeak3-server_linux-x86-3.0.0-beta5.tar.gz tar -zxvf teamspeak3-server_linux-x86-3.0.0-beta5.tar.gz

Now its time to move the new TS3 directory to its new home…

sudo mv ./teamspeak3-server_linux-x86-3.0.0-beta5 /opt/TS3 sudo chown -R teamspeak /opt/TS3

The above will place TS3 in /opt/TS3 and give ownership of the contents to the user teamspeak. It is now possible to run Teamspeak, however as veteran Teamspeak users will know, the first time you run the Teamspeak server you are presented with a username/password combo that cannot be recovered without resetting the server. In TS3 you will also be presented with a `token` (all of this is described in the Teamspeak documentation). So for the first run, the following command will allow you to gather these details, they should be noted carefully for future reference.

sudo start-stop-daemon –chuid teamspeak –chdir /opt/TS3 –start –exec /opt/TS3/ts3server_linux_x86

From this, you should see the serveradmin user and password. You can now ^C that and be returned to the normal shell, if you cat /opt/TS3/logs/* you will be presented with the token you require to obtain server-admin status on the new server. The last part is to create a script for /etc/init.d/ to launch Teamspeak each time the system is booted to the correct runlevel. /etc/init.d/skeleton provides a suitable framework for this, here is the script I am using, just about… NOTE: WordPress does not want to format this correctly for me, as such, here is a link to the file in a tar archive. If you follow these instructions and are running a 32bit server, the following file will work out of the box. /etc/init.d/teamspeak This file must then be made executable with

sudo chmod +x /etc/init.d/teamspeak

And finally, the init file must be symlinked to each of the runlevel start dirs using the following…

sudo ln -s ../init.d/teamspeak /etc/rc0.d/K21teamspeak sudo ln -s ../init.d/teamspeak /etc/rc1.d/K21teamspeak sudo ln -s ../init.d/teamspeak /etc/rc2.d/S21teamspeak sudo ln -s ../init.d/teamspeak /etc/rc3.d/S21teamspeak sudo ln -s ../init.d/teamspeak /etc/rc4.d/S21teamspeak sudo ln -s ../init.d/teamspeak /etc/rc5.d/S21teamspeak sudo ln -s ../init.d/teamspeak /etc/rc6.d/K21teamspeak

Viola, you should now have a working Teamspeak 3 server.

BOOTNOTE:

For my initial install, and for the basis of the majority of this, I used this as a reference. Items listed in bold with ** are most likely not the correct file names for the command, I am not close to my server or an available shell to pull the correct parameters at present, but I will update ASAP. As an additional side note, my first impressions of TS3 are very good… It has tons of new features, looks good and the voice quality is very good indeed. My only concern is however the permissions system is very bulky, difficult to understand, and unless you are reasonably familiar with administering a Teamspeak server already, the documentation is not as straight forward as people believe. Still, however, a great job. Well done Teamspeak 3 development team!

UPDATE: Fixed formatting issue, kinda… provided link to pastebin.

UPDATE: Fixed information regarding server executable. Added /etc/init.d/teamspeak file, available for download here, removed pastebin link.

#! /bin/sh
### BEGIN INIT INFO
# Provides:          teamspeak
# Required-Start:    networking
# Required-Stop:
# Default-Start:     2 3 4 5
# Default-Stop:      S 0 1 6
# Short-Description: TeamSpeak Server Daemon
# Description:       Starts/Stops/Restarts the TeamSpeak Server Daemon
### END INIT INFO

set -e

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DESC="TeamSpeak Server"
NAME=teamspeak
USER=teamspeak
DIR=/opt/tss2_rc2
DAEMON=$DIR/server_linux
#PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME

# Gracefully exit if the package has been removed.
test -x $DAEMON || exit 0

d_start() {
        start-stop-daemon --start --quiet \
                --chuid $USER \
                --chdir $DIR \
                --exec $DAEMON \
                > /dev/null \
                || echo -n " already running"
}

d_stop() {
        start-stop-daemon --stop --quiet \
                --chuid $USER \
                --chdir $DIR \
                --exec $DAEMON \
                || echo -n " not running"
}

case "$1" in
  start)
        echo -n "Starting $DESC: $NAME"
        d_start
        echo "."
        ;;
  stop)
        echo -n "Stopping $DESC: $NAME"
        d_stop
        echo "."
        ;;
  restart|force-reload)
        echo -n "Restarting $DESC: $NAME"
        d_stop
        sleep 15
        d_start
        echo "."
        ;;
  *)
        echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
        exit 3
        ;;
esac

exit 0
Share this post...
  • Print
  • Digg
  • del.icio.us
  • Google Bookmarks
  • Fark
  • HackerNews
  • Reddit
  • Slashdot
  • StumbleUpon
  • Technorati
  • Twitter

Brute force SSH attacks.

I have spoken to a good few people and on the matter and one thing they consistantly ask is “How do I know my server is under attack?”, its simple really… if you keep a close eye (in Ubuntu at least) on /var/log/auth.log, you can see all login attempts on the system. Here is an example log of a brute force attack on my very own server…

Dec 7 01:30:02 phonebox sshd[14378]: Invalid user aleph from 60.19.28.27
Dec 7 01:30:02 phonebox sshd[14378]: pam_unix(sshd:auth): check pass; user unknown
Dec 7 01:30:02 phonebox sshd[14378]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=60.19.28.27
Dec 7 01:30:04 phonebox sshd[14378]: Failed password for invalid user aleph from 60.19.28.27 port 16699 ssh2
Dec 7 01:30:08 phonebox sshd[14461]: Invalid user pechantal from 60.19.28.27
Dec 7 01:30:08 phonebox sshd[14461]: pam_unix(sshd:auth): check pass; user unknown
Dec 7 01:30:08 phonebox sshd[14461]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=60.19.28.27
Dec 7 01:30:10 phonebox sshd[14461]: Failed password for invalid user pechantal from 60.19.28.27 port 17732 ssh2
Dec 7 01:30:14 phonebox sshd[14464]: Invalid user komtemp from 60.19.28.27
Dec 7 01:30:14 phonebox sshd[14464]: pam_unix(sshd:auth): check pass; user unknown
Dec 7 01:30:14 phonebox sshd[14464]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=60.19.28.27
Dec 7 01:30:16 phonebox sshd[14464]: Failed password for invalid user komtemp from 60.19.28.27 port 18807 ssh2
Dec 7 01:30:20 phonebox sshd[14466]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=60.19.28.27 user=root
Dec 7 01:30:22 phonebox sshd[14466]: Failed password for root from 60.19.28.27 port 19764 ssh2
Dec 7 01:30:54 phonebox sshd[14470]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=60.19.28.27 user=root
Dec 7 01:30:56 phonebox sshd[14470]: Failed password for root from 60.19.28.27 port 26354 ssh2
Dec 7 01:30:59 phonebox sshd[14473]: Invalid user test from 60.19.28.27
Dec 7 01:31:00 phonebox sshd[14473]: pam_unix(sshd:auth): check pass; user unknown
Dec 7 01:31:00 phonebox sshd[14473]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=60.19.28.27
Dec 7 01:31:01 phonebox sshd[14473]: Failed password for invalid user test from 60.19.28.27 port 27410 ssh2
Dec 7 01:31:05 phonebox sshd[14475]: Invalid user teste from 60.19.28.27
Dec 7 01:31:05 phonebox sshd[14475]: pam_unix(sshd:auth): check pass; user unknown
Dec 7 01:31:05 phonebox sshd[14475]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=60.19.28.27
Dec 7 01:31:07 phonebox sshd[14475]: Failed password for invalid user teste from 60.19.28.27 port 28724 ssh2
Dec 7 01:31:10 phonebox sshd[14477]: Invalid user teste from 60.19.28.27
Dec 7 01:31:10 phonebox sshd[14477]: pam_unix(sshd:auth): check pass; user unknown
Dec 7 01:31:10 phonebox sshd[14477]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=60.19.28.27
Dec 7 01:31:12 phonebox sshd[14477]: Failed password for invalid user teste from 60.19.28.27 port 29661 ssh2
Dec 7 01:31:15 phonebox sshd[14479]: Invalid user teste from 60.19.28.27
Dec 7 01:31:16 phonebox sshd[14479]: pam_unix(sshd:auth): check pass; user unknown
Dec 7 01:31:16 phonebox sshd[14479]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=60.19.28.27
Dec 7 01:31:18 phonebox sshd[14479]: Failed password for invalid user teste from 60.19.28.27 port 30627 ssh2
Dec 7 01:31:21 phonebox sshd[14482]: Invalid user pa$$w0rd from 60.19.28.27
Dec 7 01:31:22 phonebox sshd[14482]: pam_unix(sshd:auth): check pass; user unknown
Dec 7 01:31:22 phonebox sshd[14482]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=60.19.28.27
Dec 7 01:31:23 phonebox sshd[14482]: Failed password for invalid user pa$$w0rd from 60.19.28.27 port 31753 ssh2
Dec 7 01:31:26 phonebox sshd[14484]: Invalid user testing from 60.19.28.27
Dec 7 01:31:27 phonebox sshd[14484]: pam_unix(sshd:auth): check pass; user unknown
Dec 7 01:31:27 phonebox sshd[14484]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=60.19.28.27
Dec 7 01:31:28 phonebox sshd[14484]: Failed password for invalid user testing from 60.19.28.27 port 32702 ssh2
Dec 7 01:31:32 phonebox sshd[14486]: Invalid user tst from 60.19.28.27
Dec 7 01:31:32 phonebox sshd[14486]: pam_unix(sshd:auth): check pass; user unknown
Dec 7 01:31:32 phonebox sshd[14486]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=60.19.28.27
Dec 7 01:31:35 phonebox sshd[14486]: Failed password for invalid user tst from 60.19.28.27 port 33652 ssh2
Dec 7 01:31:38 phonebox sshd[14489]: Invalid user spam from 60.19.28.27
Dec 7 01:31:38 phonebox sshd[14489]: pam_unix(sshd:auth): check pass; user unknown
Dec 7 01:31:38 phonebox sshd[14489]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=60.19.28.27
Dec 7 01:31:40 phonebox sshd[14489]: Failed password for invalid user spam from 60.19.28.27 port 34704 ssh2

Now, there is a lot more activity in the log than this, however this should give the general idea of what to look out for… If you happen to be lucky enough to have a MikroTik router, you can help slow or prevent this with some creative firewall rules, here are the rules I am using for this, as provided in the MikroTik WiKi.

/ip firewall filter add chain=input protocol=tcp dst-port=22 src-address-list=ssh_blacklist action=drop comment=”drop ssh brute forcers” disabled=no
/ip firewall filter add chain=input protocol=tcp dst-port=22 connection-state=new src-address-list=ssh_stage3 action=add-src-to-address-list address-list=ssh_blacklist address-list-timeout=10d comment=”" disabled=no
/ip firewall filter add chain=input protocol=tcp dst-port=22 connection-state=new src-address-list=ssh_stage2 action=add-src-to-address-list address-list=ssh_stage3 address-list-timeout=1m comment=”" disabled=no
/ip firewall filter add chain=input protocol=tcp dst-port=22 connection-state=new src-address-list=ssh_stage1 action=add-src-to-address-list address-list=ssh_stage2 address-list-timeout=1m comment=”" disabled=no
/ip firewall filter add chain=input protocol=tcp dst-port=22 connection-state=new action=adadd chain=forward protocol=tcp dst-port=22 src-address-list=ssh_blacklist action=drop comment=”drop ssh brute downstream” disabled=nod-src-to-address-list address-list=ssh_stage1 address-list-timeout=1m comment=”" disabled=no

Share this post...
  • Print
  • Digg
  • del.icio.us
  • Google Bookmarks
  • Fark
  • HackerNews
  • Reddit
  • Slashdot
  • StumbleUpon
  • Technorati
  • Twitter