Bluetooth Device Lookup

Post by: on November 22nd, 2007 | Filed Under Bluetooth, Linux, Perl, Programming, Security

Happy Thanksgiving! I'm spending the break catching back up on the state of Bluetooth security because, hey, I love the subject. Everyone has a phone with Bluetooth, just about, and many overlook it as a security hole because they feel there's nothing insidious that can be done with just replacing wires with some radio broadcasts. I'll give a quick rundown on how to get Bluetooth working under Linux, then the software I use, and finally give a tool I wrote watching the Dallas Game to speed up identification of Bluetooth devices.
Read More »

Comments (No responses yet)

SVN – It’s the Law

Post by: on July 15th, 2007 | Filed Under Annoyances, Programming, Stupidity

For the past few weeks I've been working for Harkins, specifically for NearbyGamers, to build a Facebook application. Work was going nicely, and this afternoon I finally got close enough to being done to set a release date for myself: Friday afternoon. Now, if that went as planned, would I be writing this post? I left my SSH session open, grabbed some dinner, and sat down to play Chez Geek with a friend. I wandered back about an hour later to find my SSH session hung. This happens often, not sure why, so I thought nothing of it, closed the terminal and logged back in. But when I got to the file I'd been working on, it appeared to hang again. Maybe the file was getting too big to load in a quick manner? 10 seconds later and vi still showed no data. Then, to my horror, I realized it was because the file was empty. A quick ls -al showed the following:

<18:00:53 nearbygamers>$ ls -al
...
-rw-r--r-- 1 snarky pg4xxxx 9548 Jul 15 17:42 facebook.php
-rwxr-xr-x 1 snarky pg4xxxx 23146 Jul 15 17:42 facebookapi_php5_restlib.php
-rw-rw-r-- 1 snarky pg4xxxx 0 Jul 15 17:42 functions.php
drwxrwxr-x 3 snarky pg4xxxx 4096 Jul 15 17:42 images
-rw-rw-r-- 1 snarky pg4xxxx 2154 Jul 15 17:42 index.php
...

The file was zeroed. And it happened, according to the timestamp, just 15 minutes before I got back to my computer. How or why that happened, I have no clue, and this shouldn't really matter except I had no version control. That's right, I once again decided that this project would be over before any catastrophes could happen. Man was I wrong. To say I freaked out would be an understatement, and finally I filed a ticket with my host, Dreamhost, pleading with them for any backups they might have. Literally within a minute I got a response which pointed to a page on their wiki about a wonderful (and secretive) backup system of theirs. After a little digging and a call to Harkins, I was able to pull a file out of thin air. During the time that I had waited before submitting the ticket I set up the SVN repo for this project, it took a whopping 2 minutes to create, move my files, check out in place, and do an initial import of all the other files. All that grief to save 2 minutes, I'll never make that mistake again.

Now, at this point I have to give major kudos to Dreamhost. Not only do they have the system in place to save my butt when its my fault and they don't owe me any help, but their crack support team was able to get back to me minutes after submitting my ticket, and I'm writing this just about half an hour after I submitted that ticket. I have my file back (minus maybe an hour or two) and my peace of mind to sleep tonight.

I've been a Dreamhost fan for a long time, they've got great servers for the sites I build, very decent uptime, and Shell access that I oh so love. This may just be the last in a series of events that made me love their service, but it is by far the most important, and telling about their service and their customer-oriented mindset in general.

Thanks Dreamhost, you've got a customer as long as you're in service!

Comments (No responses yet)

Software Design Oopsies

Post by: on June 12th, 2007 | Filed Under Perl, Programming, Stupidity

So, real quick as I just got the idea to actually post this little story, I was writing a little script. This script dealt with ids I'm using for a project. Basically I knew there was a lot to begin with, but wanted a flat file, not a database because I figured "Hey, I'm dealing with a lot, why pay the overhead every id of doing a bunch of queries?" Among other things, this script couldn't list an id more than once. So I (stupidly) chose an array to store the ids and sort through them. At first, no issues, I could process a few ids in a second and get all my work done on them. Well, after I hit around 15,000 I had issues. It was now taking about 5 seconds an id. It only got worse, and worse, and worse. Around 19,000 ids I finally CTRL-C's the script, to retool it. I changed it over to throwing all the ids into a database, accepting a tad more overhead per id, but overall this becomes linear time. I stupidly forgot my Big-O notation classes, and that sorting through a large list of numbers takes longer than a very short one. *sigh*.

Bottom line: For large amounts of data accept the higher overhead per unit when it'll lessen the overall overhead. Now my script runs happily all day without decreasing my speed. I only post so you geeks out there can laugh at me, and I'll remember this handy little lesson later on.

(I feel the need, as I do freelance programming, to point out I'm normally quite smart regarding how I design my code, and I'm posting this because I can't believe I did that!)

Comments (No responses yet)

Positive Feedback!

Post by: on April 17th, 2007 | Filed Under Programming, Three Planets Software

Well, today's been Hell on me, though of course no where near how horrible its been on a lot of my friends. But I got back to my email around 1am, and found this tidbit regarding the web design job I left two weeks ago:

Hey [Snarky],

Just wanted to tell you that I've had a guy who is tutoring me in php remark on the quality of your code. Good Job! Thanks again.

Sincerely,
[Boss]

So, yea... sadly, that's the high point of my day. But it makes me feel good because I'm really hard on myself and the quality of my code, and to have an outside source say its looking good brightens the few hours left until I pass out of my day.

Comments (No responses yet)

First Contract… DONE!

Post by: on April 9th, 2007 | Filed Under Programming, Three Planets Software

As of last Thursday I'm officially done with the first contract as Three Planets Software. I've actually been done with the contract for a few weeks now, but they kept me on retainer for a few reasons. I had to end it due to my school load picking up, but the whole process was a great learning experience. Best of all, it paid for my car repairs, and I made contacts with two people who would hire me again in the future. In the end I handled it professionally, and everyone was happy with the code I put out. Now that's a happy ending.

And now back to my never-ceasing work for the next month.

Comments (No responses yet)

Thieves Tavern

Post by: on March 25th, 2007 | Filed Under Games, Programming

I've been really busy as of late. That web contract I spoke of has kept me on as a web admin guy for the indefinite future and I'm looking to put together a team of php/mysql programmers to help me! Also, code for my CS classes has stepped up in complexity, so... ow. But in my spare time I'm still coding for fun.... just to clear my mind. The project I've been doing for the past week or week and a half is one Ammon and I are calling Thieves Tavern. What is it? Read on to find out!
Read More »

Comments (No responses yet)

Spring Break!

Post by: on March 19th, 2007 | Filed Under Programming, Three Planets Software

It's been a wee bit (a good week and a half) since I last posted, due to a variety of factors. The most telling, of course, was that this past week was spring break and I was in the sunny Bahamas. It was a great time, lots of alcohol comsumed (I'm 21 now), tons of pretty girls... it rocked. In actuality I spent Spring break at school, programming, yea what a glamorous life. I picked up a contract for a website about three weeks ago and this past week was the culmination of that, with my site being pushed live for a Beta test last night. Once it gets a bit cleaner (currently I don't support IE) I'll post a link to it so I can get some good testers. So, to summarize, Snarky's still alive (barely), Three Planets Software has its first contract under its belt, and there's a great new social network coming!

Comments (No responses yet)

Songs I Code To

Post by: on February 26th, 2007 | Filed Under Interests, Programming

Got this idea last weekend from a friend of mine, I forget the situation (and am too lazy to grep my GAIM logs at the moment, hate mornings) but what one listens to whilst programming came up. Apparently there's many misconceptions out there about, something like "Only listens to death metal", or some such. THis is simply not the case, and I thought I'd give you a top 10 albums and songs I code to, and why.

  1. Dream Dance (Many Volumes) - Various Artists - I like dance (I'm man enough to admit it) because its monotonous beat keeps me on track and thinking. I'll normally start coding with dance/trance music.
  2. A Gothic Industrial Tribute to the Smashing Pumpkins - Various Artists - I love this album because Industrial is even more rhythmic than regular dance, and this has some great driving riffs.
  3. Push The Button - The Chemical Brothers - Again, slightly harder than normal dance, I'll use this when I start getting stuck on a bug or problem.
  4. Dangerous Man - Trace Adkins - What can I say, I wish I were a country boy, and I use this album in my more melancholy coding stages. Cleaning up code, or if I just can't get motivated.
  5. Mud on the Tires - Brad Paisley - Again, country boy, all that. This is a great melancholy album for me as well, and I'll normally queue it up with Trace Adkins.
  6. Any album by Richard Cheese - A lounge singer who covers pop artists? Yea, its just that soothing. I'll use this when I want to calm down after coding for an extended period of time with harder trance or metal.
  7. Any album by Stephen Lynch - He's amazingly funny, and this is for those projects that kinda write themselves, and you can sing along.
  8. Hackers Soundtrack - Hackers, the Movie - My favorite movie currently, not for realism, just to laugh at. Oh, and the asoundtrack is amazing. Some great dance, trance, and rock on here,m really great mix to program to.
  9. Summer of Darkness - Demon Hunter - While "metal" this is not the hard side of it, this band can be very lyrical, and I enjoy breaking them out when I have short projects that I just need to jump into and finish.
  10. Burial - Extol - Far and away one of my favorite bands in any genre, this is also among my heaviest metal. They get broken out on the rare occasions that I can't think, and I'm pissed off. Heavy driving bass is a lot like techno in that it keeps my mind on track, and screaming vocals help me to actually use my anger constructively, instead of blowing up.
  11. Any of the songs I'm going to list under "Songs that I love for their geekiness" - Because they're just stinkin cool.

In terms of "Songs I love for their geekiness" these are songs that.... well... I really feel could be listed as my theme song, for whatever reason.

  1. Its All About The Pentiums - Weird Al
  2. White and Nerdy - Weird Al
  3. Code Monkey - Jonathan Coulton
  4. A Laptop Like You - Jonathan Coulton
  5. Eternal Flame (God Wrote is LISP) - Julia Ecklar
  6. Geek Love - Fan 3
  7. Slash Dot - Fat Boy Slim
  8. D&D - Stephen Lynch
  9. Super Mario Rap - Benefit (warning, explicit lyrics)
  10. Ok, seriously anything by Weird Al, and most of Jonathan Coulton could be on this list.
Comments (One response so far)

Quick Users

Post by: on February 17th, 2007 | Filed Under Perl, Productivity, Programming, Three Planets Software

I don't think I've said it publically yet, so a little heads up, I've gotten my first contract as "Three Planets Software". Rather (I hope) easy site in PHP/MySQL and some other goodness, but you'll hear more about that later when I put out a call for Beta testers. So I coded up all the login and registration pages two days ago, and now am working on some other fun stuff. Some fun stuff that required more than one user to test. Ideally, more than 10. I did *not* want to sit in phpmyadmin creating 20 dummy users that would only be used in testing, so I turned to perl.
Read More »

Comments (No responses yet)

Snowy Inspired Poetry

Post by: on February 17th, 2007 | Filed Under Poetry, Programming

Its really pretty out today as we already had a bunch (a bunch for here, not a real state) of snow on the ground and its snowing again today. Not the harsh/nasty wintery mix we had a few days ago, but really nice fat sowflakes, lazily falling around the evergreens outside my window. Well between that and the coding binge I've been on (forgot how much fun Friday nights can be with just me, a coupla computers and a goal for X lines of code) has put me into a nice melancholy mood, which is making me wax poetic (publically) for the first time in a long time.

Some Haiku
Softly swirling bits
Bytes gusting between servers
Winter on the wire

And a (poorly written) Sonnet
Awake, sweet muse, and guide my finger's stroke,
That I may write the code I hear inside.
Instantiating offerings of Coke,
Mayhaps some Bawls, and Fritos warm and dried.

Ifs, fors, while loops, maybe gotos I'll type,
Controlling structure planned with care afore,
The loop invariant we'll have to load,
And make sure defaults always get a store.

"Aha", I cry, "I've found that drasted bug!"
That haunted Beta testers for so long,
Commit the changes, hope that I get Dugg,
A lifelong goal I'd rather not prolong.

Release the code under the GPL
And cry: "It gives the power to rebel!"
*Raises fist*

(I put that last line in in favor of a rip on Dell or Intel, man that was hard).

Comments (No responses yet)