Toggling your IP in Windows

I’ve been pretty busy with my new job so I haven’t been able to spend much time maintaining the site.  Nowadays my desk job involves very little coding, so its really hard to find topics to blog about.  Keep checking back though because I’ll be sure to post something more specific about my work very soon!

For the past few weeks, a small part of my job was to test our software’s connectivity to various theatrical lighting desks.  A part of the setup required for these tests involves switching your computer’s current IP address from automatic DHCP assigned to static.  Normally that wouldn’t be a problem, but over the course of a few weeks my machine slowly turned into the office’s defacto test machine; so I decided to come up with a better solution.

I present to you the IP Switcher.  Its a little batch file that toggles your IP between DHCP auto-assigned to a static IP.

set interface="Local Area Connection"
set ip=10.10.10.33
set subnet=255.255.255.0

For /F "tokens=3 delims=:. " %%a in ('netsh interface ip show config
    ^| find /i "DHCP enabled"') DO (
        If /i "%%a" == "Yes" (
            netsh interface ip set address name=%interface%
                static %ip% %subnet%
        ) Else (
            netsh interface ip set address name=%interface% dhcp
        )
)

A few notes about usage:

  • Save the file into a *.bat file, double-click to run
  • Set the interface variable to be the name of your network interface, as it appears from your device settings
  • Set the ip variable to the static IP your machine needs to be set to
  • Set the subnet variable to the subnet your machine needs to be set to
  • I had to move some lines around to get things to look right on this blog, so you might have to move some lines back in the bat file to get it to work properl (1st line under the If statement in particular)

And that’s it!  Running it will toggle your windows machine between a statically assigned IP address and an automatically assigned one!

Posted in Tech, Win32 | Tagged , , , , , , , | Leave a comment

Majestouch Tactile Click “Otaku” NKRO

After some convincing by Derek, I decided to bite the bullet and invest in a Filco Majestouch Tactile Click “Otaku” NKRO (Blue Switches).  Filco is a Japanese hardware manufacturer that produces  “high end” mechanical switch keyboards, like the one shown above.  After taxes and shipping the total cost of the keyboard came out to be ~$200 from www.elitekeyboards.com.

Now, some of you may be thinking to yourselves “goddamn that’s an expensive keyboard!”, and you’d be right!  A quick look on the Logitech website shows that even the most expensive keyboard+mouse combo, the Logitech Cordless Desktop MX 5500 Revolution, goes for $179.

So what’s so awesome about the Filco Majestouch, and does it justify the hefty price tag?

Its All About The Switches

Let’s step back for a second and take a look at the “everyday” keyboard.  If you pop off the keys and look under the hood, you’ll find something that looks like this:

The typical keyboard is a membrane keyboard.  The keys on your keyboard have little pegs underneath them so that when they are pressed, the peg slots into the membrane, completes a circuit, and sends a special key-code to your computer.  Neat, simple, and easy to manufacture.

There are a lot of problems with membrane keyboards, and they basically boil down to low reliability and lack of tactile feedback.  Membrane keyboards don’t last very long because the rubber membranes have a tendency to wear out.  Also, depending on the rubber membrane used in the keyboard, everything about the keyboard will change: the travel distance (how far you have to press the key down to get a “keypress”), the stiffness of the keys, the elasticity of the keys, etc.

Mechanical switches on the other hand are a lot more durable and complex; hence the high cost.  Underneath each key is a spring mechanism which detects key presses, like so:

Now, because each key has a mechanical switch underneath it, the keyboards themselves will be a lot more expensive.  However, there are many advantages to the mechanical switch system.  You get a lot more tactile feedback on each keypress and you also get an audible click (good for touch typing).

The selection of mechanical switches (brown, blue, black, etc.) can also change the overall “feel” of the keyboard as well.  Different styles of switches will change the audibility of the clicks and also the depth at which keystrokes will be generated.   I got my Filco keyboard with Blue switches, and they are supposedly great for typing.

For a more complete and un-butchered description of the differences, you read this well-written comparison here: http://www.ergocanada.com/ergo/keyboards/mechanical_vs_membrane_keyswitches.html

The Keyboard

The Filco Majestouch keyboard is a pretty standard 108-key keyboard.  It has blank keycaps for extra 1337-ness and n-key rollover for all you gamers.

Likes:

  • Good Layout: For the most part, the Filco is really well laid out; typing on it is pretty comfortable and touch-typing is a breeze.  I have some pretty big/wide hands, and I’ve had no problems with it so far.
  • Audible clicks: There is a very loud and distinctive ‘click’, and I love it.  As a touch typist you want to hear that satisfying ‘clickity click’ to know that you hit that key
  • You look like a total badass: while you hammer away at your blank-key Filco with a “click click click” soundtrack in the background.  If anyone asks, just tell them you’re hacking into the Pentagon.
  • Types like a dream:  And most importantly, it generally feels awesome to type on it.  I’ve been using the Flico keyboard for ~3 weeks now, and it certainly lives up to my initial expectationexpectations.  My fingers used to get sore when I used my old keyboard (a Logitech MX5500), but I’ve had no problems with the Filco.  If you like the keys on Lenovo Thinkpads, then you’ll absolutely love the Filco.

Dislikes (more like minor gripes):

  • No media controls: Coming from a Logitech keyboard with every media key imaginable, not being able to adjust the volume or control iTunes is a sorely missed feature
  • USB connection: The keyboard connects over USB, and if you want to use the n-key rollover then you have to connect over PS/2.  My mobo actually doesn’t have a PS/2 connector, so that feature was wasted on me.  Still, coming from a bluetooth keyboard, I miss the freedom of going sans-wires
  • Not great, but not terrible for gaming: The Filco isn’t really a gaming keyboard per se, but you can definitely use it for that purpose.  If you do get this keyboard for gaming, do what Derek did and go with Black switches (I’m rolling with Blues, but ideally you should go with Black).  If you’re playing games where you’re clicking lots of different keys (I’m thinking RTS, MMORPGs), then the Filco is great.  Me?  I’m more of an action gamer, so the Filco isn’t all that wonderful for twitch-based games (FPS, platformers).  For those games you want short keys with short travel distances (I’m thinking chiclet style keyboards).

Final Thoughts

So, is the Filco worth it?  I sure think it is.  You don’t get a lot of the multimedia keys that come with a lot of the higher-end keyboards, but that’s OK.  The ergonomics behind the keyboard and its ease-of-use justifies the Filco Majestouch as a good investment for the health of your hands.

Posted in Tech | Tagged , | Leave a comment

Lucid Lynx (10.04) and GRUB on Windows 7

In a previous post (Recovering GRUB After Installing Windows 7) I described a situation where GRUB would not be able to detect your Windows 7 boot partition after you installed Ubuntu.  The fix was to point the root directory to a small (or secret?) partition outside of the main Windows 7 NTFS partition.

I recently demolished my Ubuntu partition and installed the latest Ubuntu 10.04 (Lucid Lynx), and it looks like the previous GRUB issues have been resolved.  The installation went smoothly and the updated GRUB was able to install and boot into my Windows 7 partition with no problem.

It’s awesome when Ubunut just “works” :)

Posted in Linux, Tech | Tagged , , , , | 1 Comment

Project Win Post-Mortem

As some of you may know, Derek and I have been working on a few projects (Project Win) over the past months. We started these projects in February and worked through until May where we decided to go our separate ways for a little bit.

Although none of our projects made it to deployment, we still learned some invaluable lessons:

Mental Stamina

When you work on a project by yourself you have the luxury of working at your own pace.  Each stage of planning, design, development and testing is done in one way or another, but in your own way and at your own pace.

When you work in a group though, you literally need to synchronize your work habits with your partner’s.  You need to convince yourself that Derek is right, and you really need to do more design on Component A when you would much rather be coding up Component B.  This will be easy to do on some days, and difficult to do on others.  Its hard, its stressful, and it strains you, but a lot of the times you have to sacrifice your own desires for the sake of the project.

The Little Things Matter

Its the little things that count, and a bunch of little things stacked up together can have a major impact on performance.  I’ll be the first to admit that I didn’t work at 100% capacity.   Meeting downtown every day for a full day’s worth of work right after exam season wasn’t as fun as I thought it’d be.  I thought that I superman and that I’d be able to work through it, but I was totally wiped out from the previous emester.  I was okay to work for the first few days, but after that both my performance and my patience dropped.  Derek knew this and I knew this.  Be aware of your own body, and know when to stop.

On another note, there are little things that you can do to help improve morale.  Early-morning Reddit sessions and afternoon Timbit runs really helped us clear our heads and get us through the day.  Find out what works for you and your team and use it.

Healthy Discussion (or Arguments) are Vital

This is more relevant to the design stage of the project.  Healthy discussion between group members can lead to great ideas and eliminate bad ones.  Bad discussions can be poisonous, so avoid them at all costs.

How did we avoid poisonous discussions?  Well, Derek and I agreed that whatever happens, neither one of us would be so mad that we couldn’t make it out to lunch (PBS? lol).  Thankfully, we never really got mad in any of our discussions.   The key is that we never made personal attacks on the other person(calling someone a noob-face doesn’t count).  If you can keep the discussions positive and on-topic, then I think you’re good to go.

One of the dangers of having lots of discussions is that they can go on for a very long time.  This happened to us, and that’s why we didn’t get much progress in the time that we had.  At the end of the day, you need someone to make an ultimate and final decision.  Discussion is good, but indecisiveness will just leave you stranded.

Written Documentation

I cannot emphasis this point enough: Write Stuff Down.

I know everyone says that documentation is key to success, documentation is necessary for team coherency, etc. etc.

Let me make it simple.  When you work on your own project, you can keep all of the project details in your head, you don’t need to write anything down, etc.  That’s great, good for you, that’s how I roll too.

But when you work in a group, your partner won’t have your perfect memory.  Write down your design decisions on something that everyone can see so that each team member has at least some sense of what’s going on in the project.  This is even more important if your team spends a lot of time discussing the design.  We’ve had morning meetings where we’d try to start work on features that were “locked in” from the previous day’s discussions, but we’d have no idea what to do on because nobody remembers the final decisions.

Keep a wiki, keep a blog, whatever; just make it public and keep it up-to-date.  It helps to maintain the overall project vision,and it comes in handy when you start dividing the tasks.

Don’t Be Afraid to Ditch It

Cognitive dissonance is a big problem with programmer; you believe in your code so much that you literally trick your mind into thinking that everything is going according to plan.  Everything makes sense to you in your head, so naturally the code must behave perfectly when it runs.  This is a big problem, and you need to force yourself away from the project and give it a serious review (or hell, ask someone else to do it for you).

If you find that the code is getting messy, cluttered or is just downright wrong; don’t be afraid to throw it away and start over.  You won’t be wasting it; I mean, its just data after all.  The rewrite will go much faster and the code will be much better as a result.  (see Plan to Throw One Away).

Speed Is Your Friend

Don’t get too attached or caught up to any particular idea.  Pick it up, evaluate it, and run with it.  If it works out, great, if not, find something better.  Work quickly, and work smartly.

I’d like to say that we did this a lot, but it wasn’t until we failed for a few weeks that we really got into the habit of working fast.

Posted in Tech | Tagged , , | 2 Comments

Geekery In Print

A great deal of my “geekness” has been influenced by various magazines and zines that I read as a kid.  In the days before Reddit and Digg, I would rely on these magazines to teach me more about the latest developments in the tech world.  In fact, even with sites like Reddit and Digg, I still turn to my favorite rags for the latest in technology and hacking.

My must-reads:

  • Wired: It really depends on the month though.  I’d say that 50% of the articles are genuinely good, and the other 50% is filled with trash or advertisements
  • Popular Science: Its not what you’d call “high brow” but the magazine highlights a lot of cool gizmos and gadgets that are being used out in the real world.  They have some pretty ridiculous speculations about “future tech” that makes for a good chuckle as well.
  • 2600, the Hacker’s Quarterly:  I would highly recommend this zine if you can find it in your local Chapters/Indigo.  This magazine literally changed my worldview about the hacker community and about the work that I do.  The articles are very dense and technical, but its defiantly worth a read.

A newer zine has recently come out called the Hacker Monthly ($9 print copy, free pdf).  I’ve glossed over the TOC and the articles definitely sound interesting.    They’re more of a 2600-lite in the sense that their articles aren’t very technical or “traditional hacking”.  Good reading nonetheless.  A word of warning though; frequent redditors will recognize  the articles as duplicates from progreddit!

Posted in Tech | Tagged , , , , | Leave a comment