Archive

Archive for April, 2009

Hacking in San Francisco

April 17th, 2009
Hacking in SF

Hacking in SF

I had the chance to spend a week in San Francisco a month ago (which, by the way, is a beautiful city).

For some reason , everywhere I go, I end up having to repair, re-purpose, or build something. In this case, my Eee PC’s charger broke and I had to fix it.

Flashback

I lost my original charger some time ago and I had to buy a new one. Since it was an urgent need, I resorted to buy a cheap one that I could get fast and order the official one (which was much more expensive) just to make sure I would not have the problem of being without a charger again. Both the cheap and the official one performed similarly and I did not feel the need to use the official one too much (so it could be better preserved).

Back to the present

When I packed up for the trip, I took the cheap charger and left the official one at home. That was a big, big , stupid mistake.

When I got to the Montreal airport and was waiting to board the plane, I decided to write something for this blog and I came to the sad realization that my charger was not working. Fortunately, the Eee PC has a very long battery life and I manage preserve the energy for a few days.

Modified Charger

Modified Charger

In San Francisco, I got a 12 Vdc , 3A (the required rating) charger at a stolen goods surplus store. With my trusty Swiss Army knife (the only tool I had) I changed the power connector and taped it with some electrical tape I got at a Dollar store.

Parallel to that, my good friend Guillaume, who was hosting me at his house, had a broken toy horse. So we decided to repair it so it could be functional and rideable again. The horse also had a broken electronic part that was supposed to emulate the galloping noise.

Using some left over wire from my broken charger and some tape we were able to make the electronic part work again. The mechanical part was also easily repaired by replacing the rotten wooden rods with some new ones.

Horse Circuit

Horse Circuit

In the end, I was glad to be building and tinkering in San Francisco.

I also got the amazing chance of visiting Noise Bridge, a very nice hackerspace with lots of cool toys and great people.

If you are interested, my gallery is filled with more than 1000 pictures from San Francisco.

Toy horse back in action.

Toy horse back in action.

Project

To WordPress from Blogger

April 17th, 2009

I recently moved my blog from Blogger to an independently hosted WordPress installation and I needed to dynamically redirect the visitors going into the old pages so that the could see the new ones.

There are many tutorials on how to do this on the net but they usually involve fairly complex procedures and require modifying the Blogger HTML code and installing some plug-ins in WordPress. But, what I really wanted was a simple way of redirecting each blog post into its new version.

My solution:

I decided to write a little java script code that will do the job since it is a fairly simple task. All that is required to translate one of my permalinks is to strip the “.blogspot” part, and the “.html” part (see the example below).

Example:

Old address: http://carlitoscontraptions.blogspot.com/2009/03/smoking-cyclops.html

New address: http://carlitoscontraptions.com/2009/03/smoking-cyclops/

The script:

<script type=”text/javascript”>

function redirect()
{
oldURL = document.URL;
oldURL = oldURL.replace(/.blogspot/, “”);
oldURL = oldURL.replace(/.html/, “/”);
window.location.href=oldURL;
}

window.setTimeout(’redirect()’,5000);
</script>

This script consist of two parts: (1) a function that strips the unneeded parts from the current page URL, and (2) a time delay that executes this code after 5 s.

The only thing left to do is to insert this code into an HTML/Java script box in the Blogger layout editor and that’s it. No messy template edition required.

Project, Software

Look! It’s moving!

April 14th, 2009

Dear readers,

I have been experimenting with web servers, web design, web applications and many other things that begin with “web”. The result? The blog is moving to a new address.

Its new home is http://carlitoscontraptions.com/. I’ll try to make the transition as seamless as I can and I hope not to loose too many readers in the process.

I came to this decision since I started playing with WordPress and I really enjoyed it. Not that I don’t like Blogger, it is just that I feel I need more control over the site. I also got a pretty good deal in web hosting so getting a domain and infinite server space and bandwidth was really cheap.

Let’s hope everything goes for the best.

General