Monday, December 31, 2007

Homemade motor -- Part 1

While at my parents for XMas, I made a trip to the local Rat Shack. The one in their town was going away, and had 20% off everything. I ended up with some magnet wire(Since it's hard to buy small quantities online), helping hands/soldering stand combo, some POTS, and desoldering braid. I've always wanted to try to make some motors, and wanted to start with something simple. I decided to follow the instructions found here for the 10 minute motor.

The 10 minutes part is crap, it took over half an hour for me to do it, even though I think it's geared more towards kids :( The main problem I had was the insulation scraping and it took me forever to debug. The issue was that I scraped off only the top, but it really needs to be 50% of it, like the picture on the site shows. I used an LED to figure out that is was rarely hitting and generating an EM field. Also the entire thing is a balancing act till it's set up. My motor kept sliding or sagging in the middle, but I eventually got it pretty sturdy using a breadboard to 'mount' it. This is more an issue with me sucking at fine motor skills than anything else.

Pics and a video:





Now I've got to think of something more complicated to make for part 2, I was thinking maybe a buzzer or something similar, but we'll see.

iMac G5 CPU Fan

My father has an iMac G5, and these machines are notorious for emitting horrible high pitched noises caused by the CPU fan, and his was no different. Since I was there for XMas I decided to work with him to modify it to use a different fan. I followed the basic premise found here. The major difference was there was NOT a CPU fan hookup on the motherboard in his G5(Trust me I looked and unplugged everything ;) So instead we ripped out the CPU fan, cut the wires, found the 2 with the biggest voltage difference, and used that for the new fan. Also we were able to completely get the heatsink cover off, although I suspect this was because we got rid of the entire fan assembly.

The only issue was that the lines for cutting were drawn too large and we ended up with a slightly larger hole than it should have been(About a millimeter off). Also I tried one of those new-fangled liquid bearing fans. I used a 1200 RPM one, which isn't completely inaudible, but definitely less noisy than similar ones I have.

Anywho, pics or it didn't happen:



Also a side rant against Apple. First it was impossible(Yes I said impossible!) to figure out fan speed or system heat in software. Nothing was for his version of OSX(10.39 AKA: Hello Kitty) and as far I can tell there is no basic BIOS to look at. Also I couldn't find it in /proc. On the hardware side, the original CPU fan design was utterly retarded. It pushed air through a sealed up copper heatsink. This wouldn't be bad, except that the area the fan blows out is incredibly small(About 1/3 the size of a normal CPU fan). This obviously means the fan has insanely high RPMs and thus an insane amount of high pitched noise. I realize they wanted a slim form factor to look 'stylish' but did they fail to test the thing? They could easily have used multiple fans, or bigger fans on the back, but it wouldn't be Apple if it didn't suck.

Edit: To Rachel, your processor definitely should not slow down when the fan comes on. There is such a thing as variable speed processors, but those are almost exclusively used for mobile computers. I'd think it would error out if there was somehow a problem with your PSU that was draining off power from the CPU. My guess(Without knowing more) is that the fan noise is so irritating that everything just seems to be taking longer :)

Edit: A little more detail on the actual steps taken:

Modification Steps

Pretty simple, but definitely not for the faint of heart:
  1. Take off the back cover of the iMac case
  2. Remove the CPU heatsink cover(It has a big G5 emblazoned on the front). You should be greated with a big set of copper fins. There are some small tricky tabs that hold it in place. Also mine came completely off, but apparently some versions have to be cut off
  3. Find the CPU fan connector on the motherboard and unplug it, plug in your new fan and test it. But my version didn't have a CPU fan plugin(Trust me I checked and unplugged everything several times), so I forcefully removed the CPU fan(it's towards the bottom) turned on the computer really quickly, used a multimeter to check which leads were positive and negative(It had 3 wires, one is for speed sensing I think), and then cut the wires on my fan and spliced them in.
  4. Next I marked on the back where to cut for the fan(Directly over the heatsink) and cut it out with a Dremel
  5. Finally mounted the fan to the back over the hole and put everything together again

Conclusion

The computer has been running over 3 years now with no problems. It is cooler than it was with the stock CPU fan, so the modification should prolong the life. It is going at about 60C(140F) after being in use for a while. The maximum temperature a PowerPC G5 processor can run looks to be about 75-80C(~170F).

Thursday, December 27, 2007

Mp3 Splitter

Split large mp3 files into several smaller ones

Sunday, October 14, 2007

Motor PWM

For a long time I have had trouble controlling motor speed using a microcontroller. It seemed that either the motor would pull so much current and completely stop everything else, or there wasn't enough power and the motor would crawl, or the transistor used would get extremely hot and burn me.

After alot of playing around I've finally got something that has worked(Although my guess is I'm still doing something dumb). Below is the schematic...I didn't bother posting a video since it would just be a motor going slow and then fast, and the source code is really simplistic as well for the microcontroller.



Some things I found, that may or may not be correct:
  1. Needed two 9V batteries to get enough current to power the motor at full speed and keep the circuit operational. I'm running them in parallel although this may be incorrect. Running with one battery lets me only get about 1/3 of the top speed till the rest of the circuit dies.
  2. Switching and current work together to make transistors become incredibly hot. So for example I tried doing something like switch the transistor on one cycle, off the next cycle, and repeat forever to achieve half power. Bad mistake that resulted in a minor burn, the constant switching with current to drive the motor about blew the transistor. Now I'm switching twice per 10000 cycles, so if I want half power I do 5000 consecutive cycles on, and 5000 consecutive off.
  3. Motors can get stuck, with very negative consequences! If you use really low power the motor will jam until either it's getting enough current to break free or until you rotate it into working. This doesn't seem at all bad, until you realize it sucks in heroic amounts of current trying to turn itself in the meantime. This causes the power on everything else to go out, the transistor to burn up, and even the power source to get overheated. Lesson is, unless it's a stepper motor, it should be going a decent speed to be in use.

Tuesday, October 02, 2007

Mandelbrot Programs

Some old programs I wrote back in college I wanted to post so I wouldn't lose them. They are the result of a full day of tinkering with the mandelbrot set in bizarre ways. There are three programs in the order they were written. The only really dependencies are the math C libraries, X11 windowing system, and /dev/audio is writable. *snip--nm*

mandelWTF -- Randomly changes the mandelbrot set and outputs sound based on the images...don't ask ;)
mandelSound -- Slowly permutes the the mandelbrot set and then generates sound from the inside out

mandelUpdate -- Uses the escape time as a weight, and then updates surrounding 'nodes' based on the new weight.

All source code can be found here. Run make run to see them in action. And for some reason I can't get mandelWTF to work outside of a script, it segfaults....which is just weird.

Sunday, September 16, 2007

Remote Speakers

A smaller project I've spent a couple days on is modifying an old receiver for wireless headphones to work with normal RCA plugins and using power from the wall instead of batteries. The proof of concept was very easy and took less than an hour. Basically cut out the headphone speakers and hooked up male RCA cables to each. Also for the power I checked it with a multimeter(It was 4.5 V) and then found a wall plugin that matched. For the current I started by trying to use the current of one AAA battery(Roughly 1000mA) and found that worked fine so left it at that. I did have problems opening them up and made some dremel cuts on it till I figured out where the screws were.


Next the long part was compressing it down into a smaller package. This involved taking out the wires that went between the headphones and replacing them with shorter wires, and eliminating wires not needed anymore(Like the headphone's internal amp to the headphone cup). Also hooking up the power to the switch and cutting out the battery pack holder. Picture below is about 1/3 of the way through:


The finished product turned out okay. The two cups didn't quite match up, so there is a large gap on one side. Also the tool marks from the original attempt at opening the headphones. Hot glue was use to hold the wires in place(And avoid any shorts from moving wires) as well as keep the cups together. All the buttons(Power, amp, freq) and LEDs still work and are easily accessible. I also ran the antennae wire to the outside so I could improve reception and avoid it contacting any of my wires on the inside.


The finished 'setup' is an old torn apart stereo system, with speakers positioned to project sound below(This is all up in my work shop in the loft). I'm using my vaulted ceiling to try and redirect the sound to hit both ears, which has been working pretty well, except the left speaker sounds like it's coming from directly above instead of to the side. I've been using it all day with no problems, and it sounds much clearer and better than the crappy TV speakers, even with them being on a different floor.


In the future I want to splice out the IR receiver on the stereo and position it so I can change the volume downstairs without moving(Right now I'm using the transmitter's amp). Also I need to change around speaker position to get better left and right separation, as well as tweak all the amps. There are now 4 amps that come into play which is the TV, the transmitter, the receiver, and the stereo, so it takes a fair amount of fine tuning.

Wednesday, August 15, 2007

PIC Analog and Interrupts

Well first, I've figured out how to get analog input finally. There are special calls in MPLab C18 that set up most of it for you. I still have to play around some since it turns out sensitivity can be changed. Anyway, the code can be found here. All it does is change the speed of one of leds depending on the POT's value, and also displays bits [3,11] of the integer representing the value. The two tasks are made independant by having a small delay and just counting foo cycles to pretend their are bigger delays. IE the delay is only 25 but if I want the light to slow down flashing to say 50 I have it wait 2 cycles before toggling, meanwhile the value is still being updated.


My practice of basic interrupts took quite a while. The code is here. Basically it counts down, from input garnered from the dip switches and then when the button is pressed it toggles between being paused and not. Below is a video of it running, note that there is a slight delay since I wait for the button to come up, and it starts of with 2 LEDs lit because of the DIP switch settings:

Friday, August 10, 2007

LED Chaser Redux

Okay, so to put it elegantly this is absolutely butt-fucking pointless. On the other hand it was good practice and I learned a few things. Anywho the source code can be found here, it is suprisingly commented for once.

Basically it has modes, that can be set with switches, that dictate how the lights will move(Sweep back and forth, go one way pause and loop, go one way and immediately loop, flash between colors), and has push buttons to increase or decrease the speed.

Below is a video of it running in the dark, I kept it at high speed so I could fit all the modes in a brief amount of time, so it looks a little psychotic:

Thursday, August 09, 2007

PICKIT 2 Programming

I finally got my hands on a decent PIC programmer, and have finally gotten it working. Surprisingly I had more trouble with the compiling of programs than I did with hooking it up physically. The first is figuring out the header files to use, I've always been using p18cxxx.h(For the pic18F chips) and delays.h(This is just for adding waits) which are both needed for any sort of toy programs. The main problem though was pragmas, which took me a while to figure out. The three that I've always been using since it's been working are:
#pragma config WDT = OFF // No clue, but always needed
#pragma config OSC = HS // Use external oscillator

#pragma config LVP = OFF // Turn off LVP Programming


My toy program is a simple LED chaser that goes back and forth and gets progressively faster until it goes so fast it's just flashing all of the LEDs. The source can be found here.

Here's a picture of the breadboard...really only 5 of the LEDs and the microcontroller are used to run it, as well as the oscillator, the rest is just other tinkering. I just left the pickit2 plugged in since I was reprogramming it alot, except I've always been having to swap the voltage on the pickit2 with the voltage on the breadboard:



Saturday, July 28, 2007

ROTN Development Setup

So right now I'm working on setting up my local environment to be very similar to my work environment. So far I've got up a code repository at sourceforge and can use CVS(I've only got up the algorithm for encoding and decoding written in C++ up for now). After the environment is set up my next task is deconstructing Phex, to see what is reusable and make an API for it. I think the first real release will more or less be Phex with a Web GUI and that is easily cross platform and when you receive an incoming file it obfuscates it and shares that on normal Gnutella networks.

Just a note to myself what else is needed to finish my dev setup:
  • Regression testing scripts
  • Aliasing my environment to have the same commands as work
  • Setting up different baselines to work in
Also I have a silly little program I wrote that I will post later that shares a joystick over a network. I originally made it so my wife and I could play games together on her new computer, which only has one USB plugin(Now we are just using the netplay feature of ZSNES). But I think it could also be handy for something like controlling playing DVDs or Games remotely if you have a computer acting as a media center.

Thursday, July 05, 2007

Eggcellent

It's not eggactly(The puns will stop over my dead body!!!) finished yet, I'll work on it more this weekend. I wish I had a jumbo sized one. (Note the red hue is artificial but close to how it looks, the flash on my camera completely rapes the glow of the egg).

(Edit: More info)
Basically what I was originally trying to do was have an egg flash while the alarm went off. My plan was to just hook it up to sync with the beep by splicing off the wires to the clock's speakers. This didn't work as is since the voltage coming out was too small, so I tried using transistors(I have no clue what type. I plugged some in till I got the desired behavior), which worked but was too dim. I ended up chaining the transistors together and came up with something extremely sensitive. So sensitive that just approaching it would set it off. So then I decided screw the alarm clock I'll just have it glow brighter the closer someone gets. Below is the very basic circuit I used, note I don't know if I have the transistors properly done in it(ECB and all that), but it gets the point across:


Well the weird thing is if the light source is inside the egg it stops working completely, which I don't know hardly anything about EM fields or whatever is involved to even hazard a guess as to why this is. The original picture is just an antenna in one egg and the light in another, which worked as expected(Getting near the unlit egg lit the other one).

Right now I have no clue what I'm doing with it, I'm trying to use spare parts I have to make an egg do something interesting, but I'm missing a lot of essential stuff(Timers, op-amps, etc). One thought was maybe make an EMI sensor, where the egg glows brighter the more there is....I'll just have to see if I can find another handfull of transistors to get it that sensitive.

Wednesday, June 27, 2007

Bunny Pen :(

Unfortunately I've decided to completely scrap the bunny pen. Several reasons for this:
  1. We would never lock her in, since she is fully trained and accustomed to having run of the apartment (Edit: We've taken to locking her up at night, and I've made a crude but much more functional pen for this purpose)
  2. The thing would be huge and use up even more space than her designated area already uses
  3. The main reason is the wood is shit. It's bowed and bent, and when trying to make frames this doesn't go well at all :( I've learned not to buy cheap wood, unless you plan to plane it yourself.

(NOTE WILL PUT UP PICS LATER)

Also another woodworking blow this week: IKEA!! I was thinking about making some very simplistic furniture to replace some of our old stuff, and then looked at IKEA for ideas. It seems nuts to spend $30 on wood to make a simple shelf when something like this exists. Or chairs like this. The thing is $100 may seem like you could make it cheaper(And hell you could probably find one for $20 at walmart), until you consider all of IKEAs wooden furniture is made with solid pine, as opposed to garbage like particle board. So even for a simple chair like that you can figure probably $35 for wood, $30 for batting and foam, and $25 for fabric if you made it yourself. So you may save $10, but would probably go over from screw ups and just the hardware needed. Some of their stuff isn't as god-awful cheap(sofas mainly), but they are still very competitive to building it yourself. More elaborate furniture would be much better to make yourself, but since I live in an apartment I can't really use the big power tools that would be needed.

Right now I'm just working on making some sawhorses and such for my workshop using the crappy wood, since who cares how that looks as long as it works. After that I'm not really sure, I may work on a couple of my electronics projects.

Saturday, June 16, 2007

ROTN Look and Feel

Okay, I know it's bad to work on the front-end before the backend. But I've went ahead and done some of the basic stylistic stuff, just for fun. This is far from done, but shows how easily themeable the thing is(Each theme took less than 5 minutes). Also it is slow due to google pages, it will be blindingly fast when run locally as it is meant to.

Here are 3 themes I whipped up(Using public domain images of course):
(Edit: These in no way reflect my personal preferences, just attempts to make very different styles. Tux was the test theme, green was a 'teen' theme, flower was a feminine theme)

The only image differences are the top image and the status bars on the download page. Obviously this will mostly be dynamically generated(Save for the css and images) by the local web server gui monstrosity.

Friday, June 15, 2007

P2P Apps

Seems like lately I've been talking alot about P2P applications and looking into some of the internals of them, for various reasons. Basically I'm just posting my thoughts for anyone to refute/confirm them, and also if there are any major contenders I'm not thinking of.

Napster
Pros: Easy to use, lots of users with lots of content.
Cons: Died due to centralized servers being the target of litigation

Gnutella/decentralized P2P apps
Pros: Easy to use, lots of content, no centralized server to litigate out of existence.
Cons: Arms race between hostiles and developers, as well as a legal liability that encourages leeching, with no barrier to prevent it.

Usenet
Pros: Incredibly fast, lots of content, legal problems are very minimal right now.
Cons: ISP dependant, and legal troubles are only minimal due to the small user base arising from difficulty for the average idi...user

Bittorrent
Pros: Can be very fast for popular content, no centralized servers to attack.
Cons: Large legal worries for protected content. Unpopular content can be very slow. Edit: Central servers to host trackers

Direct Streaming
Pros: Fast, safe legally for users
Cons: Requires a central server with large bandwidth and paying royalties

P2P Streaming
Pros: Grey legal area compared to normal P2P, can be very fast for popular content
Cons: Requires a lot of collective bandwidth or video quality reduction, unpopular content would lag or take hours to start playing

WASTE/Darknets/Etc.
Pros: Can be completely safe legally
Cons: Always slow and usually a technical barrier that's too high for average users thus causing a lack of content

IRC
Pros: None
Cons: It's IRC :-D

Really I think any new P2P app that would be successfull needs to be:
(1) At least as fast as gnutella
(2) Madly user friendly to keep from frightening the great unwashed
(3) Have content already in place
(4) Have legal protection to make it safer to share

I'm trying to make ROTN to address each of these:
(1) Cut out the deniability to begin with to keep speed
(2) Web Server GUI to keep people in their browser
(3) Have it able to leech off of existing Gnutella networks
(4) Use headless random data in blocks so that no person is sharing files

The only main problem I've found is that to do 4 will require at least 2 other parties to be involved(One to distribute the head, and the other to distribute content).

Also I had a cool idea for even further headless data randomness, make the head variable length, which if you use that as an encryption method makes it even harder to crack.

For example lets say you have a seed from 0 to 100,000 for the RNG so if you know the size of the chunk you are missing you can still get away with trying 100,000 times if there is known text from what you are retrieving. BUT! With a randomly variable sized head you could improve upon this by how many ever bytes the head is. For example if a head can be between 1kb to 101kb, you get 100kb*100,000 seeds = 100,000 ^2 = 10,000,000,000 possible combinations of seeds and header sizes. You could do alot more fun stuff too, like make the head also have itself be an XOR key, driving this up into an insane number of tries needed to break it. The big problem with this as encryption is that it's a shared secret. Really though I'm just talking about cryptography academically as opposed to anything particularly practical. Also this assumes that the psuedo RNG is NP hard to determine the next bit of output...I have no clue if this is true or not for normal RNG algos.

Saturday, June 09, 2007

Local Web Server GUI

Here is simple proof of concept for using a local web server as a GUI. The code is here and yes I know it's freakin' Java. The reason being is that socket stuff in C and C++ isn't cross platform(Windows throws away standards and uses garbage like WinSock, and yes it is completely stupid and anti-competitive of them). To run it simply do the following:
  1. javac WebServer.java
  2. java WebServer
  3. Then point your browser to localhost
  4. To kill the server type murder in the text box
It's a very silly little program, but at least it does what it's supposed to(Take input locally from the browser). Below is a screenshot of it running in all it's glory:



Another nice thing about this setup as opposed to a normal application, that instead of minimizing, iconifying, or putting it in the system tray to get rid of it but still have it running, you can simply navigate away from the page and then come back later.

Monday, May 28, 2007

Random Obfuscation Tool

---snip---

With current companies seeking to extort money from anyone sharing files, it's always a good idea to try finding ways around their BS. One thought I've been mulling over is sending computer based random data. The original idea was that of a one time pad, where you XOR a message with random data and then use this new set of data with the random data you used earlier to retrieve the message.

To break it up into steps:
  1. sender: message XOR rand_data = pad
  2. receiver: rand_data XOR pad = message

The problem with this is that any data you wanted to get you'd need twice as much to reconstruct it, so it becomes terribly inefficient with large files. But assume instead of true random data used to XOR you used computer generated random data. This type of random data can be reconstructed given a seed value. So instead of the above scenerio:
  1. sender: message XOR rand(seed) = pad
  2. receiver: pad XOR rand(seed) = message
But this seems troublesome too, not because of inefficiency but since now one would be saying that the random data isn't actually random by giving the seed value. So instead what if we had a mechanism to guess the seed without being given it. Lets say pad in the example above has a md5sum of chksum then lets assume that the first values of message are chksum, we can then try all possible seed values until we get that the first few bytes are equal to chksum. So in steps:
  1. sender: message XOR rand(seed) = pad
  2. sender: md5sum(pad) = chksum
  3. sender: (chksum XOR rand(seed) ) = rand_chksum
  4. sender: rand_chksum + pad = new_pad
  5. receiver: md5sum(new_pad - rand_chksum) = chksum
  6. receiver: rand(all_seed) XOR rand_chksum until equals chksum
  7. receiver: Now knows seed that sender used
  8. receover: Mptes tjat pad = new_pad - rand_chksum
  9. reciever: pad XOR rand(seed) = message
A little more complicated, but still efficient, and keeps it so sender is transmitting random bits and no additional information.

Currently I have a working prototype that does the same thing except the chksum is replaced by known plaintext. I want to finish it in it's entirety before publishing it. Below is a list of what I need to do before it's done:
  • Check that user input is correct, very simple 5 minutes of coding
  • Use checksums instead of plaintext for the known text
  • Write a couple of layers to run underneath popular P2P apps to automatically accomplish this
Thankfully the main program was easy to write after I brushed up on binary I/O, it can transfer large files moderately quickly although it does use a decent amount of memory, which I might eliminate if I find it is too big a problem.

The main reason I think this is better than encryption is that there is deniability over the contents of the data since any piece of data coupled with other data crafted through XOR can be made into any other piece of data. So saying that the random data is a song is really baseless from a technical standpoint since it could just as easily be a copy of Firefox. Another plus is that even if it was decided to be an encryption method anyone attempting to sue would have violated criminal law since they circumvented a protection mechanism thus violating the completely fucking retarded DMCA(No need to mince words).

One other thing I have been thinking about is perhaps multiple, easy to render, legitimate reconstructions of the same random data. This may not fool anyone, but may make it easier to show the down syndrome patients that run the courts that random data truly can be made into anything. For example if they say that you could brute force a seed value to retrieve a song, you could also say that using a built in hash function it creates an animated picture. There are obviously major hurtles to this, without getting back into the whole redundant data problem, so for now it's just an idea.

Finally this is all a moot issue if the thought crime law ever passes. Basically it says that attempted copyright infringement is illegal, so if a large media conglomerate puts up popular_song.mp3, and someone downloads it, even if it's a garbage file that doesn't have the song in it, you're still legally liable as if you had downloaded the song. Although IIRC downloading songs is still a legally gray area, so they may just wait for you to be sharing it, so then they can say you were attempting to distribute copyrighted material.

---snip---

Friday, May 11, 2007

Documentation

*snip*

Just for safety, I archived away the old post since it was a little too detailed and made me sound slightly crazy(I'd been comparing about a 1000 pages of documentation for a solid a week, which apparently melted my brain).

Sunday, April 22, 2007

Storage Server Mark I

First to keep track of what I'm doing: The bunny pen is *almost* done, just gluing the joints together, which is a little more painful then it should be.

Now onto my new computer...what originally was going to be a cheapy sub $100 encryption backend, has now ended up costing over $300($80 HD, $85 CPU, $25 RAM, $80 MOBO, $35 Case) and is insanely overpowered and now replacing my old computer. Dual Core Pentium D processor, with .5GB 800mhz DDR2 RAM, and SATA 300 harddrive. Couple that with buying the most expensive DSL service available, and it's a completely different computing experience. I had really doubted whether or not it would make a big difference, but I've noticed on average really system intensive stuff like emerge goes roughly 6 times faster than it used to. Also I couldn't imagine not having a multi-core/cpu system anymore, since that seems to make the biggest difference in performance. Basically, any new process picks the core with the least load on it, so for example if you are generating a big encryption key you won't notice any sluggishness when opening other applications since it's running on a completely different core. This more or less eliminates the need for a separate machine for encryption like I originally wanted to do.

One weird thing with SMP(Symmetric Multi-Processing) is with emerge. It uses both cores simultaneously. I think I figured out what it's doing though. It seems to calculate the dependencies for compiling and pick any 2 that aren't dependent on one another and ready to be compiled and do both simultaneously. You can tell when it runs out of these since there will be large gaps in one core while it waits on the compilation of the other to complete.

There are a few problems with having bleeding edge equipment though. The biggest dissappointment is the SATA 300 harddrive, which is what I originally based the system around. It's speed is definitely faster then the fastest PATA devices, but not by leaps and bounds. After some research it just appears that not everything is 100% supported yet since they are so new, so hopefully in a couple months I can get a little more speed out of it. Another thing is that the built in NIC refuses to be seen by any version of Linux. My assumption is that the chip isn't supported yet, or at least not in any stable branches. This isn't a big deal since I have tons of PCI NICs, but only the newest kernel versions can support my PCI bus. I've had to use alot of things marked Experimental in the kernel, since they are recent additions. The hardware sensor monitor, just supports temp and fan speeds, but the kernel notes that it supports alot more info that will soon be supported. Also another weird thing, that I don't know if it's common, is a dedicated random number generator chip, which I'm currently not using, but is still interesting. The onboard soundcard, seems to be anti-supported...very few versions of Linux I tried hit it properly(They see it, but everything generates a horrible high pitched noise), and their are very few channels available to adjust in ALSA, another thing I hope is better in a few months.

Eventually I'd like to put in a little more memory, since I use about 80% of it now, and *maybe* a new graphics card, although they are so expensive and moderately unecessary(Since the onboard one seems to do everything just fine).

Onto the pics:

All the pieces(Except I didn't use the graphics card I layed out):


Everything together:


Temporary Work area(Obviously will remove the extra monitor, keyboard, and mouse soon):



And to the 3 whole readers besides myself: Next installment you can look forward to exceedingly technical babble about the ridiculous way the system is set up. Think tin-foil hat levels of encryption and programs/scripts to smoothly perform RBAC control, as well as dockapps galore!

Tuesday, March 20, 2007

Writing to video memory

Jay and I were having a discussion about directly writing to video memory. Being the adventurous type I ordained to try it. The device I had to use to accomplish anything was /dev/fb0current. The first picture is simply /dev/mem > /dev/fb0current. The second one is from writing the video memory to a file and then rewriting it back after moving around windows...it pretty much restored the state it was in including the AIM conversation. The third one is of something weird I found...I loaded a picture during one of these runs and found that it was permanently screwed up...even after restoring everything(By going to a VT and back to X), and refreshing the image it stayed the same, no clue why. The last one was simply switching to a vt and issuing sleep 3; cat /dev/urandom > /dev/fb0current; DISPLAY="0:0" ksnapshot and then switching to X(Rather bland but I put up anyway). All this was done in a Knoppix live CD. As always click pictures for higher res photos:






Edit: Jay pointed out to me that the last picture is gigantic(~2MB) compared to the other files (~0.2MB). This is due to the fact that since the data is random there is no way to compress it down, so every single pixel has to be accounted for.

Tuesday, March 06, 2007

XMMS in Gentoo

The Gentoo maintainers in media-snd decided to hard mask *everything*(Including plugins etc) for XMMS recently. Well, since I like XMMS and it's the only thing that handles the plugins I like, I spent a little while getting it working. I didn't really want to do make install just to keep it from screwing with anything, but for now this works just fine:

1) Go here and download both gtk1.2.10 and glib.1.2.10 tarballs
2) Untar the packages and cd into the new glib directory
3) run ./configure for glib
4) Fire up your favorite text editor(vi of course ;) and open up gstrfuncs.c
5) Find every instance of g_warning and add a comma(,) after every instance of G_GNUC_PRETTY_FUNCTION
....so for example you will have: g_warning (G_GNUC_PRETTY_FUNCTION ,
6) There should be 4 of these in total
7) Now run make, and if that goes well make install
8) Now set your LD_LIBRARY_PATH to /usr/local/lib
....LD_LIBRARY_PATH="/usr/local/lib"
9) Now run the ldconfig command
10) Go out of the glib directory and over to the gtk directory
12) Run ./configure for gtk
13) Now do a make, and make install
14) Finally grab the xmms tarball here
15) Untar it and cd into the directory
16) Run ./configure
17) Open up your editor and goto General/ir/ir.h
18) Comment out the lines for extern of pthread_t and gboolean(Line 52 and 53 in my version)
....//extern pthread_t irapp_thread
....//extern gboolean keepGoing
19) And finally run make and make install

For me none of these steps were superfluous, even the final make install. Eventually I want to make a tarball for my own future use that will take care of this automatically as well as do something like isolating these(gtk1.2, glib1.2, xmms) to their own space in opt automatically(Which IMO seems like what the Gentoo maintainers should have done).

Saturday, March 03, 2007

Travel Bunny Cage

I made it a long time ago but keep forgetting to post the details.
First the materials used were:
  • a cheap piece of 2'x2' plywood for the base
  • rabbit fencing for gardens
  • pre-cut boards for the runners(Which was a mistake)
  • Carpeting
  • Wood staples
  • Wood screws
I had my wife stain and paint the runners as well as put in the carpeting. Originally tried to use carpet tacks but they kept coming out of the plywood too easily, ended up using a staple gun with wood staples which worked perfectly(You can't see them in their or anything, and pretty sturdy). Construction was simply drilling guide holes for the wood screws, I just made marking for the runners to baseboard, but should have made a jig, even though that went okay. One thing is that the plywood was only 3/4" thick so my slightly unstraight holes were a problem since they bowed the wood. I need to make a jig sometime just for doing straight down holes. I was thinking of maybe taking 3 boards attached to a block with a drill hole in it, the boards would stick up and act as a guide for the drill body, and to use it you could just keep it flush against the back and work it down through the hole. One good idea that came from this was attaching the fencing to the baseboard with staples first and then sandwiching it with the runner using woodscrews. It makes it seem very solid and I can't imagine the fencing coming off, even though the baseboard is crap wood. Another problem was the pre-cut boards, they aren't precise and left a small gap...I now own a decent hand saw(For $7) that I use which would have been perfect. The door isn't attached since when it's not in use as a travel cage we cover it with an old yoga mat so it provides a hiding spot and a place to climb. I will probably attach the door with just some cable ties and maybe 'lock' it with velcro(Since during travel my rabbit doesn't attempt escape), so I can take off the door easy later on.

The pics, although not the best since they were taken as an afterthought:

Thursday, March 01, 2007

Filesystem Speeds

Overview

This was a precursor to my Encrypted Filesystem Tests, to check the effects of filesystem operations on CPU. After reading a couple of very good articles here and here(Which seem to conclude to use either JFS or XFS). I decided to do my own benchmarking specifically geared towards CPU utilization. While not terribly rigorous it did seem to pretty much follow their findings. The results below are from an average of 3 runs per each type of test. Also I didn't try Reiser4 but instead included FAT ;)

Results

Copying between drives:
..ext2 = 16s
..ext3 = 11s
..jfs = 14s
..xfs = 8s
..fat = 18.2s
..reiser = 8.5s
..Winner = xfs

CPU usage after the copying:
..ext2 = 1m 23s
..ext3 = 1m 27s
..jfs = 1m 13s
..xfs = 1m 24s
..fat = 1m 19.5s
..reiser = 1m 29.6s
..Winner = jfs

Copying a file to same drive:
..ext2 = 12s
..ext3 = 13.5s
..jfs = 20.6s
..xfs = 11s
..fat = 18s
..reiser = 2.5s
..Winner = reiser

Removing data
..ext2 = 0.21s
..ext3 = 0.20s
..jfs = 0.19s
..xfs = 0.22s
..fat = 0.57s
..reiser = 1.78
..Winner = jfs

CpuProg time during copying:
..ext2 = 1m 36s
..ext3 = 1m 37s
..jfs = 1m 25s
..xfs = 1m 30s
..fat = 1m 37s
..reiser = 1m 36.5s
..Winner = jfs

Copy time with CpuProg running:
..ext2 = 16.5s
..ext3 = 15s
..jfs = 17.87s
..xfs = 16s
..fat = 19s
..reiser = 12.1s
..Winner = xfs/reiser

Total to run benchmark tests:
..ext2 = 5m 5.5s
..ext3 = 5m 7s
..jfs = 4m 49.5s
..xfs = 4m 44s
..fat = 5m 11.5s
..reiser = 4m 55.5s
..Winner = xfs

Notes

The program to run the cpu just made a huge 2D array and copied back and forth. Alone without any disk activity before or during it took almost exactly 1m 4s each run. Also it may seem odd to check the CPU reduction after the copying was complete, but in practice this always seems to be where the most activity occurs(Probably due to buffered IO delaying the actual work). Another weird thing was removing files(Which granted was too small a set), that most had times under a tenth second consistently(And an outlier), except for FAT which always had times over half a second. In conclusion I think I'm going to use xfs, although it's a little worse on CPU than jfs it does seem to noticably copy faster. Also FAT was worse in about every aspect compared to any other system, couple that with external fragmentation and I can't imagine using it for anything but compatibility reasons.

Reiser

ReiserFS deserves it's own section due to it's bizarre nature. All the others were very consistent between runs with usually around a second difference in results, but Reiser was completely random, sometimes a copy would take half a second, other times 30 seconds...I could find no rhyme or reason to why(i.e. not the first time was slow and the rest faster or any pattern). Overall though it was usually slower than most of the others. Especially on removing things it was incredibly slow compared to even FAT. Also the copy time with cpuProg running I put xfs/reiser because reiser was much slower usually but always had a couple ridiculously fast runs(Fractions of a second) that made the average low.

Tuesday, February 13, 2007

Old Bunny Cage

I realized I never did document the original cage I made, so here it is. The construction was done with simply a hammer and pair of pliers. The materials were rabbit fencing, thumbscrews to act as pegs, eye-screws, chicken staples, and an 4'x2' piece of oak. Here is a picture of it completed:

With hindsight I realize there are several flaws...the major one is rabbits don't like hardwood, so we eventually had to put down a blanket. Also buying really nice wood was pointless since it pretty much got ruined from the water bottle dripping and urine before the rabbit was trained. Another thing is that it has no runners, so all manner of rabbit waste and hay get kicked out. Here it is a lot later with an old shower curtain under it, some toys, and a pillow(Hay stuffed) and blanket my wife made:

Monday, January 22, 2007

Computer Cooling Mod

Finally fixed the massive overheating issue on my main computer, I hope. I took a small high speed fan and added it to the side. Some things to note: First I had no easy way to cut a hole, or series of even small holes and ended up using a large circular drill bit with teeth(Like the router bits for making wheels). The case was insanely thick and had a layer of thin sheet metal, what looked like graphite in the middle, and an aluminum coating on the outside. Very tough to get through, but thankfully I have a really powerful drill. Secondly I had no room in the case, so had to make room by using a dremel to cut off part of what holds the drives. Below is a picture of the uncut side followed by the cut side:



Here's the drilled holes, I added the second smaller hole for the potentiometer on the fan, which I borke trying to put it in the case :( I think I will add a nice one with a knob when I feel up to scrounging for parts and opening my computer again.

One final irritation, was I didn't want to mess with trying to put in screws to hold the fan(I decided for several reasons to put the grill on the inside too), so I ended up screwing fencing wire into the fan itself and then securing the wire with good old fashioned duct tape, I forgot to take a picture unfortunately. Here's a couple pics of the finished product, no noticable heat problems yet.



Also note to self: I had to after playing around with it reset the FSB speed, and of course my dumbass self set it wrong and had bizarre errors since the memory and bus from the processor were going at different speeds ;-D