Archive for the ‘useful’ Category

Google Docs as a Free and Easy CMS

Monday, May 18th, 2009

CMS

A CMS is a content management system. Basically, it holds all the revisions, deals with collaborators, and puts stuff into templates so it’s nice on the eye. Good CMS’s will allow you to edit WYSIWYG too. It is, however, a pain for me to go to the work of setting up Joomla, Pligg, or WordPress for something quick and simple. And I hate to pay for software. What do you do when nothing fits just right? Invent your own system.

Google Documents

When you think of the things a CMS can do, Google Docs immediately comes to mind. Revisions, collaboration, WYSIWYG editing, and even basic publishing. The “publishing” feature only give a black and white page with not much wiggle room to turn it into a real site, although. Then I had my idea. What if PHP was to grab the published document’s URL and extricate the content, and then echo it back as if the content was hard-coded in? Some thinking, a soda, and ten lines of PHP, it was done. The script retrieves the page and discards anything before the content and everything after it. This however, removes some of the styles Google Docs puts in. If you edit the raw html of the document as Google kindly allows, you can add tags that you can refer to in your own linked stylesheet. The Google Doc must be published to work.The script is as follows, and if free to use with the comments in place:

< ?php
$docID = "dfgpnkdc_37fn6v5tfh";
//published google docID (part of publish url)
$temp = file_get_contents("http://docs.google.com/View?docID=" . $docID);
//get the page contents of the "preview" url for the doc
$temp2 = explode('<div id="doc-contents">', $temp);
//separate into the upper non-text half and lower half
$temp3 = $temp2[1];
//discard upper half
$temp4 = explode(’<br clear=”all”/>’, $temp3);
//separate into all-text and non-text, again  

//don't remove this line:
echo "<!-- Google Docs CMS PHP script copyright 2009 theajblog.com, begin script generated text -->";

echo iconv ( "utf-8" , "ISO-8859-1//TRANSLIT" , $temp4[0] );
/* echo text converted utf-8 to iso-8859-1 - important. Apostrophes turn into A’s with tildes because of a character mismatch otherwise. Also, without //TRANSLIT, certain characters like a special closing quote will cause it to cut off the document there. */
?>

ICMP Tunneling - ICMPTX

Sunday, March 22nd, 2009
An Ubuntu console, with an ICMPTX client running.

An Ubuntu console, with an ICMPTX client running.

ICMPTX?

ICMPTX is a mostly linux software project to permit tunneling IP packets across ICMP pings. Why do this? To bypass restrictions. Ever go to a seemingly free hotspot, only to open your browser and discover the hotspot owner’s site, rather than your target? You can get around this if, like almost all hotspots, pings are permitted. Your computer, with the help of the software, will redirect all your internet traffic through the ping port in the form of a ping, and the server at the other end will return everything you requested. The biggest problem in my case with this was my OS and a server. One of my nicer, shared hosting plans had some decent control, but of course, I couldn’t superuser it. That doesn’t work. So, I had to go to a home-hosted server concept. I would simply install Ubuntu or something onto an old box, get ICMPTX going, maybe some router tweaks, but it would be simple. Wrong! Ubuntu on its own took me well over an hour to get going. Then, I still haven’t been able to properly configure the tunnel. I think there may be some issues further down the pipe, along with my own already. So, there I was, spending hours on hours trying to get a really cool thing working when I probably should’ve been studying for a test. Oh well! Trial and error.

Theft Deterring Pizza Box Laptop Case

Tuesday, March 10th, 2009
My pizza box laptop case with vacuum formed shell.

My pizza box laptop case with vacuum formed shell.

Not My Idea

This has been commercially done and covered. I merely made my own DIY version. Please don’t sue me. Glad that’s over.

Why?

Very few thieves are willing to break into a car to steal a pizza. But who knows whether there’s actually pizza in that box? Who knows it isn’t a laptop, say? The answer is, “if done right, there is no way to tell.” I often take trips to NYC with my laptop, and as with any big city, I have to hide it. Beneath a seat, coat, blanket, anything. I will no longer have said problem! This very quick design would look a lot nicer with some paint, but I’m worried about dissolving the awesome urethane foam I used.

Authentic Pizza Box

To increase realism, and the chances it will be accepted as nothing more than pizza, I went to a local pizza shop. I asked the guy for two slices of pizza, and a separate box for a project, to which he happily obliged.

Vaccum Formed Shell

To make my laptop fit perfectly, I turned to vacuum forming. Unwilling to spend mucho money on a professional former, I settled for a “kitchen floor” version, as can be found in MAKE. It’s called “kitchen floor” as you basically are stuck there, using the oven as a heat source. My first attempt catastrophically failed, sticking to the oven rack. Messy. The second try, I successfully got it out in time, then right on top of my laptop. Vacuum on. Wait 10 seconds. Done. As a precaution I had put greased foil on top of any stickers just to be safe. I trimmed this mold down until it fit the box in the way I wanted. I also drilled out a hole so I can discretely put a power jack in and charge without giving anything away. This got affixed to the box where I wanted it with lots and lots of Great Stuff (expanding sticky urethane spray foam).

Cord Portholes

To permit simple and secretive cords to leave the box, I cut a few three-sided rectangles out of the bottom (basically leaving them hinged). I extended the already existent ventilation slots for the same purpose.

Padding

I looked around for the quickest soft thing I had. It was a strange pile fuzzy fabric, an unattractive greenish. Almost half a bottle of contact cement later, bottom of box lid and fuzz were one. This pads the laptop in case the strap is not used or fails. It also probably makes it hotter (not good).

Strap

Reuse is the first of the 3 R’s. I had a laptop bag that after years of service was covered in holes. It had a nice laptop strap. Best of all, it was free. A seam ripper made short work of the binding stitches, and the strap was free. I dug two little holes in the foam where I wanted to mount the strap and squirted some Gorilla Glue in. Put the strap in, duct tape temporarily in place, and more foam. I don’t know whether it was the glue or the foam which holds it in, but it’s stuck in there for good.

Conclusion

On the inside, it looks like junk. It’s screaming for black paint. Regardless, it actually ended up costing me nothing, having all the materials on hand. There is room in back of the laptop for any other small gadgets and a modern power brick. Finally, the real goal has been achieved, to build a case which no one will want to steal while containing something they would.

A vaccum forming disaster, now considered "art" and ominously hanging from my bedroom ceiling.

A vaccum forming disaster, now considered "art" and hanging from my bedroom ceiling.

Review - Creative Xmod

Monday, March 2nd, 2009
Creative Xmod - poor lighting, extremely grainy. Sorry...

Creative Xmod - poor lighting, extremely grainy. Sorry...

The Xmod

This is yet another great example of a device with no proof if it works other than to try it. The Xmod is a USB sound card from Creative, which has two sound “restoration” features: the Crystallizer and CMSS-3D. The Crystallizer, in the marketing department’s words, “intelligently restores the highs and lows for rich, crystal clear music playback.” I didn’t believe it. Nor did I believe that it “features smart technology that turns your plain stereo sound into rich virtual surround sound by centering vocals and moving ambient sounds all around you.” Whatever. The real reason I bought it was because the internal microphone jack had a weird hum I couldn’t get rid of. Also, I could get it for $25, $55 dollars off, direct.

Microphone Sound

It worked great with my lavaliere and unidirectional microphone. No hum! Already worth it. The Crystallizer and 3D effects thankfully do not apply here.

Headphone Sound

The Xmod comes with a dandy pair of earbuds which I immediately started using over my iPod ones. They’re better and don’t hurt my ears, fit-wise. They do look quite a bit like the iPod ones, also. With the Xmod, however, they make a killer combination. While Crystallizer and 3D can make some things sound really distorted, they can be disabled independently with two switches. Most music will sound great with it, though, and you’ll want to know how to increase the intensity. By tapping the whole upper plastic section twice, with the LEDs, you can control the Crystallizer intensity with the built-in volume knob. Tap again to change the 3D setting. It will then either time out or you can tap again to get out of the adjustment mode.

Other Things Worth Noting

The Xmod requires USB power to run, so, independent from a USB port it’s useless. Get around this with either a mini-USB AC adapter, or something similar to a MintyBoost. It works as a USB sound card, but, should you wish to use an iPod or other non-USB-sound-card-compliant device, connect the headphone jack on your device to the line-in on the Xmod. Like I already said, you still need power though. The volume knob works via USB, so it won’t work without a computer. That said, this device is a wonderful addition to anybody’s toolbox!

Using a Hacked Best Buy Gift Card as a Free Amplifier!

Thursday, February 26th, 2009
My iPod goes to the amplifier, then is transmitted through a radio.

My iPod goes to the amplifier, then is transmitted through a radio.

What’s Happening?

So, the way it’s working in the photograph is that music is going from my iPod, to the hacked amplifier, to the handsfree jack, which then transmits on FRS/GMRS frequencies. It can be heard with another two-way radio. Now, you may be thinking, “Why’d you just re-invent the FM transmitter!” Well, this doesn’t transmit on any traditional FM/AM radio frequencies. By utilizing two-way radios for communication, other people with radios you’re already using can hear! Or, play really weird music and annoy them! I prefer the latter.

How is This Done?

The particular gift card was the one that Best Buy sells, which features an iPod speaker on the back. The card comes off easily, with some clips. Take a bunch of screws out, and you expose the circuit board. All I did was desolder the speaker leads and solder on a mini-audio jack, like the ones found on cellphones and handsfree systems. I soldered the positive speaker lead to the microphone section, as visible from pinouts.ru, and then soldered the negative lead to ground. Holding down “talk” with everything on blares music on the selected channel. A tad quiet and finicky, but better than without amplification. Awesome!

The Partly and Prototypically Built Stabilizer

Sunday, February 22nd, 2009
"Project SteaDIY"

"Project SteaDIY"

Yay!

I actually had some time and got around to building the Merlin clone. I think I might nickname the project “Project SteaDIY”. My first and foremost problem was the pipe I had ordered. I had had no idea what wall size to order, so I just went with 1/8″. Big mistake. That stuff is like, the type goons carry around to whack people with. Not the kind I can bend in a wooden form. So, I downgraded. Going out to the local hardware store, for about $2 I purchased somthing like 8 feet of thin wall steel conduit. It’s steel, so it’s heavier. But it was bendable. I used a 4.5 inch radius plywood form to bend the semicircle, with a lever type mechanism as described here. It worked, with no kinks either! I crimped something like the last 2 inches in a vice, making it flat.

Attaching Everything

Although I certainly did goof quite a bit when it came to the drilling measurements, resulting in off holes, it all worked out in the end. At Wal-Mart I found some Stanley Line Levels which, after beating into submission, I was able to bolt on. I had the balance bolts ready for a while, also making it easy to bolt. As for the handle, I don’t have anything special that works yet. I tried a kind of gimbal that I had made, more a piece of art than anything else, which broke under the strain of the rig. So, sacrificing stability for simplicity, I merely chopped up something that would work for a handle and bolted it on too. I really need to get a better handle-rig mount that will allow more handle jiggles and less footage jiggles.

The Price?

Amazingly, I think it was under $50 for everything. The most expensive was the plate, which was special order 6061 alloy 1/8″ aluminum, at about $10 including shipping or something like that. This is, of course, not including a camera.

The Synopsis?

I’m not done yet. On my to-do list: better weight balancing, and a better handle mount. The rest works fine, all good.

Importance of a Journal

Wednesday, February 18th, 2009
My journal is a Moleskine with squared paper.

My journal is a Moleskine with squared paper.

Why is a Journal Important?

A journal can be important for many reasons. Unlike the stereotypical idea of a diary, you need not write about your life in a journal. For the most part, I actually don’t. I do tend to carry it around everywhere, often along with a key chain, wallet with no money, a cellphone, and a mechanical pencil. Most, if not all, famous thinkers kept a journal of some kind. Even if you don’t plan to be the next “famous thinker” you can still write ideas and things you want to do down.

What Do You Write?

I’ve already published one scan of my Steadicam plans. That was from my journal. As a matter of fact, I have two journals; one that fits in my pocket and one that’s a lot bigger. I mostly write in the pocket one, as I rarely carry around the big one.

Any Recommendations?

I have found, and I think many will agree, Moleskines to be just about the greatest notebooks on Earth. One of the reasons I’m attracted to Moleskines is because I love nice paper. It tends to be cheap, and feels so good to write on. Moleskines come in many different varieties, and can be used accordingly for what kind of writing you do. Write stories? Use lined paper. Technical sketches? Squared. Doodles or drawing? Blank. Music? Staff.

Where Does One Buy a Moleskine?

I believe you can purchase online, but I have found it often more convenient to buy from my local Borders who has begun carrying them. Another important thing is to carry a pencil or pen, because borrowing one from a stranger, for example, doesn’t always work.

Sudden Breakthrough!

Monday, February 16th, 2009

Not Exactly Pertinent...

Not Exactly Pertinent...

Image Copyright Protection!
I was thinking about this, and I don’t know why, but it struck me. It occurred to me what the best method of preserving an images quality while protecting against hotlinking and copyright abuse with minimal effort. So, the next morning, I wrote up all the code necessary to make it work. Now, I’m not actually going to describe the entire process, but instead leave it up to everyone to reverse engineer and figure it out! There should be enough there for anyone with basic HTML and CSS knowledge. The example is available here. Enjoy!

Average Time to Brute Force a Combination Lock

Friday, February 6th, 2009
One of the most popular combination locks available, this little lock has 125,000 possible combinations.

One of the most popular combination locks available, this little lock has 125,000 possible combinations.

Algebra!
Another day, another thought. Of randomness. I wrote it down, like all the others. This time on a folder. The formula for determining, in quantities of time, how long it would take to open a lock by trying codes. Any lock works, even key locks if you understand key codes I guess.

 

The Formula!

l^(d-c)*t/2/60/60/24=h

c is the number of compromised digits

l is the number of combinations of one digit

d is the number of digits

t is the amount of time to test one combination

h is the number of days to break the lock, continuous, averaged.

For Example…

Let’s take a common school locker-integrated lock. It has up to 50 on the wheel, 3 digits, and takes about 5 seconds to attempt a combination. Let’s suppose we know none of the digits, making c = 0:

50^(3-0)*5/2/60/60/24=h

50^3*5/2/60/60/24=h

125000*5/2/60/60/24=h

625000/2/60/60/24=h

312500/60/60/24=h

5208.33/60/24=h

86.055/24=h

3.585625=h

Although I made a slightly more sophisticated formula for determining how many days it would take to break it without looking suspicious, this is good enough for me. That means that, on average, you would sit at the lock trying combinations for three and a half days with (no sleep) before it opens.

Compromised Digits?

Here’s where the fun starts. Let’s suppose you actually know 1 of the digits and which position it is, making c = 1.

50^(3-1)*5/2/60/60/24=h

50^2*5/2/60/60/24=h

2500*5/2/60/60/24=h

10000/2/60/60/24=h

5000/60/60/24=h

83.33/60/24=h

1.388/24=h

0.057833=h

A tremendous difference. What this shows is that the security of a lock is extraordinarily diminished with compromised sections of the code. What would’ve taken 3 days to break, now one digit is out, will take a bit under an hour and a half. Don’t tell your combination to others, even part of it!