website free tracking

Monday, January 14, 2008

Boxbackup

For a long while I have pondered and tried to find an elegant way to backup my co-located server. I tried and failed with Amanda and several home-brew scripts. I finally stumbled across boxbackup.
Boxbackup is a multi platform network backup device. One system acts a a server to which clients (windows mac linux bsd) can connect to and backup files.
Boxbackup uses libsync (think rsync) to only synchronise files that have changed. Also because there is both a server and client agent its should be more efficient than rsync alone.
Security is assured through the use of Tsig certificates. Certificates are used to encrypt the data transmission and secure files as they are transferred.

Server Setup

There are Debian packages available here Download
wget http://www.backports.org/debian/pool/main/b/boxbackup/boxbackup-server_0.10-1~bpo.1_i386.deb
then install
dpkg -i boxbackup-server_0.10-1~bpo.1_i386.deb
The debian installer didnt work out very well for me so I manually ran. Replace server1.example.tld with the name of your server.
bbstored-config /etc/boxbackup server1.example.tld bbstored
Change directory
cd /etc/boxbackup/bbstored
Create a certificate authority
bbstored-certs ca init
Sign the server key
bbstored-certs ca sign-server server1.example.tld-csr.pem
copy the certificates into the bbstored directory
cp ca/servers/server1.example.tld-cert.pem .
copy the server cert
ca/roots/clientCA.pem .
My server is behind a NAT firewall so I had to open port 2100 and edit /etc/boxbackup/bbstored.conf from
ListenAddresses = inet:server1.example.tld
to
ListenAddresses = inet:10.0.0.254
Create a client account, each client is identified with a unique hex code 75AB59D
bbstoreaccounts create 75AB59D 0 20480M 20480M
The numbers with M following are the soft and hard limits for the amount of space on the server to allow for backups.
Start the server
/etc/init.d/boxbackup-server start

Client Setup

Log into the client computer, download boxbackup-client
wget http://www.backports.org/debian/pool/main/b/boxbackup/boxbackup-client_0.10-1~bpo.1_i386.deb

and install
dpkg -i boxbackup-client_0.10-1~bpo.1_i386.deb
You will be prompted to let Debian guide you, it didn't work for me. Change to the boxconfig directory
cd /etc/boxbackup/bbackupd
and run the config generator
bbackupd-config /etc/boxbackup/ lazy 75AB59D server1.example.tld /var/bbackupd /home /var/www

The final entries are the directories to backup.
Copy 75AB59D-csr.pem to the main server /etc/boxbackup/bbstored/ and sign with your server certificate.
bbstored-certs ca sign 75AB59D-csr.pem
This will create 2 files ca/roots/serverCA.pem and ca/ clients/75AB59D-cert.pem. Copy these to the client in /etc/boxbackup/bbackupd/
Start the client
/etc/init.d/boxbackup-client start
Check its running
grep bb /var/log/syslog
You should see something like

Jan 14 22:53:54 client bbackupd[3540]: Starting daemon (config: /etc/boxbackup/bbackupd.conf) (version 0.10)
Jan 14 22:53:55 client bbackupd[3540]: Beginning scan of local files
Jan 14 22:53:55 beta bbackupd[3540]: Opening connection to server server1.example.tld...
Jan 14 22:53:56 beta bbackupd[3540]: Connection made, login successful

Good Luck!

Labels: , ,

Tuesday, September 25, 2007

ispCP secondary dns

I wrote this little guide on how I got secondary dns working on my isPCP box.

Labels: ,

Wednesday, August 22, 2007

Linux netboot

I spent today setting up a new server for one of our customers. The customer had ordered it and had it sent to us to install all their software onto. It had a couple of really annoying features, firstly it didn't come with a powercable and as the office is bereft of spare parts I had to get back in my car go home and get another cable. This was to go with the keyboard monitor and mouse I had already dragged down.
On returning I realised there was something even more worrying than the missing powercable, on the front of the unit there was a rectangle of plastic. Unfortunately rather than being the cover of the cd-rom drive I was expecting this was a blanking plate. Yes thats right I had a server with no Operating System and no cdrom.

Fortunately it is possible to install linux from a remote machine provided the target computer is a able to run a PXE (preboot execution environment) boot from your network card. So I spent the morning configuring my laptop to act as the host server and deliver the initial files via tftp.

I had planned to install Centos as its closer the the normal Red Hat advanced server we use. Unfortunately despite a lot of effort the PXE boot images didn't work. Next I tried Debian, which booted but then failed to see the network card, preventing me from continuing. Ubuntu was next like Debian this booted and the initial installed seem to be ok, then it just hung very annoying.
Finally in desperation I tried Fedora, which actually proved to be the easiest to get going only four files needed and it worked straight away. I was very shocked! Whilst I was playing about with different netboots my colleague went out and acquired a usb cd-rom. He arrived just as Fedora was installing I decided it would be quicker to installed from the cds I had already downloaded rather than pulling a distributions down from the net. So despite its superior netboot Fedora was forgotten and I put a fresh install of Centos on.

It proved to e a really slick process I was very impressed. I managed to pretty much get everything done in a few hours including installing our software. Next week I have the pleasure of delivering the server to the customer so I want to make sure its as finished as possible before I arrive onsite.

Labels: ,

Wednesday, May 16, 2007

Motley Fool gives linux thumbs up

Personal Finance website Motley Fool has a rather interesting money saving tip, use an old pc running Linux (Ubuntu).

Labels: ,

Thursday, February 22, 2007

Unlink a symbolic link

Had problems deleting a symbolic link to a directory today. That was until I found out about the "unlink" command. Just typing the following,

unlink symlink

Should remove the symlink in situations in which rm wont.

Labels:

Wednesday, December 13, 2006

xargs

Found a really useful tool today call xargs used it to copy a list of files, I had a file "static.list" which had a list of files which I needed to copy one per line.

Running the following

cat static.list |xargs -t -i rsync -v CB_DATA/{} rsync://192.168.0.226/opt/advancesbak/CB_DATA/

Run the rsync command

rsync -v CB_DATA/filename rsync://192.168.0.226/opt/advancesbak/CB_DATA/

for each filename listed in "static.list"

Labels:

Sunday, January 22, 2006

More Linux, and Lost

I felt so tired waking up this morning; fortunately to cheer me up I received Lulu's new year card today, was such a welcome surprise hiding in amongst my junk mail. It was lovely to read and made me smile a lot. I wish I had been able to put the same level of sentiment into my letter t her I guess I am just not as good at expressing my feelings as she.

I decided to do something productive with my, so I read some of my latest buy does anything eat wasps a book published from the last word articles from the back of New Scientist. There are some really freaking / interesting questions and answers well worth an afternoon read. I also managed to clean the layer of dirt off my car its black again now!

After that I went to the gym for my first weights routine of 2006, a month off weights certainly makes a massive difference I was a lot weaker, hopefully I should be able to build back up fairly rapidly though.
I the evening Bruce and Phil came over we upgraded the memory in the terminal tournaments server and also built a new Linux kernel optimised for the server. Hopefully this will give a significant performance benefit. I also started downloading a fresh steam installation in an effort to fix the weird start-up issues we had at the last Lan. The next one should probably be the biggest yet with a load of returnees who couldn't make it to the Christmas bash and some of the new Christmas players coming back for more. I can't wait!

Whilst it was downloading we watched episodes 10 and 11 of lost series two, I know I have said it before but lost is getting more and more weird diverging from what I liked about it in the first place. It's still enjoyable to watch just not quiet as cool as series one. We also watched a bizarre Japanese film called Dead or Alive it was violent weird and visual Phil's going to have a great time when he visits there in March.

Labels: , ,

Saturday, January 21, 2006

Martins PVR

Its been a long, long week at work. I have been trying to decipher a lenders calculations. It has kept me very busy both at work and some nights at home. My January of cutting down drinking meaning I have been going out much less.

Today was successful in a couple of ways, firstly with Keith's help finally managed to get my APR to match the banks so hopefully that can be tested next week. in parallel we have attempted to tick off a couple of annoying bugs for the workflow project..

Then in the evening went round to Martins house to have a look at building a PVR. Some time last year we stared installing SuSE on and old AMD 800 with a Hauppauge PVR 350, at first tried SuSE 9 which for various reasons never really worked since then about 5 months ago its sat in the corner of Martins lounge. He has been rumbling about installing media centre so I decided fuck it I will get Linux working especially after recent successes with SuSE 10 on my laptop and Debian on the various servers.

So one SuSE installation later and hours spent pissing about with various guides found ivtvs own install guides the most useful. Unfortunately SuSE 10 comes with old ivtv drivers which didn’t work with the extracted firmware, and worse SuSE 10 comes with GCC 4 which wont compile ivtv new drivers, so after several hours I gave up on SuSE as a bust. Fortunately Januarys edition of Linux format had a Mythtv special and they recommended knoppmyth a version of Knoppix especially configured to run myth tv. One download later and it was installing, the install is a little rough round the edges simply wiping out whatever is on the driver (which was ok in our case). The system installs runs through a series of configurations dialogues which guide setting up Mythtv. The setup is mostly command line based, but fairly straightforward. A couple of bugs later and I was in the myth setup I chose the card and the TV guide feed restarted the interface and hey presto working myth. Event the remote that came with the card worked yay!

There was an issue with the XML download for the TV guide not working but given it was 1.30am and I was tired I decided to call it a night. At least the PVR works recording pausing live TV and all that.

Whilst that was going on Martin Jim (Phil's Brother) and Endo were building and testing Endo's speakers with Clio what a weird program it does various tests on speakers all very cool.

Labels:

Thursday, September 15, 2005

Routing

Well made it to the gym again for a cadrio only sesion my shoulder is still sore I must admit its really starting to annoy me now I just want to start training again.

My blinds are now up so my room is finally finshed yay! So last night I got to sleep in my own bed again its so much more comfortable. Its strange really compared to some of e hostels I stayed in when I was travelling round OZ the spare room is excellent yet somehow knowing I have a lovely warm comfy bed in thesame house made it less habitable. Well that and being surrunded my my dads horded crap wasnt any fun.

Phil came round lt night to draw on m linux knowledge, it made me realise that since working for Tbred I have done a lot less basic neworking it took me half an hour out work out the correct routing commands. Using a Suse Linux 9.3 computer as a router with two network cards and routed running on one side was a windows client on the other my apple mac. Each seperate side had its own gateway, so the metric had to work that traffic travelling between the neworks was least cost but for each side its own gateway had a lower cost than routing across the network.
It was a bit confsing but we managed in the end SuSE is even a pretty good Linux when you turn KDE off and Phil bough me some beers for m trouble :-D

Labels: