Syzygy Tech

April 27, 2009

Gentoo as VirtualBox Guest

Filed under: computers, gentoo, linux — Tags: , , , , — syzygy @ 12:37 pm

For a while, I kept an old 733MHz computer in my rack to use as a test box, where I could play with various software without needing to worry that what I was doing could cause problems for my desktop.  I have not used it in a while, but I decided that having a physical test machine is unecessary for what I generally want to test.  So I decided to create a set of Gentoo virtual machines in VirtualBox (version 2.2.2) so that I could run software in an isolated environment and easily be able to start again from a clean state if necessary.  Following the article on the Gentoo Wiki was helpful, but was not complete.

The first issue is the naming of the hard disk block device.  The minimal live CD detects the drive as /dev/hda however, using the driver suggested in the wiki will detect the drive as /dev/sda.  This is not a big problem so long as you make sure to use sda in /etc/fstab and in the GRUB configuration.  I’m sure there is a reasonable explanation for why this happened, but this was the simplest solution that I could think of.

Now that I have a basic, clean Gentoo install, I make two copies.  The first is a backup of the virtual machine without any extra programs installed.  This will let me install any program from the state of a brand new Gentoo install.  The second, copy is the same as the first, but with the addition of X and XFCE, so I can play with graphical programs without compiling X every time.  Virtualbox supports creating snapshots of the virtual machine hard drive, so I can revert the machine to the last state before the software I’m testing was installed.

Now that everything is working, it’s time to start testing.  First up will be XFCE 4.6.

March 13, 2009

Microchip ICD 2 and Windows Vista x64

Filed under: projects, stock clock, windows — Tags: , , , , , — syzygy @ 11:49 am

While on Christmas break, I purchased a few things to get started on the stock clock project.  First was the Explorer 16 development board, which is the same one that I used while an a co-op (internship).  I bought this particular one since I was already familiar with its features and the processors that came with it (a PIC24 and a dsPIC33).  To save on costs, I bought the In Circuit Debugger from ebay (a Microchip one, not a clone) for about half the cost of a new one.  After playing with it for several hours, I could not get it to work.  Reading through the Microchip fourms brought something to my attention.  The old ICD2 modules do not work in Vista x64 but the newer ones do.  This left me with a problem, as I no longer have a 32-bit install of Windows.  I’m not willing to change my Vista install on my desktop, so this left me with a few options.  I could install Windows 2000 on an old computer, but I would rather not have to boot another computer every time I want to work on this project.  It then hit me that maybe Virtualbox could forward the USB connected ICD2.  So my current setup is running Windows 2000 with the Microchip software as a Virtualbox guest with a Gentoo host.  This also has the added bonus of not making me reboot into Windows Vista on my desktop (dual boot Gentoo and Vista.  Vista is used for games.).  I’ve only done some minor testing, but I have gotten MPLAB to talk to the board without any additional issues.  Depending on how much free time I have, I should actually make some progress on the stock clock in the coming months.

December 27, 2008

Deny Hosts and SSH Login Attempt Behavior

Filed under: computers, linux, security — Tags: , , , — syzygy @ 10:16 pm

A few weeks ago I installed DenyHosts, a small deamon (can also be run as a cron job) that runs on my server to block IP’s that make brute force SSH login attempts.  The script has worked great, blocking over 500 hosts on the first day I used it (including myself a few times…).  One of the features of the script is the ability to send an email each time it blocks a host.  Although getting a few hundred emails at first was very annoying, setting up a few rules in gmail prevented me seeing them in my inbox (they go directly to a folder).  I did, however, start to look at the times when the various hosts get denyed.  They seem to come in large groups, so that there will be 50 or so hosts blocked in a rather short length of time, around 10 minutes or less.  The IP’s of the computers also come from all over the world, but most seem to come from Asia, South America, and Russia.  I think it would be interesting to do a more complete statistical analysis of the data in regards to the time and location of where the login attempts are coming from.  Maybe I’ll write something to do this later.

Internet Enabled Wireless Stock Clock

Filed under: projects, stock clock — Tags: , , , , , — syzygy @ 4:56 pm

A project that a friend of mine wants to complete is to build a small clock type device that can connect to the internet and show something like +/- 10% for the stock market (or a specific stock).  The preliminary concept involves 2 physical devices and a program on the computer.  The program on the computer will obatin the information on the stock performance from the internet, and format it into a percentage to be sent to the actual clock.  The program will send the data to the first device, which will take the data from the program and send it wirelessly to the stock clock via a ZigBee controller.  The second device, which is the clock itself, will then recieve the data and adjust the clock accordingly.  The plan for the clock is to use a PIC microcontrollor to take the data from the ZigBee reciever and use the information to determine how to move the clock.  The look we are going for is an analog needle type clock, so a stepper motor will be used to control the position of the needle.

Since we have just started working on this, not all the details have been worked out.  My friend will be writing the computer software and the ZigBee transmitter; I will be building and programming the clock itself.

The choice of using ZigBee is to evetually allow multiple stock clocks to recieve data from the computer without needing to dramatically increase the complexity of the network.  Plus, its a good excuse to use the ZigBee controllors that we already have.

I just purchased one of the PIC development kits that I have used before at a previous job, so once that comes in next week, I will be able to get started programming the microcontroller.  I will eventually design a PCB and have one built for the final device.  Updates will be posted once work actually starts.

November 15, 2008

Infrared Robot Detection with Obstacle Avoidance

Filed under: projects — Tags: , , , , , , , , — syzygy @ 9:52 pm

As part of a Robotics class I took as a professional elective, I designed and built two robots with the intent of having them interact with each other. My original idea was to have them play a hide and seek type game, where one robot would chase the other, while both of them would avoid hitting objects in the room. This idea was overly ambitious considering the amount of time I had to complete the project, so during the construction, I modified the design goals of the robots. In the end, I built two robots named Oedipus and Tiresias both based on a small 4 wheel drive platform used in one of the basic labs done in class. I fitted both robots with 2 proximity sensors to allow them to wander the room without bumping into objects. Tiresias, in addition to the proximity sensors, was fitted with 4 IR LEDs. These LEDs would be a beacon for Oedipus to see with a detection circuit, and thus take action. Oedipus was programmed to turn away from the direction that Tiresias was detected. If the other robot is not detected, Oedipus will wander the room in the same manner that Tiresias does.

The core of the robots is a OOPic controller, the OOPic-R board with the B.2.2+ controller worked well for this project. Its certainly not the fastest or most powerful board or processor, but provided the basic functionality I needed. This board has 4 ADC ports and 16 digital I/O ports and provides a regulated 5V supply to sensors or any other peripherals. The compiler for the chip uses its own custom syntax for many things, but also allows BASIC and C syntax for the code. The custom commands make setting up some sensors quite easy. On these robots, each wheel has its own servo, and the servo commands that are part of this compiler made it relatively easy to control them.

The obstacle avoidance used in each robot is a quite simple. Each robot has two Sharp GP2D12 infrared rangefinders mounted on the lower platform on the front of each robot. They are angled out from the center of the robot by about 30 degrees so that an object that would clip the side of the robot will be detected. When an object is detected within the range specified by the code (in this case, about 40cm) the robot will turn away from the object until there is no longer an obstruction. The proximity sensors themselves are analog and will output a voltage that is very nearly linear to the real distance of the object detected. The sensors are connected to the first two ADC ports on the OOPic board. In the code, the voltage read by the ADC is compared to a predetermined value that I found through testing the sensors. These sensors were very easy to use and seemed to be quite reliable in the testing that I did on my robots. They did not fail to detect an object even under bright fluorescent lighting, but I’m sure one could find a situation where they may not be ideal. The only time I could cause the sensors to fail was to put something about 5cm in front of the sensor in which case they would fail to see it, but due to the rather slow movement of the robot, it is very unlikely that something could get that close before the robot could react.

Perhaps the most important part of the robot was the infrared detection of the other robot. The circuit to do so is rather simple and consists of just a comparator connected to the photo transistor, a voltage divider, and an output LED to provide visual confirmation that it is working.

Infrared Detector Schematic

Infrared Detector Schematic

The IR LED is shown on the schematic for reference. To demonstrate the capabilities of the robots, I took two short videos of them in the lab. The LM339 comparator chip used is a quad package. I used three of the comparators to allow Oedipus to sense from the left, right, and behind. I could not get the fourth to work and I was not able to determine why. Tiresias had 4 of the IR LEDs in it with the 470 ohm current limiting resistors on each LED. I could have run all four of the LEDs in series and used a single resistor, but I did not think of that until after I started building the board.

The only issues I had in getting the robots to work properly, besides my own inability to build a perfboard right the first time, is that the phototransistors could detect the IR LEDs from behind and on the side as well as in front of them where I wanted. This meant that when the IR LED was susposed to trigger the right detector, the left would also trigger due to IR light going into the bottom of the left phototransistor. To solve this, I put a small piece of electrical tape to cover the side and bottom of the phototransistors which solved the issue. The robots work to my expectations, but there is certainly more that could be done with them. First of all, only one robot is able to detect the other. One robot wanders around the room without any knowledge that there is another robot involved. I would like to put detectors on both robots, and have one actively chase the other. In its current state, on robot runs away from the other, but no attempt is made to make chase. Since this project has already been completed for a grade, I doubt I will continue working on it. Below is a zip file with the code used for the OOPic controller and an EAGLE schematic of the controller board.

robotics_project.zip These files are released under GPL version 3 as specified in the COPYING file contained within.

Here are some images of the robots.

Robot




Tiresias with 4 IR LEDs


Oedipus with Infrared Detectors

Oedipus with Infrared Detectors


Oedipus Rear View

Oedipus Front View


Oedipus Rear View

Oedipus Rear View

August 18, 2008

Airplane WiFi

Filed under: uncategorized — syzygy @ 2:15 pm

There have been several recent announcements about airlines starting to offer wireless internet on their flights.  I find it interesting that they are trumpeting this as something new and exciting, when, in my mind, they should have offered internet access on planes years ago, when wifi first started to take off.  There was one quote from a Washington Post article that I find particularly interesting:

“If they charge for it, they are going to make millions and millions of dollars,” said Mike Boyd, an aviation consultant. “Most of us cannot be away from the Internet or our laptops for very long. We get separation anxiety when we are not on the Internet for a few hours.”

I do not know how they plan to make millions of dollars when the cost for service on Delta flights will be $9.95 on flights of 3 hours or less.  Sure, some people will use it, but I have a feeling the majority of travelers will simply wait the few hours until they are on the ground when they can use any number of free wireless access points.  If the airlines are planning on using this as a way to offset their other rising costs, I think that they will be greatly disappointed.  Either the cost of the internet access has to be very cheap, or it must be free if there will be any kind of significant utilization.  If the wifi was free, then the airline could use that as something to attract additional passangers.  Even if the ticket prices were slightly, say a few dollars more, I think people would be more willing to travel on that airline, because the cost of the service is hidden in the cost of the plane ticket and removes the pay barrier that would instantly turn off some people.  I can see myself paying $5 more for a ticket on an airline that had free wifi, but I doubt I would pay $5 to get internet access once I was on the airplane.  I would think that the airline would at least offer it free to first-class passangers and those that are members of the airlines club.

April 21, 2008

Project Idea

Filed under: motorcycles — syzygy @ 2:48 pm

Now that the weather is nice and the motorcycle is out, I’ve been noticing a few things that I would like on my bike.  For starters, I want a clock, but upon looking ofr a small LED clock to mount, I was not able to find anything that suited my needs.  This got me thinking that I should build a clock, as it would be a nice project now that I’ve been using PIC microcontrollers at work all the time.  Extending this, I could create a multifunction device to incorporate many more features than just a clock, which would make little use of the microcontroller.    So I’m debating about making a device with a clock, a tachometer (my motorcycle does not have one), a digital compass, and a thermometer.  I have a few ideas on how to implement the tach, but I will need to take a look at the wiring on the bike before I start any design of that part of the circuit.  Some research is in order.

January 21, 2008

Expand JFS Filesystem

Filed under: computers, felix, gentoo, linux — Tags: , , , , — syzygy @ 11:56 pm

I recently bought 2 new 500GB hard drives and am in the process of migrating my RAID array to double its size to 2TB. The current 1TB over 3 drives was 100% full, so it was something that had to be done. The expansion took about 26 hours on my 3ware 9650SE-8LPML controller, which is quite good from what I see of other peoples experiences. Of course, all important data was backed up before the RAID expansion.

The primary issue I had after the expansion was the proper partitioning of the free space. When the RAID expansion was complete, I now had 1TB of used space using the JFS filesystem that was the original partition, and 1TB of unused, unpartitioned free space. Attempts to use Gparted to expand the partition failed due to a known bug that prevents partitions over 1TB. I tried to use Parted, the CLT tool that Gparted is based on, to expand the filesystem but was unable to do so. This seemingly left me with two options, either use multiple smaller partitions, or to reformat and restore the data from the backups. I decided that smaller partitions would be a lot of extra work in terms of keeping tabs on the free space on each partition (and may require more frequent partition modifications) which is something that should not be necessary. Restoring from backups was not welcome due to the time involved. Deciding that those options were not acceptable, I was determined to find the solution I wanted, having a 2TB partition without going through a backup restore process. If anything, it would be worth doing simply on the principle of the matter: that having large partitions on a modern filesystem that supports volumes up to 32000TB should not be a problem. Several Google marathons and man page studies allowed me to successfully perform the operation that I wanted.

My main problem was a lack of understanding of the way that fdisk actually works. With fdisk, you can delete and recreate a partition without actually destroying the filesystem that lives on the partition. I am not sure exactly what the limitations are, but it seems that as long as you do not change the starting point of the partition, the filesystem will remain there. In my case, the drive in question (/dev/sda) had a 1TB partition starting at the beginning of the disk (/dev/sda1) with 1TB of unpartitioned free space residing after the JFS partition (created by the RAID expansion). I deleted the JFS partition (/dev/sda1), and recreated the partition, but this time using the full 2TB of space. In the tests that I did, the free space MUST come after the partition. I wrote the partition table, and them mounted the drive. All the data was still there, but the JFS partition was only showing up as 1TB with the command dh -h. This was rather concerning until I realized the state that the drive was in. fdisk only edits the partition table, not the actual filesystem. When it writes out the partition table, it is just redefining where the partition begins and ends and does not touch the filesystem. Thus, although I had expanded the partition, I did not expand the filesystem. Doing some more searching, I found this article that gave me the last piece of information I needed. The command mount -o remount,resize /mount/point tells the JFS filesystem to expand to fill the entire space of the partition. The command is unique to JFS and will not work on other filesystems because the options passed are used by the JFS kernel driver. When you issue the mount command, note that the partition must be mounted.

Perhaps most frustrating is the lack of data on the JFS filesystem. It does not seem to be very popular in the Linux community, most of whom use ext2/ext3. Those that do use an alternative filesystem tend to use ReiserFS with a small number using XFS. In the limited, unscientific testing I have done, JFS performed very well performance wise and used far lower CPU than ext3 or ReiserFS. JFS has worked out well for me so far and, despite my initial difficulty in expanding the filesystem, is the filesystem I will use in the future.

January 19, 2008

MacBook Air: Not Impressive

Filed under: thinkpad — syzygy @ 11:14 am

I’ve noticed that the Apple fans have been raving about the announcement of the MacBook Air, so I started looking for information on it, as even non Apple fans seemed to be impressed. In my opinion, although the Air has some nice features and is a nice looking machine, it just doesn’t cut it in terms of price, performance, and interoperability. To show this point, I would like to compare the Air to the laptop that I have been eying for some time now, the Thinkpad X61 or X61s.

In terms of weight, the MacBook Air is advertised as 1.36kg, a respectable lightweight notebook. The Thinkpad X61 is listed as 1.41kg with the X61s being 1.24kg. These weights are usually the lightest the laptop can be without any additional options. The weights are rather close, so lets see the stock features and compare.

Both the Air and the X61s come standard with a 1.6GHz Intel Core 2 Duo processor and an 80GB hard drive. The Air comes with 2GB 667MHz RAM, Bluetooth, and 802.11 a/b/g/draft n wireless, which are options that must be added to the X61s. The Air has a 13.3 inch screen while the X61s has a 12.1 inch. The thickness of the Air is 19.3mm (0.76″) and the Thinkpad is 20.32mm in the front and 27.94mm in the back. Neither come with an optical drive. Overall, the performance specs of both laptops can be made very close. Configured with identical hardware, the Air costs $1799.00 and the Thinkpad X61s with the options is $1354.00, a significant difference in my mind.

To me, the main differences are in the physical (the Air is thinner with a larger screen) and in the connectors that are available. The conneectors are something that is very important to me and is one of the main reasons that I think i would be unable to use this laptop. The Air has a very limited set of ports, namely 1 USB port, a mini DVI (useless to me) and audio. The X61s has 3 USB ports, VGA, ethernet, 1 PC card slot, and SD slot. There have been countless times where I needed multiple USB ports and in my opinion an ethernet port is not an option.  The expandability of the Air is quite limited and is something that would be very difficult for me to deal with.

What it boils down to is the MacBook Air is Apples entry into the ultralight notebook arena that falls short of the other players already on the field.  I’m sure that there are people who find the Air to be what they want, but it is not exactly a deal when there are more powerful laptops with less weight that cost significantly less.

January 15, 2008

Coming to a Windows Vista Near You

Filed under: security — syzygy @ 8:00 am

Nothing like Microsoft putting new security flaws in Windows while claiming its improving security. I don’t know why Microsoft would use a random number generator with several known and published flaws, not to mention the issue of its poor performance to other generators available. Perhaps its a standards issue, but a bad idea even if is not the default random number generator.

Older Posts »

Powered by WordPress