Raspberry Pi as a thin client

 The processor on the Raspberry Pi isn't all that fast, so why not offload it? I have a HP ML350 that is mostly idling, except when I need to use PostgreSQL, so I thought to set it up as a desktop server for my Pi.

 

I set up a RDP server since it works well with Linux and also Windows. First thing's first, install xrdp and all other dependencies:

 

apt-get install build-essential libpam0g-dev libssl-dev x11vnc vncviewer fakeroot checkinstall x11vnc xrdp rdesktop

 

Then, install your desktop of choice. I chose XFCE since it's pretty lightweight

apt-get install xfce4

I've had problems getting it to start X remotely, so I fixed it with the following. Do this in the user's account (/home/pi for example)

 

touch .Xauthority
chmod 600 .Xauthority

And that's it!. Start up your Raspberry Pi, install rdesktop, and connect to your server:

rdesktop -g 1024x768 -P server_address

How not to order RAM

So, back in June or so, I ordered four sticks of 2GBs of RAM for my main workstation, DDR2 PC6400. Couldn't wait to get them right? So, a month goes by and they finally come in. Now, the board I have right now is a Supermicro X6DVL-EG2 which accepts ECC RAM. I thought my current RAM was non-ECC so I said fuck it and ordered non-ECC RAM. Wrong. RAM came in, tried it, motherboard beeped at me. Fuck. So I sent it back out east for a refund (to Newegg). A week or two goes by until I get the refund so I go ahead and order DDR2 PC6400 RAM. Though, when I remember installing the last sticks of RAM, I remember reading "DDR2 400MHZ ECC ONLY" on my motherboard. Ahh, fuck it. New RAM comes in and, oh, surprise! It doesn't work! 

 

So, now I'm sending it back to Newegg for the second time but I have to pay for shipping ($20) to get a refund. Turns out, the right RAM (PC3200 ECC) is $45 per stick, when the PC6400 ECC was $30. I found a cheaper price on eBay so woohoo. Next time, I'll be more careful.

Oh, great

So, my SCSI drive came in the other day. Dropped it in a drive bay and fired up the server. But oh no, beeping arose. Looked up the beep code and now it's about the processor. Either the processor isn't seated well or I need to replace it. Awesome. I probably should have grounded myself before hand. Strange enough, if I change the jumper settings on the motherboard, from the default 700Mhz to 750Mhz, the beeping stops. Dell says the default speed is 550Mhz but I'm not sure if these are the default processors.

Now, I have a 65 kilogram, metre long brick sitting here. Doubles as a place to put cups though.

PowerEdge 6400

 

So I got this Dell PowerEdge 6400 and wow. First, this thing is gigantic. Eight hot swappable SCSI bays in the front. Free is a good price ;)

Inside this thing has two Intel Pentium III Xeon processors, running at 750MHz each. Where you see the RAM is actually a tray of RAM. You can remove the tray and fill up 16 DIMMs. Hot swappable PCI ports too. Three redundant power supplies in case a tornado hits or something. I'm planning on getting a SCSI drive or two and getting Solaris running (or perhaps Nexenta).

SHOUTcast server

As finicky as I am about music, I'm one of those guys that'll change the song halfway through it. So, I thought I'll set up a local SHOUTcast radio to prevent that and create less distractions.

Download SHOUTcast DNAS either beta or stable (I chose stable) from here. Edit sc_serv.ini in the SHOUTcast program files folder. The only thing you need to change is your password and whether you want a public or private server. Next, download Winamp to make it easier to manage. Also download the SHOUTcast plugin for Winamp (here) and the null output plugin (here).

 

Once everything is installed, open up Winamp and go to DSP/Effect. Click 'Configure the active plug-in'. Go to the 'Output' tab and proceed to fill in your information. If you chose to use the stable version of SHOUTcast DNS, check the legacy mode box. Select your encoder and it's settings. Check the boxes for auto connect. Make sure your output is using the null output plugin, unless you do have a soundcard (for whatever reason). 

Start up SHOUTcast DNAS, either GUI or CLI then Winamp. Open up your favourite music player with the URL 192.168.x.x:8000/listen.pls and listen away!

iStat on pfSense and server monitoring

One of my most favourite apps for my iPhone is iStat. It lets me monitor all my *nix servers in a beautiful interface. For my Linux clients, all I had to do was download the client, extract and compile. And since my router is running pfSense (FreeBSD 7.2) I thought I might as well get iStat on there.

 

Apparently, the developers edition of pfSense has all the goodies to compile stuff. Without even thinking of cross compiling, I quickly set up a VM of FreeBSD 7.1 (I know little to nothing of FreeBSD so I opted to get something near 7.2) and started to compile it. I had to get libxml2 first though and for FreeBSD 7. Anyway, logged into pfSense via SSH, fetch'd libxml2 and installed it. Now, since my router had nothing to compile packages with, I built iStat in the FreeBSD virtual machine and transfered the resulting mess to pfSense via SFTP. Now, since I couldn't have run make install in pfSense, I had to create /usr/local/etc/istat.conf and filled it in with the configuration file from another Linux client. I also edited the configuration file to fit the network interface (xl0 instead of eth0).

Looking back, I probably could have done things a little different. Either way, I got the job done. Now I'm happy that I can monitor my entire network with one app. I recommend for those that are in need of a functional server monitor to check out iStat for the iPhone. Be warned that iStat only supports one interface so far.

 

Since I have one Windows server I like to monitor that too. And for that, I have WinAdmin for remote RDP (great app) and Weave, which is almost a Windows version of iStat (but not). Awesome monitoring gauges in there. And, since it uses push notifications, it can alert me when the CPU usage is above 92% for example.

Another great agent-less monitoring app is Net Status. It simply pings the most comment ports on your IP of choice.

Also, see the attachment for the agent compiled on FreeBSD (i386). I can't guarantee that this will work for you.

 

Syslog server on Lenny

So, I installed VMWare Server on my Windows Server 2003 box the other day. Downloaded a Debian Lenny image and got it running. Never dealt with VMWare Server so it's pretty neat to configure virtual machines from a convenient web interface. The web interface was having issues at first, of which I tracked down to IIS. The web UI runs on port 8333 and IIS runs on port 80 of course. Disabled IIS and the web UI was up and running.

 

After that it was all down hill. Set the network adapter on the VM to bridged. Got the virtual machine running and started installing packages and such. At first, it couldn't resolve names so I had to correct /etc/resolv.conf and point it to my DNS servers. 


Anyway, I decided I'd set up a syslog server. Lenny now uses rsyslog but I went back with sysklog. Edit your /etc/default/syslogd, and change SYSLOGD="" to SYSLOGD="-r" for remote logging. Still on the syslog server, I edited /etc/syslog.conf and added *.* /logs/file.log to make sure everything was working.

On the clients, or nodes, I edited /etc/syslog.conf and added *.* @192.168.0.113 (or whatever your IP is). After reboots of sysklogd on the servers and the nodes, it's finally working. Going to get lighttpd working with the logs, perhaps set up a little PHP script to read the logs.

I do really like this VMWare Server, it lets me utilize this server more. I might get it running on my other servers on that note. Plus, it's free. Can't argue with that ;)

As usual, comments are welcome.

 

So it just had to be the Windows box

Photo by MarkyBon

About last week my Windows Server [2003] (I had 2008 on there, then went back to 2003) server wouldn't boot. Since it's not accessed externally, I run TVersity to transcode by movies of which I watch on my 360.  

So, it wouldn't boot up which was great. Kept going into an endless loop, after POST it would keep rebooting. Dead RAM? You'd think it would beep if it was. But nope. Swapped the power supply and still nothing. Loose connection to the case fan? Still, nothing. Only other object that was still plugged in was the hard drive. Unplugged it. Booted normally (though it couldn't since it was the only one). Awesome. Ended up re-installing Server 2003 last night, turned out fine. 

Still puzzles me that it wouldn't boot at all. BIOS detected it fine, but once it tried to boot from the hard drive an endless loop occurred. Working well now, which is a surprise.

 

While I'm on the subject of shitty mishaps, my main web server packed it in. Didn't bother reading the logs, plugged in the monitor: kernel panic. Sweet. Screw it, reboot. Ran for couple more days. Again, kernel panic. Reboot, about two more days then it failed. Been down most of today, finally booted up my other spare web server which I should have done in the first place. Apparently Torrentino gets quite a large number of visits. 15000 this month.

 

'Bout time I head off, shit to do.

 

 

 

 

How to: Simple load balancer setup for web servers

I finally put together a load balancing setup together this weekend, and I'm surprised it was this easy.

What you'll need is three servers, two web servers and one server for the load balancer. It's not recommended that you only use one load balancer since it's a single point of failure (SPOF) but I only had one extra server on hand. For this tutorial, I used Debian Lenny.

 

First thing's first, download and install pound on your load balancer. 

 
 

apt-get install pound

 

Once you've done that, head over to /etc/pound and edit your pound.cfg file accordingly. Here's an example for the web servers:
 
 

   
Service

#first web server
BackEnd
Address 192.168.0.114
Port 80
End

#second web server
BackEnd
Address 192.168.0.116
Port 80
End

 End
End   

 Also be sure to set your ListenHTTP address and port.

Now edit your /etc/default/pound file and change startup=0 to startup=1

Start pound up with /etc/init.d/pound start If everything is configured properly, check out http://1.2.3.4:8080 (or whatever IP and port you put in your pound.cfg)
Half the time, the requests should go to Server A while the other half goes to Server B (you can configure this). For anything else, check out the man page here or type man pound
 

Luckily, my file server is running NFS and SAMBA, so I can have the same content on each web server. I couldn't completely get NFS working on Windows Server 2008 (which is on one of the web servers, ugh) so I mapped a SAMBA shared as a network drive and that seemed to work. 

 That's the end of this short tutorial, but keep in mind there's more things you can do with pound. You can set up chroot jails, HTTPS balancing and way more. Any comments or ideas are appreciated.

 

Klam fyr

Life has been comme ci, comme ça lately. Lately, I just don't care about anything. School especially. I really just don't care about anything. It sort of gave me more freedom though. I do whatever I want to and I don't give a shit. I get ASC which fucks me up even more. Maybe it's the energy level, I don't know. That's it, I just don't know.

I feel like I'm being pulled down all the time, having a weight on my back. Guilty conscious? If only I had feelings; then I'd be normal or at least sub-par. 

I rarely talk about myself in my blog and it's about time I do. Depression has really messed up my concentration level. I haven't done any real coding in a long time. I can't bring myself to it. It's difficult.

As with most of my newer blog posts, they contain a picture that [sometimes] symbolizes my post. This one sums it up.

 

Coding has come to stand-still. I was planning on working a wee bit on Sysode, but never got around to it. I'd like to switch the backend to SQLite, instead of PTB.

 

I have a total of 7 servers,  4 of which are unused so far. I'm not too sure what I want to do with them. I'd like to transform one into a database server, but I'll still be left with 3 unused servers :s

Maybe it's time I quit blogging for a bit, and try to work on life?

 

Anyways, I'd like to finish this blog entry with a quote from Futurama:

When you do things right, people won't be sure you've done anything at all.