Archive for the ‘Tech Tips’ Category

Use Opera Mobile to Add Proxy Supported Web Browsing to a Kindle Fire without Having to Jailbreak

Thursday, January 26th, 2012

I love my Kindle Fire, with one big exception: It does not support proxy servers. I use my fire in environments all the time (i.e. public schools) that require proxy support. While I haven’t solved the proxy problem system-wide, I have figured out a way to use Opera Mobile to add a proxy-supporting browser!

Even though the steps below WILL NOT add proxy support to apps for the Kindle Fire, it IS possible to have a full-featured browser (Opera Mobile) on your Kindle Fire that supports proxies. Since Amazon won’t let you install Opera through it’s app store, here’s what you can do to install it and get it ready for proxies:

  1. Go to Kindle settings by tapping the cog in the upper right hand corner of the screen, then tapped More > Device > and turned “on” the Allow Installation of Applications from Unknown Sources
  2. Install the ES File Explorer from the Amazon App Store. (We’ll use this to install the Opera APK. It’s free and a good app to have around anyway.)
  3. Go to the Opera Mobile download page on a computer (not the Fire).
  4. In the Choose an application dropdown box, choose Opera Mobile 11.5 (Android 1.6+) then click the View Download Link button.
  5. Click the International link and save the APK file to your hard disk.
  6. Connect your Fire to your computer via USB.
  7. Copy the Opera APK file to your Fire
  8. Disconnect the Fire from USB
  9. Open ES Explorer on the Fire
  10. Navigate to where you copied the APK file to and open it (which will initiate an install, where you click “OK” to everything)
  11. Go back to the home screen and go to Apps. Launch Opera.
  12. In the Opera address bar, type opera:config
  13. In the HTTP server box, type the address of your proxy, a colon, and the proxy port (i.e. youProxyAddress:8080 ) [Note: You can type in proxies for HTTPS and FTP if you need proxy support for those as well ]
  14. Check the Use HTTP box (and HTTPS and FTP boxes if you need those)
  15. Click Save

Now when you go to a page in Opera, you will be prompted to enter your Username and Password (for authenticated proxies). As I said earlier, this does not solve the problem with apps that need proxy support, but at least you can use a browser with proxies using this method.

Easy Way to Copy a File Path in Windows Vista and Windows 7

Friday, January 20th, 2012

I work with file paths a lot, since I email co-workers locations to stuff on our file servers. And even though I try to avoid it, sometimes it’s absolutely necessary to hard-code a file path into a program or script. In either of these cases, the quicker I can get the path to a file, the better. In the past, I had always used a registry hack or script to add the ability to copy a path from a context menu. Hacking the registry is not a big deal, but wouldn’t it be nice if any Windows computer could have this functionality out of the box?

Little did I know that Windows 7 and Windows Vista have the built-in capability to copy a file path by simply holding shift and right-clicking on the file for which you want the path! In the resulting context menu, the magical phrase Copy Path becomes visible! Clicking it puts the absolute path to the file on the clipboard. It works on both local and remote files.

WordPress Plugin to Generate Post Slugs

Monday, November 28th, 2011

If you have migrated your WordPress blog from another blogging platform but the post slugs weren’t generated, you can my Generate Post Slugs Plugin to have the slugs generated from the post title.

Why I Wrote This Plugin

I wrote this plugin for use on this very blog because when I ported my custom blog software entries to WordPress, I didn’t bother to generate slugs with the import script I cobbled together. A few weeks ago I made my URLs SEO-friendly and realized that all those posts I imported years ago were missing slugs.

License

By downloading, you acknowledge that this plugin is released under the GPLv2 License AS IS with no implicit or explicit warranty of fitness for any purpose. While I have tested the plugin with WordPress 3.2.1 and have used it to fix the slugs for posts on this very site, it is STRONGLY SUGGESTED that you make a backup of your WordPress installation prior to using it.

Getting the Plugin

If you accept the license terms outlined above, click here to download the Generate Slugs Plugin.

Installing the Plugin

Installation is just like any other WordPress plugin. On the plugin install page in your WordPress Dashboard, upload the zip file. Then activate the plugin under the Installed Plugins menu and follow the instructions provided there to use the plugin to generate your slugs.

I hope this helps someone.

For $200, the Kindle Fire should scare Apple (and delight most everyone else who doesn’t have an iPad)

Tuesday, November 15th, 2011

The Fire has one thing that an iPad has never had: A comfortable price. I’m not the first person to posit this, but I think Amazon’s new Kindle Fire is going to be the first non-fruit tablet to succeed in the marketplace due the the “bang for the buck” factor. After playing with my Fire for a few hours now, I must say that I find the experience very enjoyable. Here’s a rundown of what I think up to this point:

The Good

  1. Amazon’s custom Android interface makes perfect sense – Unlike some reviews I read earlier today, I like Fire’s interface. It makes sense to me. It doesn’t look like any other Android interfaces I’ve seen, but I find the stripped down version the Fire employees to be more agreeable.  Furthermore, I think it will appeal to non-technical people like my Mom who will like the fact that everything she wants to do will fit neatly into a few categories that she can easily find every time she visits the home screen. I think the lack of sub-categories inside each of the built-in categories (Books, Apps, etc) may be a problem once I load the Fire up with more content, but with the universal search, I don’t think that will be much of a problem.
  2. Fire is fast enough, especially for the price – I think the Fire is fast enough. So far, I’ve looked at books, magazines, and webpages, and each task was perfectly acceptable. The book reader app works just like the Cloud Reader and I think it will do nicely for reading in the dark. (Although, I think my Kindle Keyboard is still a better reader, provided you have enough light.) Magazines look better on the iPad’s larger screen, but the pages turned and rendered smoothly. When I did a flick-to-scroll anywhere on the device, content zooms by smoothly and give you a smooth inertia-driven feel.
  3. The Amazon App Store interface is FANTASTIC – I LOVE the way the Amazon App Store for Android  is setup. In one screen, it gives you the top 100 Paid, Free, and Rated apps in a very digestible 3-column layout. The layout has the iTunes Store beat hands down. (For the record, I have always despised the iTunes store. It’s too cluttered and requires too many clicks to see more than 3 of anything.)
  4. The built it speakers are loud and clear – While pursuing the selection of freely streamable Prime content, I realized how clear the Fire’s speakers are. Whereas most portable devices I’ve ever played with have sounded either muffled or weak, the Fire sounds fairly rich. The bass isn’t exactly thumping, but the overall sound quality from the speakers is great.
  5. The mail app is solid – Amazon did a good job crafting the mail app. I’m not at all worried about the lack of a native Gmail client now. The app has a clean interface and is really smooth (judging from my experience with it so far).
The Bad
  1. I want physical buttons for volume control and Home – The lack of a couple buttons is a disappointment for me. I don’t want to have to click 4 times to turn down the volume. And, what’s the one thing you do on a tablet more than anything else? Go to the home screen to launch stuff. The Kindle Fire 2 needs to have hardware buttons for these functions.
  2. The built in apps are lackluster – I did say that the mail app was solid, but what I mean here is that the included apps don’t really do anything that makes me go “Wow!” The Facebook app isn’t even an app: It’s a shortcut that opens the mobile version of Facebook in the Silk Browser. Ugh!
  3. The Silk Browser is way overhyped – I can’t really tell that Amazon’s much-touted hybrid browser has done anything to speed up my mobile browsing experience. The Fire supports Mobile Flash, but all the Flash videos I looked at were a mess. (Downloaded mp4s look great, though!) All the pages I visited loaded just like they do on any other mobile device, which means that either Silk doesn’t do squat or that the Fire’s hardware can’t handle browsing on its own. Either way, as of right now, Silk has left me unimpressed.
The Fire Compared to the iPad

The Fire and the iPad are kind of a like a boat and a car: A car and a boat are both get you from one place to another, but they are for totally different uses. The Fire isn’t a content creation device but its cloud-accessible content is second to none. The iPad is undoubtedly more powerful overall, but to some users (like myself) it’s debatable if the iPad is $300 more powerful. The Fire is much more portable and easier to deal with one-handed, while the iPad’s big screen wins for reading full-color material. In short: Which device is better depends on what you want out of your tablet.

My Bottom Line

I really like what I’ve seen out my Fire so far. For $200, you get a very smart, well-connected media player, with media meaning text, audio, video, and apps. If you like Amazon (which I do), you’ll love owning a Fire. Is it perfect? No. Is it mass-market friendly? You bet. If you’ve been putting off getting a tablet because of price, go ahead and get a Fire. There’s more than $200 worth of goodness in this simple, unassuming package.

How to Install Your Own Custom Apps on a Kindle Fire

Tuesday, November 15th, 2011

Well, folks, I have my Kindle Fire in hand. So far, I think it is more than worth its $200 price tag. I’ll be posting more about it later tonight after I’ve had more time to take it for a spin.

One of the first things I wanted to know was could I load my upcoming web app on it to test (which I have discovered is called “side loading”). I tried connecting the Fire via USB to my computer and copying the APK that way, but that doesn’t work.

Not to be deterred, I did the following:

  1. I went into the Kindle settings by tapping the cog in the upper right hand corner of the screen, then tapped More > Device > and turned “on” the Allow Installation of Applications from Unknown Sources”
  2. I uploaded the APK to an accessible folder on my website.
  3. Then, I went to that folder in the Silk Browser.
  4. Once the download was complete, I went to the download manager by clicking on the orange Kindle label in the top left hand corner of the screen.
  5. I then tapped on the name of the APK and it asked me if I wanted to install the app.
  6. I told it yes, at which point the app was installed (and is working quite nicely).

That was easy and now I can test my own app on my own device. I’m a happy early adopter!

An easy fix for iTunes 10.5 (x64) that won’t install on Windows 7 64 bit

Saturday, October 15th, 2011

I just downloaded iTunes 10.5 and tried to install it on my Windows 7 64 bit machine. What I got was an error message that said:

There is a problem with this WIndows Installer package. A program required for this install to complete could not be run. Contact your support personnel or package vendor.

The fix that allowed 10.5 to install correctly was very simple. Simply go to Control Panel > Uninstall a Program. Right-click on “Apple Software Update” and choose “Repair.” After that, iTunes 10.5 (x64) should install with no problems at all. Apparently the Apple Updater can get messed up and cause the new version not to install. Imagine that.

If only all Windows errors were so easy to fix!

A PHP Script to automatically clean files affected by the the eval(gzinflate(base64_decode…) hack

Sunday, July 10th, 2011

In late April, my server got hacked. Most of my php files had code that looked like this placed at the top:

eval(gzinflate(base64_decode('DZZFssRYokOX... long string of gzipped-base64-encoded php code);

I’m not sure how the bad guys got in, but I changed all my passwords and updated all the software on the server. Then, like any obsessive programmer, I set forth making a script to clean up the mess programatically. My solution was a two-step process. I used GNU find command to find all my php scripts with the code “eval(gzinflate” in them. I chose to search by this code because I can’t think of too many legitimate reasons to do this, and it matched all the infections I found manually. The full command I used for this was:

find /full/path/to/public_html -name "*.php" -exec grep -li "eval(gzinflate" {} \;

This command finds all php files then uses grep to look inside each file for “eval(gzinflate”.

I copied the results of this command to a text file called fullInfected.txt .

After I had a list of infected files, I wrote a php script that’ll go through each file on the list, do a search, and remove all lines with the infected code in it. I saved the script in the same directory as my fullInfected.txt file. You can get that file (with a few sample supporting files) here: CleanEvalBase64_decodeHack script.

There are two variables that can be set at the top of the file: One for the name of the file with the list of infected files in it ($listOfFiles) and another for the text to search for ($findWhat). I uploaded the script to the server and ran it via SSH:

php clean.php

When the script runs, it will log a list of which files were cleaned.

This script is released as-is, with no implied warranty whatsoever under the Creative Commons Attribution-ShareAlike 3.0 Unported License. Make a backup of your server before using this and test this very thoroughly on a small sample of infected files.

I’m sure there’s more efficient ways to do with with shell commands and/or regex, but I didn’t know how to do it that way. Good luck getting cleaned up!

Browsers, browsers, browsers!

Tuesday, June 28th, 2011

Nerds of the world: rejoice! The browser wars are ablaze for the first time in over a decade. Microsoft, Mozilla, Google, Apple, and Opera are duking it out, feature-for-feature and there’s no clear winner. For the record, I don’t want anyone to win because competition makes software better since developers have to work hard to keep and maintain their market share. While the four major players volley for our affections, Netizens all over the world win! As I mentioned in a recent post, most of what we do with computers is moving to the net. Therefore, the availability of quality browsers is a big deal for techies and Luddites alike.

The First Browser Wars

The First Browser Wars ended around 1997 with the release of Internet Explorer 5. At the time, there was IE, Netscape, and (to a much lesser extent) Opera. When Microsoft decided to unload its war chest in 1995 with the intent of destroying Netscape, it was a matter of time before the boys of Redmond stomped Netscape into the ground. In the span of 2 and a half years, the battle was over.

In 1997, I was just learning how to make web pages. I couldn’t have been happier that Internet Explorer was the winner since that meant I didn’t have to work so hard trying to make my pages look the same on both browsers.  I still tested my sites in Netscape Communicator, but IE was the only browser I really worried about. Life as a budding web designer was good.

My happiness was ill-founded, though, because without competition, Microsoft stopped updating Internet Explorer after the release of IE 6 in September 2001. It would be seven and a half years before Balmer and company decided to release a new version. During IE 6, there were security threats uncovered at least every couple months. While it was nice having only one platform to worry about, it was frustrating and scary to have to worry about security every time you visited a page. Opera never went away during this time, but it never gained much traction in the U.S. at the end of the First Browser Wars

The Second Browser Wars and Beyond

A spunky upstart named Mozilla arose from the ashes of Netscape after Netscape’s Gecko source code was released in 2000. In 2004, Firefox 1.0 was officially released. I honestly never thought Firefox would gain as much traction as it did, but it turns out, FF 1.0 was the scout that signaled the beginning of the Second Browser Wars.

Fast forward 7 more years since FF 1.0 was released and Google has entered the market with Chrome, which shares common roots with Apple’s Safari (via the Webkit engine). It’s apparent that all are scrambling for more market share if you consider that the browser version numbers are increasing at an alarming rate. While some of the version incrementing is for marketing purposes (because we all know higher version numbers mean a better product…), the browsers really are getting better from all the vendors.  Here’s my quick breakdown of the strengths of each browser:

  • Internet Explorer 9 – Microsoft has gone out of its way to make IE safer to use for everyday surfing. It automatically checks for phishing attacks, warns users if it detects so much as a mouse fart on a website, and integrates with MS Security Essentials. While it’ll take awhile to shed its reputation as the insecure kid on the block, Microsoft is trying hard to prove otherwise.
  • Firefox 5 – Firefox is my favorite because of its vast library of plugins, especially plugins that make life easy for web developers. Mozilla keeps making Firefox faster and has taken an aggressive stance toward security since version 3.5.
  • Chrome 12 – Google’s brainchild is the fastest kid on the block. It’s super clean interface and seamless updating architecture has appealed to millions since its debut in late 2008. Google is showing its serious about being the one and only browser folks turn to for their Internet needs.
  • Opera 11 – The underdog of the roundup, the Scandinavian wonder invented tabbed browsing in 1996 and continues to set the bar for standards compliance, and it manages to be incredibly fast as well. The only browser found on the Wii, Opera can also be found on PCs, Macs, iPod/iPad, and mobile phones. Opera is the most hardware-agnostic of the bunch.
  • Safari  5 – Admittedly, Safari is my least favorite, however, it is by far the best mobile browser in existence, as it renders pages on the iPod Touch and iPad perfectly. Safari is what all mobile browsers should strive to be.

I hope the Second Browser Wars rage on for a long time and we, the consumers of Internet goodness, continue to reap the benefits of the battle. Unlike the First Browser Wars, the current struggle is being fought on technical merit and security. Neither Microsoft nor anyone else can crush the competition strictly with wads of money. No matter who you choose as your browser, I wish everyone happy surfing!

Re-Register Apache and Mysql as Services After Moving Zend Server Directory to a New Computer

Sunday, April 24th, 2011

I recently got a new Toshiba A665-S5183X Core i7 laptop and I really love it.  The only thing about getting a new computer (especially if you’re a geek) is transferring files and settings from the old machine to the new one. I used Windows 7′s Easy Transfer to move over all the usual documents (pictures, papers, etc), and I also transferred about 15 GB of programs that are not registry dependent. One of the folders I transferred was my Zend Server CE installation. Zend Server includes the Apache Web Server as well as Mysql Server. I wanted the two installed as a service, but I didn’t want to have to reinstall, since I had customized many settings in several places in the installation and didn’t want to start over. So how hard is it to reinstall the two servers as a service? As it turns out, not hard at all.

First, open an Administrative Windows Command Prompt. The rest is as easy as follows.

Install Apache As a Service

cd into your Apache2 bin directory and type

httpd -k install -n “Zend-Apache2″ -f “C:\program files (x86)\C:\Program Files (x86)\Zend\Apache2\conf\httpd.conf"

This command will install Apache 2 as a service named Zend-Apache2 in  your services.msc service control utility (where you can start/stop your Apache service). Additionally, it will tell the service to use the specified httpd.conf file (which can be anywhere you want). The service installer will even be nice enough to warn you of errors or warnings in your specified conf file.

Install Mysql As a Service

cd to your Mysql bin directory and type:

“mysqld” –install MySQL-Zend –defaults-file=”C:\Program Files (x86)\Zend\MySQL51\my.cnf”

As above, whatever the word you type after the install directive will be the name of your service in services.msc. The defaults file represents the path to your Mysql cnf file.

Happy web developing with Zend framework running as services on your new box!

Should You Buy a Mac or a PC?

Wednesday, March 16th, 2011

In the last couple years, more and more folks have been asking me whether a Mac or a PC is the better computer. In case you don’t know, a Mac is a type of computer made by Apple, the same company that makes iPods and iPhones. A PC, on the other hand, refers to a computer that runs Microsoft Windows. When you’re standing there holding your credit card deciding which to buy, which is best?

Apple would have you believe that Macs are far superior to the old stalwart PC. You may have seen the Apple ads on TV that portray the Mac as a coolguy 30-something with all the answers. He has conversations with PC, who is a middle-aged nerd in an ill-fitting business suit that is always having problems.  According to Apple, the purchase of a new Mac will change your life forever.

Well, Apple’s claim is true in some ways, but it’s mostly marketing hype. The truth is that for 95% of computer users, all tasks they want to do can be done on either a Mac or a PC. The difference lies in how the total cost of each of the machines is spread out. Macs are great for creating audio, video, and DVDs right out of the box. It’s easy to make your own custom recordings or photo albums. Also, you don’t have to buy antivirus software for Macs. The catch to all this is that Macs cost about twice as much (or more) than a PC with the same amount of processing power, memory, and storage space.

PC owners won’t pay as much up front, but they will have to spend $400-$500 to buy software that offers features equivalent to what a Mac can do out of the box. (Some users won’t spend a dime on extra software because they will never need these capabilities.)  Then, there’s the $30-$50 per year you’ll have to spend on a good antivirus program, since Windows PCs are vulnerable to many types of viruses and other malware. PCs outshine Macs in the area of choice. For any given thing you might want to do on a PC (such as create scrapbooks), there may be 4-5 good programs to choose from for getting it done. On the other hand, a Mac might only have 1-2 programs for any given purpose. Macs and PCs can’t run the same software, so any software you want to use has to be written for one or the other.

Which Do I Think is Best?

I have used PCs for 15 years and Macs for 8 years. My personal take on it is as follows:

Buy a PC: If you favor a lot of choices, buy a PC. As for software, there still is no where near the amount of software available for Macs as PCs. Why? Apple makes up 10% of the computer market, so there aren’t as many people buying software for Macs. Therefore, more developers (the people who create computer programs) write code for PCs. I would feel guilty if I didn’t state outright that I think Windows 7 is great. It’s the best thing Microsoft has cranked out in a long time. As an example, AreoSnap and the way Libraries work allow me to get more done faster. It’s all the small touches like this that makes Windows 7 great.

On the hardware side, Apple doesn’t offer a lot of variation in hardware configuration or style. When’s the last time you saw a red or blue Macbook? Some people love the clean, white lines of a Mac. Others abhor them. Unless you buy a PC, you’re out of luck.

Buy a Mac: If you are willing to pay a little more and don’t want to worry about so many choices, a Mac is the way to go. Most of the software that’s available for the Mac is pretty high quality, as long as it always has the features you need.  Macs come with iLife, which comes with some of the best consumer-grade audio and video creation tools out there.  More and more developers are being drawn to write software for Macs, because there market share is growing very quickly (due in part to the iPod, iPad, and iPhone). Also, Macs are easier to maintain. Macs do get slower over time like PCs, however, it  takes much longer. As of now, you really don’t have to worry about viruses on a Mac, though I suspect that will change as more and more people buy Macs. The more people using a system, the more appealing it is for virus programmers to get to work.

With the Web, Who Cares?

I can’t really say a Mac or a PC is better. It all depends on what you value. Each is great in its own way. Mac vs. PC has been, is, and will be one of the biggest geek holy wars.

Most PC users I know right now are really into sharing things on sites like Facebook, Flickr, or Twitter. All this communal goodness takes place in a web browser. The sites don’t care what browser you use, and both Macs and PCs have several great browsers available. So, for most people, the choice of Mac or PC is moot. Both cost about the same in the long run, and both do a good job getting things done, howbeit in different ways. Some things are easier on a Mac and some things are easier on a PC, but you really can’t go wrong either way.

In the last couple years, more and more folks have been asking me whether a Mac or a PC is the better computer. In case you don’t know, a Mac is a type of computer made by Apple, the same company that makes iPods and iPhones. A PC, on the other hand, refers to a computer that runs Microsoft Windows. When you’re standing there holding your credit card deciding which to buy, which is best?

Apple would have you believe that Macs are far superior to the old stalwart PC. You may have seen the Apple ads on TV that portray the Mac as a coolguy 30-something with all the answers. He has conversations with PC, who is a middle-aged nerd in an ill-fitting business suit that is always having problems.  According to Apple, the purchase of a new Mac will change your life forever.

Well, Apple’s claim is true in some ways, but it’s mostly marketing hype. The truth is that for 95% of computer users, all tasks they want to do can be done on either a Mac or a PC. The difference lies in how the total cost of each of the machines is spread out. Macs are great for creating audio, video, and DVDs right out of the box. It’s easy to make your own custom recordings or photo albums. Also, you don’t have to buy antivirus software for Macs. The catch to all this is that Macs cost about twice as much (or more) than a PC with the same amount of processing power, memory, and storage space.

PC owners won’t pay as much up front, but they will have to spend $400-$500 to buy software that offers features equivalent to what a Mac can do out of the box. (Some users won’t spend a dime on extra software because they will never need these capabilities.)  Then, there’s the $30-$50 per year you’ll have to spend on a good antivirus program, since Windows PCs are vulnerable to many types of viruses and other malware. PCs outshine Macs in the area of choice. For any given thing you might want to do on a PC (such as create scrapbooks), there may be 4-5 good programs to choose from for getting it done. On the other hand, a Mac might only have 1-2 programs for any given purpose. Macs and PCs can’t run the same software, so any software you want to use has to be written for one or the other.

Which Do I Think is Best?

I have used PCs for 15 years and Macs for 8 years. My personal take on it is as follows:


Buy a PC: If you favor a lot of choices, buy a PC. As for software, there still is no where near the amount of software available for Macs as PCs. Why? Apple makes up 10% of the computer market, so there aren’t as many people buying software for Macs. Therefore, more developers (the people who create computer programs) write code for PCs. I would feel guilty if I didn’t state outright that I think Windows 7 is great. It’s the best thing Microsoft has cranked out in a long time. As an example, AreoSnap and the way Libraries work allow me to get more done faster. It’s all the small touches like this that makes Windows 7 great.

On the hardware side, Apple doesn’t offer a lot of variation in hardware configuration or style. When’s the last time you saw a red or blue Macbook? Some people love the clean, white lines of a Mac. Others abhor them. Unless you buy a PC, you’re out of luck.


Buy a Mac: If you are willing to pay a little more and don’t want to worry about so many choices, a Mac is the way to go. Most of the software that’s available for the Mac is pretty high quality, as long as it always has the features you need.  Macs come with iLife, which comes with some of the best consumer-grade audio and video creation tools out there.  More and more developers are being drawn to write software for Macs, because there market share is growing very quickly (due in part to the iPod, iPad, and iPhone). Also, Macs are easier to maintain. Macs do get slower over time like PCs, however, it  takes much longer. As of now, you really don’t have to worry about viruses on a Mac, though I suspect that will change as more and more people buy Macs. The more people using a system, the more appealing it is for virus programmers to get to work.

With the Web, Who Cares?

Most PC users I know right now are really into sharing things on sites like Facebook, Flickr, or Twitter. All this communal goodness