Sector Size on Virtual Machine

Background:

I noticed that on my virtual machines, the number of heads / cylinders on the disk are far larger than would technically be possible

A normal hard drive has 2 heads per platter, and up to 5 platters for a total of 10 heads.

This vm has 255!

root@ubuntu:~# fdisk -l

Disk /dev/sda: 21.5 GB, 21474836480 bytes

255 heads, 63 sectors/track, 2610 cylinders, total 41943040 sectors

Units = sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x0002a643

Device Boot Start End Blocks Id System

/dev/sda1 * 2048 40105983 20051968 83 Linux

/dev/sda2 40108030 41940991 916481 5 Extended

/dev/sda5 40108032 41940991 916480 82 Linux swap / Solaris

Question:

41943040 sectors * 512 byte sectors = 21474836480 bytes (21GB)

41943040 sectors / 2610 cylinders = 16,070.130268199 sectors per cylinder (Strange that isn’t divisible evenly)

Apparently further research is needed.

  1. Why do virtual machines have 255 heads?
  2. Why do the number of sectors per cylinder no divide evenly?

If you have any ideas, leave them in the comments.

Arduino Powered Foosball Table

wpid-foosball005-2013-04-15-23-11.jpg  + wpid-foosball008-2013-04-15-23-11.jpg  = Screen Shot 2013-04-15 at 11.57.54 PM

Why Attach an Arduino to a Foosball Table?

– Because the foosball table is clear on the opposite side of the building.

– Because we can!

What are those parts?

– The gold disk is a piezo electric transducer, commonly known as an electric guitar pickup. It converts vibrations into electricity.

– The red circuit board is an Arduino with Ethernet. It uses the standard Arduino library to handle dhcp requests.

– The circuit board is soldered after the knock sensor tutorial on arduino.cc http://www.arduino.cc/en/Tutorial/KnockSensor

– They grey cables are Power Over Ethernet Injectors (POE). They are not required if your foosball table is in reach of a power outlet.

Where can I buy this stuff?

Arduino – http://arduino.cc/en/Main/ArduinoBoardEthernet

POE Cable – https://www.sparkfun.com/products/10759

Piezo Transducer – http://amzn.to/XDxBiT

1 Mega Ohm Resistor – Radio Shack

Circuit board – http://amzn.to/XDxHqM

Headers – https://www.sparkfun.com/products/116

Wire – Your local garbage can

How do I code it?

See the code on github.com/spudstud/Foosball . You will need an account on cosm.com to store your sensor readings. Replace the “Feed ID” with your feed Id, and the “Data-stream” with your data stream name.

You will need to generate a new Private API Key and replace the API key in the code with your own API key.

Cosm.com documents how to get code from an arduino to their servers here: https://cosm.com/support/examples and here: http://arduino.cc/en/Tutorial/PachubeClient

The webpage uses jquery and the cosm javascript library. You can find examples of how to use it in the “Sandbox” directory in github https://github.com/spudstud/Foosball/tree/master/sandbox

The Cosm javascript library is documented here: http://cosm.github.io/cosm-js/ Cosm developers are very active on stackoverflow.com

Once you have the webpage how you want it. You will need to create an ubuntu virtual machine and install apache to host the website. It does not need to be on the same network as your sensor.

I highly recommend setting up your ubuntu web server using vagrant.  http://docs.vagrantup.com/v2/getting-started/index.html

How did you make the webpage so pretty?

The majority of the webpage was coded by a friend who does web development professionally.

The github and “i” icons are actually fonts, not images. http://bit.ly/1190Sjj

The green button is made entirely with css3 and gradients.

The graph is made with cosm’s graph builder http://bit.ly/1181kRM

Only the flat piezo elements work, speakers pulled from computer cases absolutely do not work. http://bit.ly/XOkrSu

What If I want to make my own awesome foosball table, but I have questions?

Leave a comment below

Ask your question on stack overflow and tag “cosm”

Go to the Arduino Forums

Any problems you discovered on the way?

I was going to use a raspberry Pi, but they don’t have analog sensors. Lady Ada has a great article of how to work around this: http://bit.ly/VHTEmS

Arduino Ethernet has 5 analog pins, but pins 4 and 5 are used by the ethernet shield. Pins 0 and 1 are also shared and shouldn’t be used.

What if I want to see pictures and a video of the table?

Here you are!

wpid-foosball009-2013-04-15-23-11.jpg

wpid-foosball002-2013-04-15-23-11.jpg

wpid-foosball003-2013-04-15-23-11.jpg

wpid-foosball004-2013-04-15-23-11.jpg

wpid-foosball006-2013-04-15-23-11.jpg

wpid-foosball007-2013-04-15-23-11.jpg

available unavailable

Youtube

http://youtu.be/hi32JtDzm6I

 

Reset Cisco 1200 AP

1. Assign computer static ip in same subnet as 10.0.0.x with /8 subnet mask (255.0.0.0.0)

        wpid-systempreferences-2011-10-21-11-3714.png

2. Connect Crossover Cable to Ethernet Port on AP

        wpid-img_0216-2011-10-21-11-3714.jpg

3. Connect Power to AP – Allow 30 seconds to boot up You will have either 1 or 3 green lights

wpid-img_0218-2011-10-21-11-3714.jpg

4 You are now going to continuously hold the ‘Mode’ button down for 30 seconds while performing these other tasks:

        - 10 seconds with power

        - 10 seconds without power

        - 10 seconds with power

        - As you connect and disconnect the power with one hand, Make sure to always keep the ‘Mode’ button pressed down with your other hand

5. Wait until the lights change or about 10 to 15 seconds, then let go of ‘Mod

6. Navigate to 10.0.0.1

wpid-googlechrome-2011-10-21-11-3714.png

Username = Cisco

Password = Cisco

wpid-googlechrome1-2011-10-21-11-377.png

If these steps didn’t work

  1. Power cycle the device, then give it up to 1 minute to start up and try webpage again
  2. Verify you are using a cross-over cable and that the cable is good
  3. Make sure all other network interfaces are turned off on your laptop / desktop, especially wireless. Ensure your computer is not connected to the internet.
  4. Restart your browser if you have changed the state of any network interface cards on your computer. Some browsers tie all traffic to active interface on startup.
  5. Perform reset sequence again waiting 20 seconds between each step.

SSC Spread Spectrum Clocking – Hard Drives

A little known feature on many new hard drives called SSC has caused a lot of people to wonder if they should turn it on.

wpid-screenshot2011-07-07at10-46-14am-2011-08-4-11-252.png

The answer is NO unless you are working as an electrical engineer and are using an oscilloscope nearby, or if you are working on the large hadron collider and can’t have any interference. (If you are working on the large hadron collider please contact me because you are my new best friend).

wpid-sprdspclk-2011-08-4-11-252.gif

A default hard drive emits electrical radiation similar to the green line

A hard drive with SSC enabled would look more like the red line.

I can’t verify this, however supposedly enabling SSC slows down the spin up times of the hard drive thus making it a fraction slower in tests.

Open Source Hardware?

Hackers, modders and makers have always loved the idea of open source software such as linux, because it is the antidote to being owned by ‘The Man’. No one likes the idea of being limited or told how their software should run.

The Open Hardware Summit is the organization behind a radical new idea of ‘open hardware’. What open hardware means is that companies / hobbiests can choose to release the schematics and information of a product to the world free of charge. Anyone is then free to use the designs for their own use, or even in a product that they sell. I will be finishing up the schematics for my word clock and releasing both designs under the Open Hardware license in the next couple of months.

The common paradigm has been to protect your intellectual property to prevent outsiders from making cheeper duplicates of your product. Rather then hide away from those who would like to take your plans, embrace them with open arms.

If you design hardware and want to share it with the world, you can put the Open Source Logo on your designs. The neat part is that until April 15th 2011 anyone can vote what they want the new official logo to be.

Take a look at the candidates and cast your vote here.

wpid-open-hardware-logo-vote-2011-03-31-17-29.jpg

Image credit HackADay.com

Terabytes of network storage

There are a dozen different ways to share the terabytes of data you have acquired over the years. Some of the more popular include NAS’es (NASi? NASen? NASouses?), Drobos or just shoving dozen drives into your main desktop. I have long been attracted to drobo for their simplicity and elegance, but find that they are just too much money for a poor student like myself. There are other alternatives like Windows Home Server, UnRaid, OpenSolaris, Terastation, Nexenta, FreeNas, Openfiler , Ubuntu but I frequently start pulling out my hair every time I sit down to try and build one because there are too many options and each have their own pitfalls. One particular homebuilt nas that I particularly love is the black dwarf. I wrote a blurb about it here. The interesting part is that he is using plain old windows 7 as the host operating system. I would like to go a little more elaborate than that. I am leaning towards FreeNas or OpenFiler, but just can’t decide how to take the plunge.

        I came across a blog post at frankleng.me that takes you step by step through the process of building a FreeNas, most importantly using the ZFS file system. In case you didn’t know, ZFS is an open source alternative to FAT32, NTFS, and similar formats you might be used to.

When I get back to rexburg my plan is to start building a free nas using parts that I already have laying around. The goal is to spend less than $75 in additional parts, to create a SFTP, AFP, Samba network shares. Most importantly the box must be able to be backed up to an online service like CrashPlan, must transparently take several drives and make them appear as a single Drive, and it must be upgradeable with new drives in the future.

Please post your comments on what has and hasn’t worked for you.

Resources:

FreeNas
http://www.youtube.com/watch?v=16v4jNYH0GI
http://www.youtube.com/watch?v=mgJNzyTSv6c
http://www.maximumpc.com/article/howtos/how_to_build_a_nas_box
http://www.maximumpc.com/article/features/cheap_and_nasty_how_build_open_source_server

UnRaid
http://www.youtube.com/watch?v=nypnusWsF7A&feature=related

Windows Home Server
http://www.maximumpc.com/article/features/master_your_digital_domain?page=0%2C0

Overview
http://frankleng.me/2010/05/01/zfs-powered-nas-the-ultimate-alternative-to-drobo-droboshare-the-complete-guide/

Ubuntu
http://www.kremalicious.com/2008/06/ubuntu-as-mac-file-server-and-time-machine-volume/

Kindle Review

The question everyone asks when they see you sitting there on the purple sofa in the campus library is; “Is that a kindle?” “Do you like it”. Lets answer both of those questions.

First of all, yes it is in fact a kindle, Amazon’s revolutionary ebook reader. First impression is that it is the holy grail to all your book needs. It conjures dreams of never having to lug a heavy book around ever again! While this is a good point and over all I think it is a fantastic device, here is what I would like to see in the next version.

The screen is great. The letters are crisp and really do compare to reading a newspaper. I would like to feel less worried if the screen broke since replacement screens are more rare then jackalopes. Take a look on ebay at all the kindles with broken screens. They are basically free. I considered grabbing a handful and fixing them up to resell them, but even two hours of google searches returned absolutely 0 compatible e ink screens. While this may change in the near future, it seems that one simple drop could render your kindle totaled beyond repair. On the same note, there is no bezel or glass in front of the screen to protect it incase of an accident. While not a big deal, does give the user the feeling that this is a fragile device, Not something that could be tossed into a backpack.

Ok now that we said something we don’t like, we should say three things that we do like. (That’s what mom always said).
The device is light, holds a tone of books and the ease of turning pages means you don’t have to adjust your grip every time you flip pages (unlike a real book).

One small quirk a lot of people have noticed that Amazon should really change is the 5 way digital joystick. It’s purpose is to scroll through menus, and quickly change chapters and works great most of the time. Everyone I have talked to has accidentally bumped this joystick and lived to regret it. The problem is that when you even slightly move the joystick to the left or right, the kindle will instantly jump to the next or previous chapter. What is suppose to be a feature, will cause you to waste countless hours per year flipping back to your previous possession one page at a time. Believe me, the second time you do it, you will be pulling your hair out. That one fact alone caused me to return the kindle to where I got it.

I am sure that Amazon could easily release a software update to fix this issue, and they should. If you know of a work around or fix please let me know.

Overall I think the idea of the kindle is great, but one fatal flaw means that I will not be recommending it to any of my friends any time soon.