Monday, February 23, 2009

It has some kind of aesthetics.


Let me start by saying that this is an old and already completed project, but I felt like I needed something other than computers up here to sort-of dial back the "power nerd" thing I had going on. Then again, maybe building a lamp from scraps isn't the most normal thing, but it's at least better for you to read about than me messing around with UNIX. Eew.

Any way, my roommate and I moved into a place in Charleston a while back and were not prepared for the condition our apartment was in. It was in great shape, but didn't have any lights in it except the kitchen. And maybe the bathrooms. There were light switches for the main rooms, but you needed to provide your own lamp. I had only brought one lamp because my parents wanted to throw it out (hooray cheap college-type furniture from the 80s) and that had to go in my room so I could get dressed and do other important "life" things. I don't remember what my roomie did for a lamp, but we didn't have any lights besides the kitchen and our TV in the living room. We talked about biting the bullet and spending money on a lamp from Wally World, but then I realized I could probably build a lamp for cheaper than I could buy one. (Plus, I like building stuff. I also really hate going to Wally World.)

First I found my trusty roll of electrical tape. Then I gathered spare building materials. I had just finished building a sort-of shelf for the trunk of my car (more on Sue later) and I had some spare wood left over. Toss in an old extension cord to connect all the bits, and the only parts I had to buy were the switch and the base for the lightbulb, and these ran me about $5.

From the top down: I electrical taped the base for the lightbulb to one end of the leftover wooden post I bought for the legs of the shelf I built. Sure, I could have glued it, or bolted it down, but times were rough, and we only had daylight available for a couple hours a day. No time to be dainty.


Also, I went with the classic incandescent bulb. It's not a matter of light quality, or that I'm a huge fan of Thomas Edison (he was kind of a dick). It was just lying around so I used it. But once it burns out I'm totally going with the flourescent bulb. Those babys might not be real environmentally friendly, or great to have around pregnant women, or easy on the power grid, or safe in general, but they are real easy on the power bill, and what really counts is saving me money.

Next I cut up the extension cord and attached it to the various parts, making sure to run it through the light switch too. The switch has a neat feature where it illuminates when it's off so you can tell where it is. I didn't know that when I bought it, but it is quite handy.


Pretty much all that was left was making it appropriately tall, which was accomplished using some orange stakes and another piece of wooden post. And lots of electrical tape. The base I used at first involved wood, but it didn't survive moving, so now I just have it zip-tied to a futon. It's not the most attractive thing, but it works. And this current model has survived three moves, so even though the electrical tape might not look savory, it does the job without starting fires. And that's always a bonus.


As a side note, I feel I should mention that you should NOT build the lamp in a place you don't want it to stay, put a CFL (compact flourescent light) in it, then lift it up to move it without first noting available clearance between the lightbulb and the celing. Otherwise, a glass tube filled with mercury is liable to shatter on the celing and shower you with bits of glass and other unsavory things.

Sunday, February 22, 2009

MythTV

So my MythTV computer has been down for a while, so I decided to go ahead and try and fix that computer for the thousandth time so I can do the whole DVR thing again. For those that don't know, MythTV is a free and open-source software project for Linux platforms that lets the user do all the cool television things that you could do with a DVR (TiVo). Like any Linux software, though, it takes some fiddling. For me, it takes a lot of fiddling.

I started this project about three years ago with an Emachines computer (1.6 GHz Pentium 4) I bought from a friend for $150. I put in an nVidia GeForce 5500 FX graphics card in it (it had VGA, S-Video, and DVI out, so I had lots of options.) The card was state of the art at the time I bought it. I also bought a Hauppauge WinTV PVR 500 which has [unnecessarily] two TV tuners on it. What I didn't realize, though, is that there's only one coax input on it, so it makes the second tuner kind of useless for me, since the only video input it takes is component or S-video, and who uses that for TV?


Any way, the cooling fan on the graphics card was the first to go. I was young at the time, so when it started making buzzing noises, I took a paper clip and some electrical tape to physically stop the fan from turning. This actually caused more damage to the card, because when you stop a motor like that, and power is still applied to it, bad things happen. After THAT damage was done, I realized the power to the fan could simply unplugged from the card.

Next, the computer only came with 128 MB of RAM in two 64 MB sticks. But it's not just any SD or DD RAM, it's a very special type of RAM called RDRAM. Basically, if you bought a computer in the four months before DDRAM took hold, you might have this type of RAM. The only thing to know about it is that it's slightly faster than SDRAM and generates an enormous amount of heat. Any way, back in the days of Ubuntu 5.10 Breezy Badger, 128 MB was just fine. I made the decision to upgrade when 7.10 came out two years later, and 128 MB wasn't enough any more. So I upgraded the RAM to 1 GB using four 256 MB sticks.

To deal with all of these heat sources (the Pentium 4 was notorious for doubling as a space heater, the broken cooling fan on the graphics card didn't help, and the four sticks of RDRAM pretty much put the computer over the edge as far as heat is concerned) I mounted a four-inch, 120V AC box fan to the side of the case which blows cool air into the computer. It's a little bit noisy, but it works. Well, sometimes I think it causes a power surge to the computer if something gets in the way of the blades of the fan, which is not particularly healthy for the computer. But at this point, I've put too much work and money into the computer for me to give up on it. Kind of a catch-22. In a moment of frustration, I did try and move the hard drive and TV tuner card into this bottom-line Dell I got for free, but the tuner card was too long for the unusual enclosure that Dell decided to put around its PCI slots. I hate Dell.


Any way, the latest cause of failure for this computer is that MythTV simply locks the computer up when it starts. I'm not exactly sure how to deal with this, I think I'm going to try and reinstall Myth but that's a last-ditch effort before reinstalling Ubuntu just to get a fresh start on everything. We'll see what happens.

--

OK! Reinstalling actually worked, which is good because I had lots of episodes of South Park and Becker saved. Hopefully it lasts for a while before it breaks again.

Saturday, February 21, 2009

Firewall

I've built network firewalls before, but this time I'm going to try and go all-out. The hardware I'll be using to build my firewall on is an old Gateway 2000 with a 233-MHz Pentium II that a friend gave to me. (Yes, that's a 5.25'' floppy drive.) The old setup only had input from the internet (RED) and output to a GREEN zone (my LAN). This time I'd like to have it handle a wireless LAN, called the BLUE zone, my wired-only LAN which will be the former GREEN zone, and an ORANGE zone that will only have one computer on it, my server. All of the zones are separated by a DMZ within the firewall.

The reason for putting the wireless separate from the rest of my LAN is more security concerns. Someone can run a man-in-the-middle attack on a wireless network and sometimes can intercept not only wireless traffic, but traffic traveling through wired connections. It's just another level of network security. Same for the ORANGE zone. Since this will be a server facing the outside world, it's generally not a good idea to have it on the same network as computers with sensitive data. The firewall will do its best to keep all of these networks separate to make it harder for anyone to sniff around my network.

I use IPCop (http://www.ipcop.org/) for my firewall's software. It runs exclusively on whatever computer you decide to use, but is not hardware intensive. This means that old, obsolete equipment like this is perfect to run IPCop on (hence the 12-year-old Gateway). My former install of IPCop worked well for a couple weeks and then randomly started restricting download speeds from 350 kb/s or so to 30 kb/s or so. That was really annoying, and I couldn't figure out how to solve the problem, so as much as my paranoid self hates to have my cable modem plugged straight into the wireless router, I was forced to by circumstance.

To start, the computer has two NICs installed in it. One will be RED (the outside world) and the other GREEN. I should be able to install the BLUE and ORANGE NICs after the install. The reason for waiting is that I have several old NICs and sometimes IPCop won't have the drivers for them. So, there's a lot of trial and error that happens. But IPCop needs at least a GREEN interface for the installation procedure, and I know that IPCop has drivers for the cards in the computer now. (Yes, I know you can theoretically install drivers yourself, but I don't know how/don't want to mess with doing that.)

There are detailed step-by-step instructions for installing IPCop (http://www.ipcop.org/1.4.0/en/install/html/) so I won't go into it here. I'll be back after my initial install is finished.

Make sure that all of the cables are plugged into the right NICs. For example, if you try and plug the outside internets into the GREEN NIC then it'll crash the DHCP server on the firewall. Just something to note.

Any way, now that I have the base install finished, I need to run a speed test to make sure that the firewall isn't arbitrarily restricting my bandwidth again. The speed test showed about 6 M down and 1.8 M up, which is normal.

Now I can SSH into the firewall instead of having to hook my monitor up to it. This only takes some fiddling around with the web interface. The only thing I really need to do, though, is shut it down so I can install the other two NICs.

That was surprisingly successful. The "tulip" card I tried to install didn't work last time because IPCop couldn't find a driver. But if it's working now, I'm not going to argue. Now the only thing left to do is to plug everything in to my firewall how I had planned for it to go before, only I'm missing a key piece of network hardware: a switch for the GREEN interface so I can plug more than one computer in to the protected LAN of the firewall. Oh well, I'll make do, I suppose.

--

OK I finished my firewall. And it was working for a little bit but it seems to be doing it's old thing where it restricts download bandwidth. I think it might be a bad hard drive. Any way, there were a couple of issues with the firewall which affect my Solaris project. First of all, my server operating in a DMZ didn't work well because my desktop can't see its Samba and DAAP shares, and DMZ pinholes don't really work passively. So, the only thing keeping my server on that part of the firewall is my missing piece of network hardware. I'll deal with it until I can get a new switch. But I'll probably move my Web/SSH servers to Solaris and have that operate on ORANGE and then keep everything else on my server, which will eventually move back to my GREEN LAN. Any way, more later.

--

OK, I tried a new hard drive that I know is good. It's not the hard drive. Download bandwidth went back to 1.5 M and upload is a normal 1.8 M. Don't have any idea what's wrong, but I don't really torrent anything so I haven't noticed any usability issues... yet.

Solaris 10

So I've been thinking about building some kind of server with Solaris 10. Solaris is a free operating system that's built by Sun Microsystems and is based on Java. I used Solaris 9 in the first programming class that electrical engineers have to take at Clemson, and since then I've heard that the new version (10) is great for server-type things. Maybe I can get a web server going.

I have an old-ish Dell Dimension desktop with a Pentium 4 that should be good for the project (Solaris only runs on x86/64 and SPARC). My experience with Dell, though, has been that they put unusual proprietary hardware in their base-line desktops in order to save money, and you'll never be able to find all the drivers you need unless you're using Windows. And sometimes not even then. But any way, it's the only computer I have around.

I realized that I need to get my firewall working first, before I mess with any new projects. So I'll come back to this when I finish.

--

So the firewall is [more or less] working again, but I'm giving up on that for now. Solaris is installing itself on the Dell, so I'm going to get some samiches while it finishes.

--

So I'm usually right when it comes to Dell doing stupid things when they build computers. This time they built a computer with integrated graphics, then put a PCI video card in too, only the PCI card overrides onboard video by default and if you remove the card, the BIOS can't tell and you have to put the card back in to change BIOS to use only the AGP onboard graphics. The kicker is that Solaris couldn't recognize the PCI card after the install, because it's some lame proprietary Dell card, so I have to do it all over using the generic AGP graphics card. Shoot me in the face.