Faced with a persistent inability to complete homework to a satisfactory degree, my academic advisor and I decided to drop my physics lecture, which had yielded encouraging increases in available time. I’ve also discovered GitPHP, which works as a PHP equivalent to gitweb and works very nicely. I set up a private git repo (accessible through the user git with everyone’s public keys in authorized_keys for my Engineering 100 class. We’ll use it to coordinate parallel development of an E100-compliant processor and our project, which at this point looks like it’s going to be creating robots which interact with one another through sound.

Learning Through Disaster

Gather ’round children, and I’ll tell you a tale of what happened to a Linux box when its sole filesystem was remounted read-only due to disk errors. This coincided with the backup server being taken offline with an errant circuit breaker.

I first became aware of something rotten in the state of Webserver when the sites hosted on it became messes of PHP errors in place of content. I could ssh in, but after entering my password I was greeted with:

-bash: /etc/profile: Input/output error
-bash: /home/steve/.profile: Input/output error

That was a scary greeting.

lighttpd and ssh continued running, but PHP died, commands other than Bash builtins refused to run, and Bash profiles failed to load. I don’t know if some of this is due to damage or the partition being read-only. I’m pretty sure that commands expect /tmp, /var/run, and /var/lock to be writable. I now have those mounted as tmpfs as per the instructions on the Arch wiki here. The warning about lighttpd seems to not apply in my case. cURL seemed to run at first but died when I tried to do anything with it. I had hoped to POST files over, as scp, ftp, and sftp would not run. su still worked. Tunneling worked too, so I was able to still access other machines behind the firewall through the server even though I couldn’t run ssh from the machine itself. I ended up using cat to copy over text files. For binary files I had to get a great deal more creative. The only way I could interact with the server was over ssh; the server was an hour away and even if I did have physical access, mount refused to run (unable to write to /etc/mtab?) and I was afraid that the files I could access might be only buffered in memory and that rebooting into a LiveCD/USB would lose them. My options were limited. I had to use only Bash builtins to pull binary files off the server in text form. I modified a version of this hexdump script to pull files over ssh using | tee file.log to avoid having to copy-paste. tee takes output from stdout and redirects it to stdout and a file given as an argument. Here’s the script:

exec 3<"$1" while read -s -u 3 -d '' -r -n 1 char do printf "%02x" "'$char" done

I lacked a text editor and couldn't write to anything on the root filesystem. I found a tmpfs mount point (I used /lib/init/rw but /dev/shm would also work.) and stored the file by echoing the script line-by-line. In retrospect, I could have used \n and the -e (interpret backslash escapes) option to do it in one line: echo -e "exec 3<\"\$1\"\nwhile read -s -u 3 -d '' -r -n 1 char\ndo\nprintf \"%02x\" \"'\$char\"\ndone" > scriptfile. I ran it with bash scriptfile target_file.

All of this effort, though fun, ended up being unneeded as I had forgotten about my set-and-forget backups. Hooray rdiff-backup!

I ran mysqldump nightly and let rdiff-backup handle any differences. I restored it on the new machine with source mysql_dump.sql on a mysqladmin prompt, but as it contained users and privileges things got messy as the root and debian-sys-maint accounts were partially overwritten. I used mysqladmin to sort out the root password confusion and phpmyadmin to replace the debian-sys-maint password with the one found (in plaintext?!) in /etc/mysql/debian.cnf.

It was a fun puzzle even though it was ill-timed.

The Wolverine Soft 48-hour game competition revealed to me just how difficult physics engines are to make. I spent two days coding and recoding collision resolution only to get different sets of bizarre, game-breaking glitches. At least collision detection was easy because everything was a circle. It was fun and I'd like to do it again. Maybe I should become familiar with a physics library such as Bullet and ask for it to be approved for use in the competition. The guideline is unless it's an approved library, all code and assets (with exceptions for music and sound effects) must be created primarily on-site within the 48-hours. Next time I'll have to plan to do homework in advance. Ignoring homework for a weekend is inadvisable.

I am currently taking 17 credits, and the time management is very difficult, though has not yet proven to be entirely impossible. I'm considering taking classes at LCC this summer to lighten the load during the next school year. I applied to Camp CAEN to be a counselor, but they emailed back saying camp was ending due to the director retiring. The odd part is their website, as of this writing, has no mention of it that I can find. I'll have to see if I can get an internship over the summer.


The ADC makes more sense now. It turns out Professor Atkins has been waiting as we figured out that the weirdness we’ve run into is due to tremendous electromagnetic interference. My math GSI was incredibly kind and willing to spend about an hour helping me fix the statistics. I don’t know why the corruption I ran into was occurring, but we did establish that what GSL calls total sum of squares is actually variance. I’ve added a real TSS function, as well as an output of absolute value of residual. Here’s the best graphs we got previously, rendered with the latest graphing routine:

ADC3 with latest graphing.

ADC5 with latest graphing.

ADC6 with latest graphing.

I didn’t want to disrupt the servo guy’s work much, so I moved Gumstix over to the power supply and set it back up. I didn’t use the breadboard to ground the unused ADCs, and put them all in the same alligator clip instead. I thought I would calibrate two more channels so that we’d have a usable input for the gyro reference voltage. I was very surprised with the results:

Behold ADC2!

Behold ADC7!

This makes so much more sense for many reasons. As I pointed out yesterday, there was a consistent, significant distortion under 1v. This is nowhere to be found in the new line. It’s actually a line, and there is only a minuscule difference in counts for the same voltages between graphs. This is acceptable as imperfections in the voltages we fed it as in this respect our power supply is… abstract. This line also goes up to 1024 at 2.5v, which is what it should actually do as it’s the maximum count at the maximum voltage. What I find amazing is how huge the effect of electromagnetic interference is! We got completely different information when using the breadboard, and even its imperfections were consistent! Professor Atkins revealed that she had let us spend hours on this fruitless calibration of electromagnetic interference so that we would thoroughly learn the importance of electromagnetically clean wiring. Lesson learned!


Nine school days until seniors leave! Both my APs are now what amounts to study hours now that testing is over. It’s nice. Comp Physics created some quality quotes yesterday:

“Light pours forth from your rear and keeps you from falling through your chair.” (In reference to photons, the electromagnetic force boson behind most Newtonian forces.)

“We call it the ‘Ultrapurple.'” (Ultraviolet)

I’m working more on Cavez of Phear. The save file format is now one file, the code has been further cleaned up, (Mostly eliminating copy-paste) and I’m working on adding features to the editor. I had some problems with not closing file pointers initially, which caused very strange behavior until I realized what I had forgotten. If anyone wants look at the github repo, it’s here.


My nose is congested and I was sneezing yesterday. I got up around 2am because I was having trouble sleeping. I think taking Psych is messing with me, as I to some degree harbor irrational fears that I exhibit symptoms of whatever mental disorder we covered last. It’s a really interesting class. If I had more time I’d gladly upgrade to AP. The current Psych assignment is annoying to me, as the podcasts we have to describe a study from seem to discuss a phenomenon in broad terms rather than talking about a specific study. I found an interesting article on conditional love.

I read about Steve Roberts, who seems interesting.

School has been overwhelming. I’m taking two APs: AP Computer Science, which teaches Java, and AP English Literature. AP Computer Science is at least currently pretty easy, as it apparently assumes no coding experience, which I find strange for an AP course. I wonder if it might be improved through an entrance exam and skipping the easier stuff, with the intro being instead in the existing Intro to AP Computer Science? As I haven’t coded Java before, although it is very similar in syntax to C++, it might be good that the class starts out lower-level.

One of the things I find about coding is that I seem to be unable, on my own, to think of reasons to program. My current line of thought is that simple games might be boring: they’re simple and will probably be clones of Pong or Tetris or something. When we actually wrote simple games in Advanced C++ Game Development at CAEN in 2008, (I didn’t go back last summer; they took away the dorm option so we didn’t get to spend evenings on our own machines.) it ended up being fun anyway. It could be fun to rewrite my maze game… The next problem I have in this is that I don’t have much free time with my current class load, so I’d have to sacrifice browsing reddit or something. At least it would be more productive, and perhaps more educational. Qualifying many of my statements seems to make my writing more verbose… (See! I did it again!)

AP English is satisfyingly rigorous, and I have by no means been able to complain that we aren’t doing enough. I’m going to a University of Michigan campus visitation over today and Monday, and I’m going to bring Hamlet and attempt to annotate during downtime; Act I Scenes 1-3 are due Tuesday.

I am told Computational Physics is equivalent to an AP, although it doesn’t seem bad at all in contrast to APE or Precalc. Relativity is really interesting, and the equations aren’t bad; it’s the logic I usually get tripped up on. That’s not to say my algebra never utterly fails. I really like Olstad. His website is very impressive. He is very careful about definitions, and on the first day (or so?) we discussed the differences between schooling, training, and education. After listening to our definitions, Olstad defined schooling as what goes on at school, training as specialized refinement of skills, and education as longer-term outlook for learning. He frequently calls schooling “the game,” (which makes Irfan lose often) and not the point of being there; I find this appealing. He also likes semicolons, calling them yield signs. This has influenced my semicolon use in this post. I’m not sure whether I’m overusing them.

Precalc and AP English give the majority of my homework. Precalc assigns homework consistently, even when the Seniors are gone, as I have learned the hard way. Now that I’m aware of that, hopefully I will manage things better. Pline has an evil genius chair, and I have yet to determine why.


I am amazed by how much it helps to have a pad of paper next to me while reading Great Expectations for Brit Lit.

Categorized as School

Left 4 Dead and Finals

The timing for the snow day was awesome. I was glad for the break. Four-day weekend! ^^

I played Left 4 Dead Versus and got ground into a fine powder. However, I knew it was a game, didn’t ragequit, and asked for advice when we finished and went back to the lobby:

  • Smoker or Hunter: try to attack the last one to go over a one-way ledge, the others probably won’t be able to stage a rescue.
  • You are not so much a team of four as two teams of two. Never let someone go off alone. Stick together.
  • The two in front crouch, the two in back shoot over their heads.
  • Talk. Coordinate. As Infected, wait for someone to stray, or plan an overwhelming Boomer, then Hunters and Smoker ambush.
  • As Tank, it is very bad for you in the open. A survivor running backwards can outrun a Tank, provided the Survivor doesn’t run into anything.
  • As Tank, bash physics objects around. Movable objects have a red outline when you look at them. Hitting a Survivor with one is devastating.
  • “Four in a bad situation is better than two in a good one.”

I’m halfheartedly working on Chemistry studying. I hope Monday will prove to be productive.


I had an eventful day in Chem today. I accidentally dropped the top to the crucible a few times, then when we heated it part of it cracked and flew off. I hope that wasn’t due to my dropping it. After it was heated, I carefully and firmly picked up the top with the tongs, and one arm of the tongs slipped over the other, flipping the top and knocking over the crucible, spilling the barium chloride all over the table. Oops. Justin and I had to get our data elsewhere. 🙁

Categorized as School

WordPress Upgrade, RSI, and the LAN

I upgraded to WordPress 2.7. The admin interface is now really slick. It’s gotten an overhaul and is now a pleasure to use, although it seems like it’s slower.  The main page just took an ENTIRE MINUTE to render! This is unacceptable, and hopefully I can get it sorted out. [EDIT: I enabled WP Super Cache, and it seems better. That’s odd because it didn’t seem to enable last time.] Unfortunately, I forgot, although I understood I was supposed to, disable my plugins before the upgrade. Result: white screen of non-loading death and me panicing. Luckily, Google revealed a very helpful page on how to disable plugins by editing the MySQL database, so now the site is back up.

I was hoping to get into RSI, which is an MIT research program. The first sign was that it wanted people who already knew what they wanted to do for their PHDs. (I seriously almost wrote “PDFs” there.) I checked my PSAT and ACT scores and they didn’t meet the minimum. Even though they said that lower scores could be balanced with strong recommendations and whatnot, I decided not to continue the application process. That saves my teachers writing recommandation letters then. It made me feel strange to request an essay from a teacher.

I’m holding a LAN with 8 people on January 2nd. I say 8 because we would need that many for a full game of Versus Left 4 Dead. Pat might not be able to come due to a New Years thing, but I hope it works out.

EDIT: Hmm… The delay in response time looks like it’s limited to default_socket_timout in php.ini…


My DSL modem (even though I guess it’s actually a bridge, but modem is what is says on the box) crashed. I knew something was wrong when a request to Google timed out. I couldn’t ping the modem, even from the router. I have homework to do and I haven’t started any of it yet. Tomorrow will be busy. 🙁