John's Musings

1/6/2011

ATTiny85 WAV Audio player for Halloween

Filed under: Accomplishments,Halloween,Holidays,Technology — John @ 5:40 pm

It has been ages since I last posted. I wont get in to the reasons for it right now. Lately I have been working on a project for next years Halloween fun.

A few years ago I built a “Lightning Box” based upon a color organ circuit, and a halogen flood light. The unit works, but is a bit clunky, and relies upon an external CD player boom box unit I bought at the Dollar store for $5. The whole contraption definitely could use some re-working.

The current plan is to make the unit fully self contained (with the exception of the speakers) and solid state. The C player will be replaced with a audio player circuit I located that is based upon the ATTINY85 processor. I also plan to remove the amplifier board from a set of old computer speakers, combine that board with the audio player, and then feed the amplified audio into the color organ as well as the speakers. This entire collection of hardware should be able to be housed in a standard Carlon 4x4x4 PVC watertight junction box. More on that later…

I have attached a picture of the working prototype Audio board.

3/30/2010

Heave Away

Filed under: Technology — John @ 2:32 am

Ok, I have checked logs, identified the punk responsible, banned their IP, and banned the IPs of around 30K known spammers. Behold the power of a decent blacklist, sed and awk and a pissed off sysadmin at 3 a.m. Tomorrow when I’m more lucid ill do a little analysis on the block list and trim it down by just banning whole netblocks where I get no traffic but spammers and bots from. For now though I need sleep!

(In case you are wondering? This is a final test message I’m not just blogging for the sake of blogging)

1/19/2010

Software fun

Filed under: Technology,Work Stories — John @ 8:12 pm

We had an update to our library system again today. This one was on the test server. Once again the vendor insisted we don’t have a test system. I spent another five minutes of my life arguing with them to convince them that we did indeed have the system that they installed incomplete six months prior. This is at least the fourth time I’ve had to argue this point with them. Yet again today it is supposedly now entered in their inventory system. We will see what happens next time I have a problem.
The upgrade itself went fine, however as expected, it wouldn’t run because the system was never fully setup initially. After a few hours of work the upgrade tech did manage to get it working though. I took the opportunity to ask what she did and replicated it on our production system so it now works correctly too.

6/9/2009

Twitter Cross Posting

Filed under: General,Technology — Tags: , , — John @ 8:55 am

Just so everyone knows, I’m trying out a different setting for the twitter plugin for WordPress. It should now, in theory, only make a single daily post that is a summary of my days twitter postings, rather than be annoying and post a new blog posting EVERY time I say something on twitter.

This should keep you all form being overly bombarded by that stuff. Now that the faire season is back into swing, I will probably have actual posts again.

4/1/2009

The suitcase is packed… mostly…

Filed under: On the Road,Pirate,Renaissance,Technology,Work Stories — Tags: , , , — John @ 9:43 pm

Tonight I think I may have managed to pack 3 personalities into one suitcase. It wasn’t an easy task believe me. “Why are you packing?”, you may ask. You may even ask, “Where are you going?” Well, its that time of year again when I get to travel for work to the location of the yearly conference for our user group for our Library Automation Software vendor. This year I struck gold with the trip though. It just so happens that the conference is nestled all nicely in the middle of the week that falls between Opening and second weekend of the Scarborough Renaissance Faire in Waxahachie, TX. Waxahachie is 30 minutes south of Dallas and the conference is, yep, you guessed it, in Dallas!
So, this year I get to attend both the conference and the faire. Work agreed to fly me down early and back late, (same price just different days than I normally would have) allowing me to attend the faire on the weekends. Work will pay for my hotel while I’m at the conference, and thanks to a VERY generous friend and his wife, I have a place to crash when not at the hotel.
WOOT! So, look out Scarborough here I come!

For those keeping score, the three personalities include:

  1. Work John
  2. John T. Hawser
  3. Relaxing John

Oh, also, while packing I found a pocket in the suitcase that I had apparently missed when unpacking from the Germany trip, and I found the gift I bought for my mother that I was sure I had lost! She was very pleased.

3/30/2009

Bizzare

Filed under: Technology — Tags: , — John @ 10:31 pm

I am still unable to get the web server to email me when anyone comments on the blog. This is very annoying to me, as I can see no reason for it. The ports are open, I can manually send mail from the server to my inbox, but for some strange reason it doesn’t want to work from php.
I have checked,and re-checked the php.ini path to sendmail, and it matches the path on the server…

3/19/2009

Blog comments – ooops

Filed under: Technology — Tags: , , — John @ 6:10 am

This morning I updated my blog client on the iPod only to discover a ton of comments on the blog. Comments I was never notified that they had been posted. If you have commented on my blog since probably mid feb and I have not responded I appologize. It seems the new server has been blocked from sending out any email. I will look into this and get it fixed hopefully today sometime. I thought it had been kinds quiet out there… Sorry folks!

1/30/2009

Nested ReWrite Maps

Today, in helping out a co-worker I came up with a pretty cool ModRewrite rule set. The rule is to be used to migrate users web pages to a new server with new user names. The rewrite will map the old user names to the new user name automatically, allowing existing sets of web pages to easily transition to the new user name without any old links breaking. This was accomplished using two RewriteMaps. The first map is used to convert any case of the old user name to lowercase. This is handled using the int:tolower function.
RewriteMap upper2lower int:tolower

The second RewriteMap is used to perform the actual user lookup. This is accomplished by creating a map file that contains a space separated pair of the form: lowercase_old_user_name new_user_name

oldusernameone Z00000001
oldusernametwo Z00000002
...

The map file is then put into play by using the line:

RewriteMap usermap txt:/etc/apache2/userlist.txt

There were two prospects to the overall rewrite that posed a bit of a challenge to me. The first challenge was to prevent the rewrite from occurring when the URL request contained the new format of user name. This was ultimately accomplished using the RewriteCond statement.

RewriteCond %{THE_REQUEST} !/~[Zz][0-9]{8}

The new user names takes the format of a single, specific, alpha character followed by 8 numeric digits. This made for an easy regular expression to match on, and using the ! character negates the normal “does match” condition of the regular expression into a “does not match” condition.

After that was solved the next problem to solve turned out to be the most difficult of all. I could not find any instructions on the net about how to properly nest two RewriteMap maps inside of each other. My first solution was slightly creative, in that I used two chained ReWrite rules. The first rule assigned the lower cased user name to an apache environment variable, then the second rule used that variable as the input to the second map. While this solution did work, it seemed really convoluted, and I knew there had to be a simpler way to do it. After walking away from the rule for a little bit, I came back to it and hit upon the correct method to nest the two maps.

${usermap:${upper2lower:$1}}

Translated into English this essentially reads as, take the first match and pass it to the upper2lower RewriteMap, and take the results of that RewriteMap and pass it into the usermap RewriteMap. Or more simply, make the user name from the URL lower case, and then lookup the lower case value in the file userlist.txt.

Next up, I just had to iron out the regular expression needed to match and replace the old user name and still retain the remaining parts of the URL, while preventing user names that do not match in our lookup to still trigger a standard 404 error.

^/~([A-Za-z0-9]+)/?(.*)

Pretty straight forward over all. In English it essentially reads:
Match the beginning of the line with /~. Take the next one or more (+) A-Z, a-z, or 0-9 characters and place them into variable $1. Place any characters following an optional / into $2. There is a flaw in this, but it should not be an issue in our implementation. If you can identify it, or better yet fix it, please post your solution in the comments. :-)

One additional touch, that I felt was important to add was the R=301 flag. This causes apache to generate an HTTP 301 permanent redirect header. This should help Google and the like properly index the new URLs. The final rewrite code block follows.

RewriteEngine On
RewriteMap upper2lower int:tolower
RewriteMap usermap txt:/etc/apache2/userlist.txt
RewriteCond %{THE_REQUEST} !/~[Zz][0-9]{8}
RewriteRule ^/~([A-Za-z0-9]+)/?(.*) http://www.example.com/~ ${usermap:${upper2lower:$1}}/$2 [L,R=301]

I’d love to hear comments, or improvements on the rule set.

1/10/2009

Installing VMware Player 2.5.1 in Ubuntu 8 via rpm

Filed under: Technology,Tips / Tricks — Tags: , , , , , — John @ 12:10 pm

I have been running VMware player 2.0.4 since August to launch a windows XP Virtual Machine.  I don’t really use the VM all that often, but when I am doing web development, I need to be able to test in IE, and thats the only way I can do it w/o rebooting to Vista *shudder*.     Towards the end of September it started telling me there was an upgrade available.  I went to the VMware website only to discover they had stopped providing the .tar.gz version of VMware player.  My only options were .bundle or .rpm.    Not really feeling like I wanted to be all that adventurous I ignored the upgrade requests.    Finally after installing the latest kernel patches last night I decided to go ahead and upgrade VMware Player as well since I would have to re-compile the kernel modules again anyway for the new linux kernel.  Having never tried to install and RPM on Ubuntu I was at a loss.

(more…)

12/12/2008

Foxmarks in the Library

Filed under: Accomplishments,Technology,Tips / Tricks,Work Stories — Tags: , , — John @ 10:38 pm

Recently I was asked by one of our librarians to come up with a way to easily add bookmarks to our Internet workstations.   A little background on this situation follows.  Our Internet workstations are all Linux based, with a custom version of FireFox.  This custom version of FireFox has a lot of things disabled to keep the browser in a stable stat.   I have removed the ability to modify the bookmarks on the workstation in any way. The event code for drag and drop, the menu items, you name it, its gone.   This has made it impossible for the librarians to manage the bookmarks on the workstations themselves.   Any bookmark changes have required me to connect to the machines via SSH and manually update the bookmarks.html file.    This method was just not convenient, and did not allow for easy updates by any means.

Earlier this week, thanks to the offloading of some tasks to our new employee, I was able to put some thought into this problem.   I needed a solution that was easy to maintain, simple for the librarians to use, and most of all, easy to implement.   That last criteria ruled out creating something from scratch, which I really didn’t want to do anyway.   Earlier in the week a co-worker had mentioned how he had just setup foxmarks on his machine and how it was going to sync his bookmarks both at home and work.   It hit me then, why not take a look at foxmarks.  I downloaded and installed it in my browser, and it did exactly as it was designed to.    I realized then that it was a purely native chrome based app.   This fact about its design made it a perfect candidate for what I needed.

I set to creating a generic account for the library, a simple task thanks to the easy to use interface.  Once that was done, I installed foxmarks into the browser on one of the Internet stations.  Due to the customizations, this was not as easy as it normally would be. ( I have all installation menus, and handlers disabled.  Ooops…) I finally worked out a way to install the extension, and once I did I set it to use the newly created account, and checked the box to save the sync password.   Foxmarks  performed its initial sync, and I was able to confirm the success by browsing the foxmarks website.   I then closed the browser, clicked yes on the dialog to clear all stored personal information and felt confident I had a good start.   I re launched the browser, hit sync, and foxmarks asked me for the password for the sync account.  What? I was certain I checked to save the password.  I checked it again, and restated the browser, again clearing the personal information.  Sure enough, foxmarks asked for the sync password again.   It then occured to me that clearing the personal information was probably clearing the foxmarks password.   That would be a problem for sure.  Confident that the password hurdle could be overcome, I set about to modifying the chrome files, and was able to hid the configuration menu items, and remove the keystroke sequence for accessing the configuration menu.

foxmarks-overlay.xul
    <menupopup id="menu_ToolsPopup">
        <menu id="foxmarks-menuitem" label="Foxmarks" class="menu-iconic"
            image="chrome://foxmarks/skin/images/foxmarks_bug.png"
            accesskey="&menu.accesskey.foxmarks;"
            insertafter="devToolsSeparator" hidden="true">

After the UI modifications were complete I  again launched the browser, and checked over the browser to make sure nothing was visible that could allow malicious patrons to manipulate the setup.    Everything I could think of was tested and it passed with flying colors.  I then added a bookmark via the website, and triggered the sync process.   After entering the password, foxmarks synced and the new item appeared.  Again, I still had to fix the password problem.   I  closed the browser again, this time un-checking the options to clear the password store.  After re-launching foxmarks synced perfectly, remembering its password.  This then confirmed for me that foxmarks was indeed using the firefox password store.  It makes perfect sense that it would, but of course in this situation, it’s very inconvenient.    I again dove into the code that comprises foxmarks.  I found, in the foxmarks-settings.js file two functions that handled the username and password.    As I suspected they ultimately called “return” with the value for the username and password.   A simple one line change to each of these functions resulted in a hard coded username and password that would stay put after a clearing of the password store.  By placing a return() just inside the function declaration we essentially bypass the default actions of  the functions.

 get username() {
	return "our_foxmarks_user_account";
        return this.getCharPref("username", "");
    },

 get passwordNoPrompt() {
        return "our_foxmarks_account_password";
        if (!this.rememberPassword && this.sessionPassword) {

After saving the modified file, I started up firefox and hit the sync keystroke, presto, no request for password or user name, and the browser synced.  I restarted again, making sure to clear the password cache, and again foxmarks worked perfectly.   At this point I deployed the modified version of foxmarks to all of our workstations, and sat back and watched the fun.   Within a short period of time, every workstation had correctly synced its bookmarks and all was well.

Finally I  sat down with the librarians and explained how to work with foxmarks’ website interface.  By the end of the first evening after foxmarks was installed we had a healthy collection of frequently used websites all bookmarked, and categorized.   The sync process has been working well and we have had no real problems.  (there was one point where I had accidentally left one of the browsers restored to its default state and some things were modified, but I caught it quickly and fixed the problem.

This alone would have been a fantastic solution, but not being one to rest on my laurels, today I used foxmarks ability to create RSS feeds from links in folders, and used that data to allow the library to randomly select a link and twitter it.  Yup, more fun with twitter.

11/21/2008

The twittered catalog

Filed under: Accomplishments,Fun & Games,Technology — John @ 7:37 pm

Tonight, I managed to twitter enable our library catalog.   Now, if you find a book you want to recommend to your friends, just click the “tweet this!” link, and fill in your twitter username and password, and click “tweet”.  As if by magic, the item is tweeted, complete with a link to it in our catalog.    Yup, I’m a geek!   Twitter folks, try it out at:

http://library.waubonsee.edu/catalog/

10/30/2008

So, what’s that wierd box for John?

Filed under: Accomplishments,Halloween,Technology — John @ 10:10 pm

A few months back I posted a picture of a strange looking box. I also asked people to guess what the box did. There were some good guess, but none that hit it 100%.

The box, contained a programmable micro controller board. It also contained a small circuit to interface with the “Try Me” button for an off the shelf Gargoyle I bought at Walgreens.

The box, combined with the gargoyle, some home brew LED spotlights, a hacked Dance Dance Revolution Mat, a plaster pedestal I painted to look like marble, and a nice alcove in a set of our bushes, creates my latest scene for Halloween.

The visitor walks past a set of bushes, when suddenly the alcove lights up, showing a gargoyle, the gargoyle opens his eyes, and begins to speak. When he is finished, he closes his eyes again, and the lights dim.

Just imagine the fun this will cause.

10/29/2008

RF Remote Prop-1 interface

Filed under: Accomplishments,Halloween,Technology — John @ 11:35 pm

Today, I finished creating the Prop-1 to RC controller interface circuit. The schematic, for ExpressSCH is available here.

Interface Schematic

Interface Schematic

It works like a charm, all simple transistor logic, no relays, no nothing. Now, with a simple 3 lines of code in the Prop-1 program I can remotely trigger a prop ~30 feet away.


HIGH Bkwd
PAUSE 300
LOW Bkwd

Completed circuit

Completed circuit

One cool thing of note, I submitted the schematic to the support forum for the Prop-1. The head programmer / developer gave it his ok, and complimented me on part of the design.

More on the remote front

Filed under: General,Halloween,Technology — John @ 12:02 am

Well, I couldn’t stop at just the crow, and the flying ghoul. I found in my bins of stuff a screaming head I got from Target a few years ago. I never did set it out anywhere, but I took a look at it, and found it was indeed quite hackable. I dropped in the receiver board from another of the remote control cars. This time though, I had already used the Forward,and Reverse signals for other props, so had to do a little hacking to the receiver. Fortunately the chip in the car is capable of five separate actions, and the chipset is documented on the net, so I used one of the unused channels and linked it into the head. I then had to build a remote that had buttons for all five signals. I built that, finished the interfacing of the receiver and now have the ability to trigger the head from a remote. Tomorrow morning I’ll build a second transmitter for the Prop-1 to use to transmit.

10/28/2008

Quote the raven… “Wireless”

Filed under: Accomplishments,Halloween,Technology — John @ 12:52 pm

Ok, so really it’s not a raven, it’s a crow…

A few years ago, when I got my first Prop-1 controller form EFX-TEK I set it up to control my popup jumper, and my squawking crow. Initially, the only way I could come up with a way to set off the crow was to insert a relay inline with the “try me” button on its bottom. This worked fine, except that it had the distinct disadvantage of requiring a cable leading from the crow to the controller. Later After I had that all working, I purchased a ghoul that “flew” down a rope and back. It too had a poor activation method, that I wanted to bypass. This time, due to the nature of the prop, I could NOT use any wired connection. This meant wireless. I looked online for some wireless transmitters and receivers, and found them to be cost prohibitive. This annoyed me greatly, until I was browsing the clearance isle at Wal-Mart and found a radio controlled car for $1. At that, an idea was born. I quickly snatched up the car, and dismantled it in the parking lot. I looked over the circuits to find they looked very simple, and easily modifiable. So I drove to radio shack, picked up a few parts and when I got home wired a buzzer up in place of one of the motors, and glued the receiver, and a separate power pack under the gouls cloak, and sure enough, when i pressed a button on the remote, the ghoul would hear the buzzer and start moving. I wasn’t thinking then, as I shoudl have went back and picked up 4 more of the RC cars to allow me to control up to 5 items (forward, reverse, left, right, turbo) from the one controller.
Flash forward to today, I recently went to the dollar store and picked up 5 cheap RC cars, all to my luck, having very tiny receiver boards. This morning, I sat down with the receiver board, and using my limited knowledge of electronics, wired it directly into my crows control circuitry. Now, the crow still functions as it did out of the box, but also sports a fully internal radio receiver. With the press of a button on the remote, or once I’m done, a signal from the micro-controller running the show, the crow will activate. Best part, there are NO wires, I can put the crow anywhere within a 15 ft radius of the transmitter and still have him work just fine. This should, in theory, also allow me to carry a controller with me where I can trigger him, and other props at will. MUAHAHAHAHAHAAHAHAHAHAH

10/27/2008

Down in a hole…

Filed under: Accomplishments,Halloween,Technology — John @ 8:24 pm

It is said, a friend will help you kill someone, but a real friend will help you bury the body.

Karl entrenched

Karl entrenched

Well, qualifies as a real friend. (Not that that was ever in doubt) Ok so there wasn’t actually a body, but I know very few people that would drive out here to help me dig a two foot deep trench, (26 to 28 inches in some places) to help me bury conduit to repair my yard light.

Eighteen years ago while planting a rose bush for my mother, I accidentally cut through the direct burial cable that ran to our yard light. This of course sucked badly, fortunately I was extremely lucky and was not harmed. So, with nothing more than a shoestring budget, I set out to repair the light. I made quite a few mistakes, but the end result had the wiring in conduit, and a little safer. It lasted for quite a few years. The past two years I started having trouble with it tripping the ground fault interrupter a lot, and I decided that I would need to replace it all again. Now that I have a full time job, and have paid off all my credit card debt, I could afford to do it right.

Burying Karl

Burying Karl

Today, at around 11:00, Karl arrived to find me digging the beginnings of the new trench for the conduit. After a few shovel fulls of dirt the larger shovel split its handle out, so we ran to go buy some better shovels for the job. After returning we trenched, by hand, a 30 foot long trench that ranged from 26″ to 28″ inches deep and ran from my house to the yard light. It took us a while, but we did it, and I am glad that the conduit is now the recommended dept. Previously when I did it myself at age 14, I was a lazy bum and the “trench” was no more than 6 inches below ground… I knew that was too shallow, but at 14, I didn’t care. Once the trench was dug, we set about laying the conduit. As we did I discovered, the outdoor outlet post I had purchased had an added surprise. It could be configured, through the use of an insert into a dual purpose, high and low voltage post. I couldn’t resist this opportunity so while I set about cleaning up the underground knock out hole in the lamp post Karl headed off to get more conduit so I could have a separate run of conduit for low voltage items, such as speaker wire, video, or data. Just imagine the possibilities if what I could do if my yard is wired for sound… MUAHAHAHAHAHAHAHAHA be afraid, be very afraid…

By the time Karl returned, I had ran the wire for the lamp post to the outlet post, and while he assembled the low voltage conduit run, I ran the wire from the outlet post back to the house. Once that was done, and all of the connections were made, we tested the circuit, and everything checked out. It’s important to note, that Karl changed the blown light bulb for me, the real reason the light was not working the past month… (Ok, simplest solution, I know….)

Now though, I feel 100% safe in the knowledge that the wiring to the yard, that I rely on heavily for Halloween, and Christmas displays is now safe, and water tight. Thank you Karl, Thank you Ladies at Ace Hardware who must have thought we were nuts… Oh, and thank you neighbors, who stopped to ask if I was working on my Halloween display… MUAHAHAHAH… Ya know… I should have ran a 3rd conduit while we were at it… one for Pneumatics… :-) Oh well, next time… :-) Hey Karl, what are you doing tomorrow? ;-)

9/19/2008

Geeky pirate

Filed under: Accomplishments,Pirate,Technology,Work Stories — John @ 4:30 pm

So what with this bein’ Talk Like A Pirate Day and all I discovered Facebook added “English (pirate)” as an option ya can be choosin’ fer language. Bloody thing don’t translate everythin though… So our library FB app was still landlubber speak. I have now added internationalization support and added pirate as a supported language so now iffn ye be addin’ our app and yer a good pirate you’ll get a piratical version of the app.

9/8/2008

Gravatars

Filed under: Fun & Games,Technology — John @ 9:10 am

So, for quite a while the blog software I use has had avatar support. The thing that confused me about this support was that I could never find a place to upload my avatar.   This weekend in my free time I dismantled the blog software a bit and discovered that these avatars are actually coming from a site called “gravitar.com”.  This fact intrieuged me,  and so off I went.  From thier site:

A gravatar, or globally recognized avatar, is quite simply an avatar image that follows you from weblog to weblog appearing beside your name when you comment on gravatar enabled sites.

Cool concept, so I went ahead and signed up, and uploaded my pictures.   I then discovered I can also addon support for these gravitars to my email client.  It’s kinda cool.   It also has options to set defaults to randomly generated images for each user, currently I have it set for monsters. :-)  

So, if you want your icon on my blog to switch from a silly looking monster to your real picture, go sign up. Do it, you know you want to!

I may see if I can add support for this to the software used by the BDB too, it might be nice to offload some of that file space / bandwith from Tom to a 3rd party company if he is interested.

8/12/2008

All better

Filed under: On the Road,Technology — John @ 4:56 am

We stopped this morning to get a new phone card for Jon. I figured it might be with looking to see if they had chargers. Sure enough they had an iGo display and I picked up a travel kit. I can once again charge the iPod and phone. Happy day!

Crap!

Filed under: On the Road,Technology — John @ 12:23 am

Crap, I accidentially destroyed my batter charger we use for my AA batteries and the iPod/cell phone. I accitentally reversed polarity on the car. I hope I can find one today.

Older Posts »

Powered by WordPress