Loading

Thursday, December 29, 2011

Update Windows Path Environment Variable

Today I had to make similar changes to 10 Windows servers.  The changes consisted of copying a couple specialized programs from a source location and updating the Windows path.  I couldn't remember how to update the Windows path variable from the command prompt (other than for the current command prompt of course) so I tooled around the Internet a bit until I found it.  But as I was looking for the solution I found a lot of confusing and incomplete information about the Windows path variable.  Most of the info I found consisted of brief posts often followed by several discussions asking for more information.  Not knocking anyone here but most of this appeared to be by developers and not system admin types.  So I wanted to provide a thorough discussion on the Windows path variable, what is is, how it works and how to use it.

The Windows path variable has its roots way back in MSDOS, which means it's been around for over 30 years.  Basically the path is a list of directories (or folders) to be searched when a command runs.  For example say you're at the root of the C: drive in a Windows command prompt.  If you execute a command like robocopy Windows will look in the current directory first for the executable, robocopy.exe.  Since robocopy.exe isn't in the root of C: by default, and if you didn't have a path variable defined with the correct path you would get the message, "'robocopy' is not recognized as an internal or external command, operable program or batch file."  But since Windows by default has at least "C:\Windows\system32;C:\Windows" (usually more) in the Windows path the first directory, C:\Windows\system32, will be searched for robocopy.exe, and since it's there the program will run.  If it weren't there then the next directory in the path C:\Windows would be searched, then the next and so on until the program is either found or not.

The Windows path will always be searched whenever a command is executed (that isn't a core command like dir, or when the executable isn't found in the current directory) either from within a command prompt or Windows itself.  Remember it's always possible to specify the path and executable like with C:\Windows\system32\robocopy.  This will launch the command or program directly without having to search the path.

One of the quickest and easiest ways to view your current path is to open an command prompt and enter the command, path.


Modifying the Windows Path Environment Variable
It's worth noting that often when a program is installed the path to your application may be added to your path.  Your path will often consist of a dozen or more entries (in fact, I stripped down my path for the previous screen shot to show only a minimal path).

Back in the days of DOS and even Windows 95/98 and Windows NT the path was set through either (or usually both) files called comspec.sys and autoexec.bat.  In order to make a permanent change to your path it was common to edit either or both of these files.  But since these operating systems are so old and probably not used by many we'll skip the details.

So starting with Windows 2000 and XP (right up to and including Windows 2003, Windows 2008, Windows Vista and Windows 7, and I'm sure Windows 8) Microsoft did away with config.sys and autoexec.bat and moved the path variable (and others) into the Windows registry.  Of course you could edit the path directly in the registry but that's usually not a good idea and since there are other ways that's what we'll look at.

First, it's important to understand that there are different path variables; system, user, and what I like to call context (or session) variables.  For example when you open a command prompt the system and user path variables are read from the registry and assigned to that command prompt.  If you use the path command to modify the path it will only be modified within that command prompt session, or the "current context."

Let's say you are using a program while in a command prompt and want to add the path to that program to your path just for the current session.  You would simply enter the command set %path%;<path to new program>.  This would take your current path (as specified with %path%) and add or append the new path.  NOTE: use a semi-colon (;) between path entries.

For this example I added the path to a useful Amazon S3 utility called S3.exe.

Example: set path=%path%;C:\Admin\Utils\S3exe


Now I can run S3.exe without having to specify the full path to the command.  However, when I close the command prompt and open a new one this entry will not be present.  I'd have to add it again.  Or, add it to the Windows registry.

Setting Path Variables (semi-)Permanently
There are a few ways to make the path variables (both system and user) permanent.  At least they are permanent until you change them....

Settings for both user and system path variables (and a lot of others) are accessed through the System Properties applet.  Here are two ways to access System Properties.
  1. Right-click on Computer (formerly My Computer), click Properties.  Within the System window click Advanced System Settings.  This will open the System Properties window.
  2. OR, click Start, Settings, Control Panel, System, Advanced System Settings.   This will also open the System Properties window.

Click Environment Variables in the lower-right.  This will (finally) open the Environment Variables dialogue window.


The Environment Variables window allows you to add/edit entries to both the current user's path and the system path.  Entries in the system variables path will apply to all users on the system, whereas the user variables will apply only to the currently logged on user - i.e. you.

Just like with about everything else there's another way to do this and that's with the setx command from a command prompt (my preferred method.)  Using setx you can make permanent changes to either the user path variable or system path variable (or both).  NOTE: use quotes where shown in the commands.  The /M switch is used to set system path variable.  Both commands are written to the system registry as with the previous examples.

Example (user path variable): setx path "%path%;C:\Admin\Utils\S3exe"
Example (system path variable): setx path "%path%;C:\Admin\Utils\S3exe" /M


NOTE: these commands do NOT update your current path (in the command prompt), so you'll have to open a new command prompt for the path variables to include new/updated entries.

In the beginning I mentioned I had to make similar changes to several servers.  I was able to use robocopy to copy the programs/files I needed and setx to update the system path variable.  My commands consisted of about 5 lines that I just copied and pasted into the command prompt on each server and my "deployment" was completed in minutes using these simple commands.

Wednesday, November 9, 2011

Optimizing Images to Save Bandwidth on AWS

Last month our finance guy came to me in a bit of a panic to point out that our Amazon Web Services (AWS) bill was way higher than expected - by several thousand dollars.  After the initial shock wore off I started digging to figure out just what was going on.

From Amazon's bill I could easily determine that our bandwidth costs were way up, but other expenses (like EC2) were in line with previous months.  Since I have several S3 buckets that house content served from S3 and CloudFront, and since Amazon doesn't break down the costs enough I had to figure this one out on my own.

We serve millions of page views per day, and each page view causes several calls to different elements within our infrastructure.  Each call gets logged, which makes for a lot of log files - hundreds of millions of log lines per day to be exact.  But, this is where the detail I needed would be found so I had to dig in to the log files.

Because I collect so much log information daily I haven't built processes (yet) to get detailed summary data from the logs.  I do however, collect the logs and do some high level analysis for some reports, then zip all the logs and stuff them to a location on S3.  I like to hang on to these because you never know when a) I might need them (like now), and b) I'll get around to doing a deeper analysis on them (which I could really use, especially in light of what I've uncovered tracking down this current issue).

I have a couple of under-utilized servers so I copied a number of the log files from S3 to my servers and went to work analyzing them.

I use a plethora of tools on these log files (generally on Windows) such as S3.exe, 7zip, grep (GNU Win32 grep) and logparser.  One day I'm going to write a post detailing my log collection and analysis processes....

I used logparser to calculate the bandwidth served by each content type (css, html, swf, jpg, etc.) from each bucket on a daily basis.  My main suspect was image files (mostly jpg) because a) we serve a lot every day (100 million plus), and b) they are generally the biggest of the content we serve from S3/CloudFront.

Since my log files are so voluminous it actually took several days to cull enough information from the logs to get a good picture of just what was happening.  Even though I'd gotten over the initial shock of the increased Amazon bill I was a bit shocked again when I saw just what was happening.  Essentially, overnight the bucket serving my images (thumbs & stills) went up 3-4 times on a daily basis.  This told me either a) we were serving more images daily (but other indicators didn't point to this), or b) our images were larger starting that day than they had been previously.

Well, that's exactly what it was - the images were bigger.  Turned out a developer, trying to overcome one bottleneck, stopped "optimizing" our images and the average file size grew by nearly 4 times - just about the amount of bandwidth increase I'd found.  So, in order to save a few minutes per day and even a couple bucks with our encoder this one thing ended up costing us thousands of dollars.

Once I identified the issue I began working with our developers to fast-track a solution so we can accomplish all our goals: save time, save money encoding/optimizing the images, and get them small as possible to save on bandwidth with Amazon therefore saving a lot of money.  I also went to work to identify the images that were too big and optimize them.  In fact, this is actually an ongoing issue as our dev team hasn't quite implemented their new image optimization deployment, so I actually grab unoptimized (i.e. too big) images a few times a day, optimize them, then upload to S3.  This process probably justifies its own post so I'll do that soon & link to it from here.

Delete Files by Date With DOS Batch File

I have a server that is continuously filling it's drive with temporary files left over from a video encoding process we use.  Every week or so I have to manually delete the old files to prevent the drive from filling.  Finally today I headed on a journey to figure out a way to programmatically clean up these old files regularly.  So I tooled around the Internet to find a way to do it from the DOS command line.  Unfortunately others had run into the same issue I was, that DOS commands like del don't have a way to delete by date.  I found a few approaches using complex batch files & even tried one for a few minutes, but when I couldn't get it to work I went back to the drawing board.

I found a really old post suggesting using xcopy to copy the newest (presumably the ones to keep) files to a temp location, then delete the original files, then move those copied away back to their original location.  This approach had some promise, but had some real drawbacks too; particularly that I'm dealing with tens of gigabytes & this would take forever, and that I'm dealing with several and varying subdirectories.

Since xcopy has been deprecated and replaced with robocopy in Windows 2008, Windows 7, etc. that's what I chose to use.  In fact, robocopy has a couple switches that make it easy to move (/MOV) files older than x days (/MINAGE:x).

What I ended up with was a simple two line batch file that I'm using Windows task scheduler to run once a day.  The first line moves files older than x days to a temporary location & the second line deletes the moved files.
robocopy D:\Original_Location D:\DelOldFiles * /S /MOV /MINAGE:7
del D:\DelOldFiles\* /s /q
Breakdown
The robocopy syntax is ROBOCOPY source destination [file [file]...] [options].  I'm using the following switches (options):
  • /S - include subdirectories
  • /MOV - move (which is technically a copy, then delete original)
  • /MINAGE:x - act on files older than x days
After the files are moved I'm deleting all files (*), in all subdirectories (/s) in my temp folder, quietly (/q), i.e. don't prompt, just do it.

See also
Using dos to delete based on date

Thursday, October 27, 2011

ASA 5500 SSL VPN Add Licenses to ASA

I recently had to enable some of my mobile Mac clients with Cisco AnyConnect VPN Client for Mac.  Then, of course since the ASA only included 2 SSL VPN licenses and that's what the AnyConnect VPN Client uses I had to purchase some additional licenses.  I purchased the licenses through a reseller & a couple days later they sent me a PDF listing the product (L-ASA-SSL-10= ASA 5500 SSL VPN 10 Premium User License) and a Product Authorization Key.

First, go to the Cisco Product Registration Page and login with your TAC credentials.  In the Product Authorization Key (PAK) field enter the Product Authorization Key from your PDF then click submit.

Next, follow the prompts and agree to their end user license agreement.  You will have to provide the ASA's serial number which can be obtained from the chassis or via show version from the CLI (this is probably the best method as you can copy the S/N from the CLI, then paste it to the authorization screen).

Now wait.

After submitting the required information and verifying other info you'll see the following message indicating that you'll have to wait up to one hour to receive an email with the xxx.  You'd think Cisco would be able to provide this info right away.  Guess not.

You'll be presented with the following helpful message to read while you wait...
Your license and user information will be sent via email within 1 hour to the email address you specified. If you have not received an email within 1 hour, please open a Service Request using the TAC Service Request Tool. Please have your valid Cisco.com user Id and password available. As an alternative, you may also call our main Technical Assistance Center at 800-553-2447.
Please be sure to check your Junk/Spam email folders for this email from licensing@cisco.com with your license key attached.
Fortunately only a few minutes later I received the email with the ASA activation key (which is 77 characters  long) and the following instructions.

Installing Your Cisco Adaptive Security Appliance Activation Key
Step 1.  From the command line interface (CLI), enter configuration mode using the "conf t" command.
Step 2.  Type the "activation-key" command, and then, when prompted, enter the new activation key listed above.
Which I promptly followed.  Now I have 10 licenses with which to connect my clients.  This by the way is a bit of a disappointment as I already had two.  I would have hoped Cisco would have preserved the two gratis WebVPN licenses and added my 10 new ones.  Not so luck.

Friday, October 21, 2011

Cisco AnyConnect VPN Client for Mac

Recently some of our mobile users needed to connect to one of our networks that's protected by a pair of Cisco ASA firewalls.  It was no problem for the Windows users as I already had what I needed in place, however it was a different story for our Mac users.  Since it had been a while since I setup the ASA for AnyConnect for Windows I'd forgotten everything that was needed so I ran into a little trouble.

First, I downloaded the latest AnyConnect VPN client for Mac's from Cisco (anyconnect-macosx-i386-2.5.3055-k9.dmg at the time of this writing), and installed it on a MacBook Pro.

Notes:
  • Of course, you'll have to have a valid SmartNet agreement and account with Cisco to access these files.
  • And, since the Cisco VPN client only runs on 32 bit Mac's, AnyConnect is the only option for 64 bit Mac's.
With the AnyConnect VPN Client installed on the Mac I launched it and tried to connect to my ASA.  Here's when I ran into my first problem, receiving the message,"The AnyConnect package on the secure gateway could not be located. You may be experiencing network connectivity issues. Please try connecting again."


After a little research I realized I needed to upload the accompanying package (.pkg) file to the ASA.  So I headed back to Cisco to download the package file (anyconnect-macosx-i386-2.5.3055-k9.pkg - must match the version of the AnyConnect VPN Client on the Mac).

With that in hand I copied it to the ASA via TFTP, after, of course, dusting off my (FREE!) SolarWinds TFTP Server I haven't used for quite some time.  Here's the (Cisco) IOS command to copy the file via the terminal:
copy tftp:anyconnect-macosx-i386-2.5.3055-k9.pkg disk0:
Of course you'll have to provide the name/IP address of your TFTP server, which will conveniently be asked.

With that in place I tried again to connect.  However, I had the same problem, again receiving the message,"The AnyConnect package on the secure gateway could not be located. You may be experiencing network connectivity issues. Please try connecting again."  WTF?

Oh, yeah, I had to register the Mac AnyConnect package with the ASA's IOS.  Since I already have the Windows AnyConnect package registered as #1, and since most who connect to my ASA are Windows clients I left that in the first position and registered the Mac package second with the following commands:
config terminal
webvpn
svc image disk0:/anyconnect-macosx-i386-2.5.3055-k9.pkg 2
Then, by running show webvpn svc I can see that both the Windows and Mac AnyConnect packages are registered with my ASA.  


And I can successfully connect my Mac clients.  Booyah!!!

Need help adding SSL VPN licenses to your ASA 5500?

Monday, October 10, 2011

Expanding a Virtual Disk on a Dell MD 3000i SAN - How To

If you're like me you don't allocate all disks to a SAN out of the gate.  I like to keep a little in reserve so I can add capacity when needed.  Then, once all the disks are added I'll usually pickup a couple more disks and keep those in reserve.  In either case once it comes time to add capacity to a virtual disk on a Dell MD 3000i SAN it can be a little tricky.

This will be accomplished in two steps.  First add the capacity of one or more physical disks to a disk group.  Next expand the virtual disk.  The first step is rather easy and done through the Modular Disk Storage Manager utility.  Step two is a little tricky as it uses the Dell smcli command line utility.

Step 1 - add one or more drives to a Disk Group
  • Open the Dell Modular Disk Storage Manager utility
  • Click the Modify tab
  • Under the Storage subsection click Add Free Capacity (Physical Disks)
  • Select your disk group, click next
  • Select the capacity/number of disks, click finish
Now if you go back to the Summary tab and click Disk Groups & Virtual Disks you can see that you have free space available.


NOTE: This step can take some time to complete. Depending on the size and type of RAID you are running, it may take several hours or more (even days!) to complete. It will not take the disk group down, but may slow things a bit.  Also, this MUST complete before you can perform the next step!  If you jump the gun and run step two prematurely you'll receive the message, "Error 11 - The operation cannot complete because a virtual disk is performing a modification operation..."




Step 2- Expanding a Virtual Disk
  • Decide how much space to add in Bytes.  You could use a calculator such as this or this bit calculator.
  • On the computer running Dell Modular Disk Storage Manger, open a command prompt.
  • Navigate to Program Files\Dell\MD Storage Manager\client OR Program Files (x86)\Dell\MD Storage Manager\client if you are on a 64 bit machine.
  • Use the smcli command to expand the disk. Examples below.
smcli Syntax: smcli ArrayName -c "set virtualDisk ["virtualdiskname"] addCapacity=virtualdiskcapacityinbytes;"

Example smcli command - assumes the following:
  • MD3000i named SAN1
  • Virtual Disk named Disk1
  • Want to add 500GB to virtual disk
smcli -n SAN1 -c "set virtualdisk [\"Data1\"] addCapacity=536870912000;"
While this expands the capacity of the SAN virtual disk the operating system may not automatically recognize it.  On Windows 2008 server perform the following:
  • Open Server Manager 
  • Go to Storage, Disk Management
  • Right-click the desired Windows volume and select Expand Volume
  • Follow the prompts in the Extend Volume Wizard

Thursday, October 6, 2011

Cisco ASA ASDM Install and Download

A few months ago I got a new work computer.  Since it was a good opportunity to start fresh I didn't transfer all the programs from my old one to the new.  And one of them I neglected to transfer was ASDM.  I wasn't too worried about it since I often manage my ASA firewalls via the terminal using PuTTY.  But I had a need for ASDM recently so I downloaded it and ran it from my computer, but to my chagrin I received the message, "Unable to launch device manager from..."  Crap!

Since I couldn't remember exactly how to download ASDM from my ASA and it took me a bit to figure out.  And since I wanted to upgrade to the latest anyway, I thought I'd write myself a reminder here so in a year or two when I get a new computer I don't have to go through this same trouble again.  I hope others find it useful as well.

First, download the latest ASDM bin file from Cisco (you'll have to have a valid SmartNet contract to access the downloads section).  At the time of this writing the latest version is asdm-645.bin.

With that downloaded use something like TFTP to copy the file to the ASA.
config terminal
copy tftp: disk0:/asdm-645.bin
Next, register the ASDM bin with the ASA.
config terminal
asdm image flash:asdm-645.bin
NOTE: the ASDM version needs to be compatible with the IOS on the ASA.

Finally, access the ASA's admin interface with https://<LAN_interface_IP&rt;/admin.  NOTE: this has to be on the LAN interface, either from a computer running inside the ASA, or for an external computer connect via VPN, then access ASA's LAN interface.


Click the link, "Install ASDM Launcher and Run ASDM."  Follow the steps to install and connect to your ASA.

Wednesday, October 5, 2011

Steve Jobs 1955-2011

I'm no fan of Apple, but as a techie I have a profound respect for Steve Jobs and everything he's done for my industry, for computing in general and for consumer electronics.  Well done Steve!


Monday, October 3, 2011

Amazon ELB & IIS - Capturing Client IP Address

I've been using Amazon EC2's Elastic Load Balancer (ELB) for a couple years now to load balance web applications, and for the most part it's been great.  The one draw back I've run into is that IIS logs the load balancer's private IP address as the c-ip address, rather than the client's actual IP address.  Essentially the ELB acts like a NAT device.  This can be a problem when trying to troubleshoot requests to your IIS sites.  And is just plain annoying.

So I finally did a little digging on this and found a simple and elegant solution.  That is for IIS to log the IP address value of the X-Forwarded-For request header which ELB populates with the client IP address when it forwards the request to IIS.

Start by downloading the IIS X-Forward-For ISAPI Filter from F5 (click here for more information), and extracting the files.  There's a lot here, including source code, but all you need is the appropriate F5XForwardedFor.dll, either x86 (32 bit) or x64 (64 bit).  To make it easy I copied mine to the root of C:\inetpub, i.e. C:\inetpub\F5XForwardedFor2008\x64.

Next, open IIS Manager, highlighting the server name in the Connections pane.  In the <servername> Home pane double-click ISAPI Filters.  Then in the Actions pane (upper-right corner) select Add.  Give the filter a name (I used Xforward) and specify the exact location of the Executable (F5XForwardedFor.dll).

NOTE: by adding this at the server level it will apply to all sites on the server.


Click OK and you're done.  Now, sit back, relax and wait for your server logs to accumulate.  Here's a view of an IIS log after enabling the F5XForwardedFor ISAPI filter.


NOTE: After installing this ISAPI filter I did notice a slight CPU load increase on my IIS servers, around 1-2% more.  Basically my servers average between 10% - 30% under normal load, now they average about 12% - 32%.  Not much, but noticeable, but in my opinion worth the load.

Thursday, August 11, 2011

Copying an EBS-backed Windows 2008 AMI Between AWS Regions - How-to

Unfortunately Amazon doesn't have an easy or native way to copy or move or launch an AWS AMI from one region to another.  There are a number of posts on the Internet about how to do this with a Linux AMI, but I haven't been able to find clear instructions on how to do this for a Windows AMI.  So, here we go...

The basic steps involve starting a temporary Windows instance in each of the two regions, say us-east-1 and us-west-1; attaching the EBS boot volume to the server in the "source" region; making an image or zip file of the volume; copying the volume to the temporary server in the "destination" region; extracting the file to a new volume; finally, attaching that volume to a server.

Notes:
  • This will take a while (several hours), particularly if your AMI is large.
  • Clean up the boot volume of the image you want to copy to another region by deleting any unnecessary files, such as temporary files, etc. as it will reduce the overall time this process takes.
  1. Launch a temporary Windows instance in the “source” region and another one in the “target” region. (You may not have to launch temporary servers if you have one available in each that can handle the load of compressing a large volume which can be quite CPU intensive.  Additionally you need to have enough available disk space for the compressed volume to be stored temporarily.)
  2. Determine the snapshot for the boot volume you want to migrate (you must own the AMI) using the command ec2-describe-images.


  3. Create a new EBS volume from that snapshot in the same zone as your origin server.  This can be done many ways, but here's how to do it from the command line using the AWS tools:
    ec2-create-volume --snapshot <snap ID> -z us-east-1c
  4. Attach that volume to your temporary server instance as, say, “xvdg”:
    ec2-attach-volume <volumeID> –i <instanceId> –d xvdg
     NOTE: You will be able to browse the contents of the volume in Windows Explorer.

  5. Connect to your temporary source server with RDP.
  6. Zip the entire contents of the newly attached volume.  NOTE: I used 7zip and sent the zipped file to another volume on the temporary source server in 1GB chunks (this makes it easier and quicker to transfer to the destination server; in particular you can begin copying the chunks soon as each is finished rather than waiting for one large file.)
  7. Copy that zipped file (or files) to your instance in the “target” region.  This could be done by a variety of methods.  I chose to copy my 1GB chunks to an Amazon S3 bucket, then I could easily download those onto the destination server.

    In the target region:

  8. Create an EBS volume of appropriate size (30GB for Windows 2008 by default) and attach it to your temporary destination server.
  9. Unzip the file to the new volume.  Again, I used 7zip.
  10. Detach the volume.

    Now, for the Windows specific stuff….

  11. Launch a basic Windows 2008 instance of the right architecture (32 or 64 bit).
  12. Soon as the instance is “running” (see Pinging Amazon EC2 Instances to determine exactly when your instance is available) stop it and wait for its state to become “stopped”.
  13. Once it stops, detach its “/dev/sda1” volume and delete it using ec2 commands:
    ec2-detach-volume <the_volumeID_of_sda1> –i <new_windows_instance>
    ec2-delete-volume <the_volumeID_of_sda1>

  14. Now attach the new volume (from steps 8-10) to the stopped Windows instance as ‘/dev/sda1’:
    ec2-attach-volume <vol_id> –i <windows_instance_id> –d /dev/sda1
  15. Start the instance to make sure it boots, and connect to it with RDP.
  16. When you’re satisfied that it boots and is setup the way you desire, stop the instance using ec2stop -i <instanceID>.
  17. Finally, create an AMI from that server by running ec2-create-image -i <instanceID>.
That's it.  Now you have an AMI in a different AWS zone that is a copy of one from your initial zone.

How Can I Improve My Web Site's Search Results Ranking?

Tonight my friend contacted me and asked how she could get her store's new website to show up in search results.  While I don't claim to be an expert I do have a little experience with web sites, ecommerce, blogging and SEO (search engine optimization).  Here's a list of what I told her just shooting from the hip.

I told her it's definitely a multi-faceted approach.  First, her site looks good, is easy to navigate and has relevant information.  Without a decent place to start none of the rest of this will matter.
  1. Start with a good site with good, relevant content.
  2. Be patient. It takes time to rise to the top, or even to rise at all.
  3. Get visitors. The more traffic your site gets naturally (sometimes called type-in traffic) the better it will rank in search results. Give the URL to all your customers. Print it on their receipt, on the merchandise bags, put a flyer in their bag. Put your sites address up in your stores. Outside the stores. Basically anywhere you can. Get your existing customers to go to the site.
  4. Add content (merchandise and info) to your site often as possible.  Keep the site fresh. Use the island names (or your location) in product descriptions if/when possible. Basically you want the search words people would use to find what you offer throughout your site as much as possible.
  5. Have your own blog and use it to make announcements about new products, etc.  This helps fulfill the previous suggestion. And post to it regularly. Again using key words.  And make sure it links back to your store.
  6. Inbound links are invaluable, particularly from higher traffic sites. Post the link on facebook, twitter or anywhere you can. Try to get written up and linked in your local paper, citysearch, kudzu, places like that. Trade links with other sites where it makes sense, etc. Inbound links are the holy grail of high-ranking search results, and ultimately more site traffic.
  7. Work your networks, get people going there, linking to it etc.
  8. Use site analytics.  Make sure to enable some kind of site analytics (either from your hosting provider or Google Analytics or other) so you can monitor activity to your site over time; and track key words people used to find your site; and where they came from (search engines, inbound links, etc.).
  9. While it's harder and harder these days to get good domain names it really helps if the site name is something that makes sense, is easy to remember.  It is also really important for it to match the name of your business.
Again, be patient.  It takes time to build traffic, especially search traffic and to get ranked higher in search results. While no one knows exactly the algorithms that Google and other search engines use it is no doubt a combination of the things listed above (and certainly more).  Build your traffic organically using the customers already interacting with you.  Make sure your site is easy to navigate, looks good and has lots of content, particularly the key words you believe people might use to find products or services you offer.

If you're ever in the Charleston, SC area go to Islands Mercantile on both Seabrook and Kiawah islands for some great T-shirts, hats and other souvenirs.

Friday, July 29, 2011

Google Maps Gone Bad

Trying to find a Quiznos and according to Google Maps there are two a couple miles apart, however their addresses are several states apart...  WTF Google?

Sunday, July 17, 2011

How To Disable Google Instant

While I pretty much love (or at least strongly like) Google, there are a few features that I cannot stand.  Google Instant is one of them.  Google's autocomplete is a little annoying, albeit a bit entertaining at times; but Google Instant drives me crazy.  Every time I go to Google from a new computer (which is fairly regularly) I disable Google Instant.  Disabling it is easy, just go to Preferences (http://www.google.com/preferences), scroll down about half way and select Do not use Google Instant, then save your preferences.

Tuesday, July 12, 2011

How Digital Detectives Deciphered Stuxnet, the Most Menacing Malware in History

Stuxnet required an enormous amount of resources to produce, but its cost-benefit ratio is still in question. While it may have helped set Iran’s program back to a degree, it also altered the landscape of cyberattacks. Stuxnet’s authors mapped a new frontier that other attackers are bound to follow; and the next target for sabotage could easily be a nuclear facility in the United States.

Read entire article (a great read).

Thursday, July 7, 2011

How To Upgrade to Gingerbread After Rooting and Removing Crapware From Your Droid X

About 6 months ago I set out on a quest to root my Droid X (running FroYo) in order to remove/disable unwanted apps like CityID, BlockBuster, VZ Navigator, etc.  While that was very successful, it did impede my ability to update to the much desired Gingerbread.  While I consider myself smart and quite educated in the ways of technology (I've made a decent living in the IT field for 20 years) I have really struggled to figure this out & it's frustrated me greatly.  There are a number of forums which discuss what to do and how to do it, but they almost always throw out terms which the lay person (with respect to Android OS in particular) won't understand or instructions that are written in short hand.  While this may be fine for those "in the know," it's not fine for the rest of us.  So after pulling my hair out several evenings and weekends recently and reading a ton of stuff, I believed I finally stitched it all together enough to have upgraded my rooted Droid X to Gingerbread - but wait, there was a problem.....

I'll address that problem later (perhaps even in another post), but suffice it to say that although my Droid X reported it was on the latest and greatest Android OS, Gingerbread (AKA 4.5.596) it would often tell me there was an update available, and display the message, "Info.  Download of update failed."  This has finally gotten to me and I'm in the process of correcting it, writing this as I progress with correcting this.

Here are the basic steps, then I'll expound on each.
  • Backup data (and apps)
  • SBF back to stock FroYo
  • Verizon OTA update to Gingerbread
  • Restore data (and apps)
Important note: this will leave you with the stock version of Gingerbread from Verizon/Motorola which includes the undesired built-in apps like CityID, BlockBuster, VZ Navigator, etc. that I worked so hard to remove previously; and as of this writing there is no way to gain root access of this version of Gingerbread (although you could always install a rooted SBF of Gingerbread....).  On the bright side, at least you'll be running Gingerbread on your Droid X.....

NOTE: There are a few gotcha's and things to watch out for, so please read and follow these instructions carefully.  For example at various points your phone may not start or the battery won't charge, but these things are addressed in the instructions.

Step 1 - backup your data and apps
Ever since rooting my Droid I've been using Titanium Backup Pro to backup my stuff, and it's been great.  However, in my attempts to upgrade to Gingerbread, which was somewhat successful except that I lost root so I wasn't able to use Titanium Backup to do a current backup as it requires root.... If you use TB and still have root access use that to backup everything you desire and skip to step 2, otherwise keep reading.

Since I couldn't use TB after losing root I got a copy of MyBackup and backed up everything, particularly the data on my phone.

NOTE: make sure you do a backup and/or be prepared to lose all your data (SMS, call logs, etc.) as one of the following steps requires wiping your phone.

Step 2 - SBF back to stock FroYo
First, WTF is SBF? The .SBF file basically consists of the original software platform that your phone was released with. It doesn’t seem like anyone truly understand what SBF stands for...

Download and install Morotola's RSD Lite - as of this post the latest version is 4.9, which is the version I used for these instructions.  The best way to find it is to do a web search for "rsd lite 4.9 download" and download from one of the file sharing sites - I didn't include a link here because 1) it may be outdated either by being removed from the download site, or a newer version of the program may be available; and 2) I don't particularly like these sites and didn't want to endorse any with a link.

NOTE: I did see some references that people reported problems running RSD Lite on Windows 7 64-bit however, that's exactly what I'm using and this all worked just fine for me.

Download the (FroYo) Full 2.3.340 Official SBF (filename VRZ_MB810_2.3.34_1FF_01.sbf).  This thread has a link to the file I used.

NOTE: Make sure your battery is full or as close as possible before proceeding as it can take a while (30 minutes or more) and the battery doesn't charge during most of these steps.
  • Connect your Droid via USB cable.
  • Launch RSD Lite.
  • Reboot Droid into Boot Loader (pull battery, or use power button to turn off; hold volume down and camera buttons, and press & release power button - continue holding volume down and camera buttons until triangle with exclamation point icon appears).  Once Droid is in boot loader it should be listed as an available device in RSD Lite.  The Droid's bootloader screen looks something like this:
Bootloader
2C.5C

Battery OK
OK to Program
Transfer Mode:
USB
  • In RSD Lite select the device (Droid) and browse to the SBF file downloaded previously, then press Start.
  • Sit back and let RSD Lite do it's thing.

After RSD Lite is done the Droid will restart, however you will likely just get to the animated red Droid Eye, sit there for a couple minutes & reboot over and over again.  At this point you need to wipe the phone, and since you have a good backup it shouldn't be too painful... Right.!?  To wipe the phone power it off (have to pull the battery), then press and hold the home button and power button (you can let the power button go after a couple seconds, but must continue to hold the home button).  This will take you to the Android system recovery utility.  Next, press both up/down volume buttons at the same time to display the menu, then press the down volume button to select "wipe data/factory reset" and press the camera button.  You will be presented with at least one warning that you will lose all data, but since you have it backed up you should feel pretty good about proceeding.

NOTE: While in the Android system recovery utility you will also want to "wipe cache partition" as not doing so may cause your battery not to charge after completing these steps.

Finally, reboot the system.

 After the phone boots you will have to follow the prompts to activate the phone with Verizon.

Step 3 - Droid X OTA Update
This is perhaps the easiest part - doing a standard OTA update.  On the phone go to Setting, About Phone, System Updates and download the Gingerbread (4.5.596) update.  Once downloaded install it.


And, success....


Step 4 - Restore Data & Apps
Go to the Android Market and install your backup software (in my case it's MyBackup), then restore your data and apps.

NOTE: after the OTA update to Gingerbread my Droid wouldn't actually charge, although it said it was charging.  In an earlier step I addressed wiping the cache partition - which did the trick when I had this problem previously.  At this point I was a bit concerned, but a simple battery pull corrected the issue and it's working great now.

Happy Androiding with Gingerbread on your Droid X....  Oh, and stay tuned as I will definitely post detailed instructions on how to remove the crapware (CityID, Blockbuster, VZ Navigator, etc.) from Gingerbread soon as I figure it out.

Thursday, June 30, 2011

These Damn ATM Fees Are Killing Me!


Never mind that I have nearly one hundred million...

Wednesday, June 22, 2011

Stuxnet: Anatomy of a Computer Virus


Stuxnet: Anatomy of a Computer Virus from Patrick Clair on Vimeo.
An infographic dissecting the nature and ramifications of Stuxnet, the first weapon made entirely out of code. This was produced for Australian TV program HungryBeast on Australia's ABC1

Direction and Motion Graphics: Patrick Clair
Written by: Scott Mitchell

Production Company: Zapruder's Other Films.

Saturday, June 4, 2011

How To Remove City ID (and other crapware) From Droid X (and other Android phones)

I've been on a quest to remove City ID, Blockbuster and other crapware that came bundled with my Droid X which Verizon won't allow me to remove.  Searching for "uninstall city id" or "remove blockbuster" will net thousands of results of people asking how to do so - almost all of which have nothing good to say about Ciquent (the developers of City ID), Blockbuster or Verizon.  I pretty much agree with all I've read.  In fact I have vowed to never use products ever again from Ciquent or Blockbuster, and I've notified both of my disgust and vows.

In my quest I haven't been able to find any specific instructions on how to remove this crap.  Most "instructions" say something like, "root, remove, reboot."  Well I persevered and figure it out.  It's actually pretty easy to get rid of these unwanted (cr)apps; in fact, it can be done using three readily available apps (actually four, but one gets installed automatically).

Here I'm going to provide detailed instructions (including pretty screenshots) on how to obtain and install the apps you need to root your phone (and unroot when you're done if desired) and remove those undesired bundled apps like Blockbuster, City ID, VZ Navigator and others.  First some warnings and notes though:
  • WARNING: Removing these annoying apps (rather than disabling or freezing them) will make it difficult to upgrade your Droid X to Gingerbread.  Not to worry though, here are detailed instructions on how to Upgrade to Gingerbread After Rooting and Removing Crapware From Your Droid X.
  • WARNING: use these instructions at your own risk.  You are responsible for what you do to your phone - not me.
  • WARNING: the web is replete with posts saying rooting your phone may void the warranty or brick your phone; however there are also a number of posts either disputing this or saying they haven't had a problem with warranty issues after rooting.  Again, you assume all risk for what you do to your device.
  • These instructions were used to remove unwanted programs from a Motorola Droid X running Froyo version 2.2.1 (system version 2.3.340).  It may or may not work on other devices or with other versions of Android.
  • These instructions work as of the date of this post.
  • Good luck and be happy to be rid of crapware from Verizon!
Android apps used in this guide
  • Superuser
  • z4root (AKA z4mod) by RyanZa - z4root.1.3.0.apk download mirrors (not in Market - use this link)
    • Busybox (automatically installed by z4root)
  • Titanium Backup
    Step 1 - Download/install Superuser from Android Market (search superuser)

    Step 2 - Download and install z4root, and root your device
    • Download z4root from one of the mirrors listed in the link directly to your Droid (may not be available in Android Market - click download link.  If not available via link leave a comment with a way to contact you and I can provide one).
    • Click the z4root-2.1.3.0.apk file to install (you may have to enable installation of non-Market applications - Home screen, Settings, Applications, check Unknown sources)
    • Launch z4root/z4mod
    • Select Permanent Root.
      • This may take SEVERAL minutes - be patient.
      • While it's running Busybox will be downloaded and installed.
      • You will also see various messages about the progress of rooting your phone.
      • It will either reboot your Droid or prompt you to do so.
      • NOTE: on my first attempt I selected Temporary Root which didn't appear to work as later steps failed.
      • NOTE: you can undo or unroot your Droid at any time.
      • NOTE: my first few attempts to root with z4root didn't work.  My Droid locked and I had to pull the battery to reboot.  I uninstalled z4root and installed again from one of the links above and it worked fine after that.  In fact, I did all these steps again so I could make sure these steps are accurate and grab some screen shots.
      • After rebooting open z4root/z4mod and if you see this screen you know you're rooted.


    Step 3 - Install and run Titanium Backup (search titanium backup in Market)
    • NOTE: the free version of Titanium Backup works for this, however as it does much more and is a great app I'd recommend upgrading to the pro version.
    • When you launch Titanium Backup it will tell you if you don't have root.  If you do have root it will say "Root access: OK" and look like this.

    • Click on Backup/Restore which will display a list of installed apps on your phone.
    • Scroll to the (cr)app you no longer want and click on it and select Un-install.
    • You will receive a warning asking if you're sure.  If so, click Yes and it's gone!
    • Remove other unwanted crapware to your heart's content.
    I used this to remove Blockbuster, City ID, Skype and VZ Navigator.  I'm definitely feeling better after removing all this crap!

    That's all there is to it.  Of course you can use z4root to un-root your phone if desired.

    Uninstall City ID from Droid X.  Uninstall Blockbuster from Droid X.  Uninstall Skype from Droid X.  Uninstall VZ Navigator from Droid X.

    Monday, May 23, 2011

    How Many Secret Service Agents Does It Take To Get Obama's Limo Unstuck...

    This is classic!  Obama high-centered.


    Obama's Car Gets Stuck At US Embassy - Watch more Funny Videos

    During his visit to Ireland, Obama's car got stuck at the US Embassy's gate. Or as Fox News reported, "Oh God, This Guy Has Embarrassed America, AGAIN!"

    Friday, April 22, 2011

    Error Adding Windows 2008 R2 to Existing 2003 Active Directory

    Tonight I'm trying to promote a spanking new Windows 2008 R2 server as a domain controller in an existing Windows 2003 AD.  When I ran dcpromo on the new server I was presented with the following message from the Active Directory Domain Services Installation Wizard, "To install a domain controller into this Active Directory forest, you must first prepare the forest using "adprep /forestprep".  The Adprep utility is available on the Windows Server 2008 R2 installation media in the \support\adprep folder."


    I promptly opened and Command Prompt on the R2 server, navigated to the \support\adprep folder and ran adprep /forestprep.  No joy!  Now I got the message:
    Adprep cannot run on this platform because it is not an Active Directory Domain Controller.
    [Status/Consequence]
    Adprep stopped without making any changes.
    [User Action]
    Run Adprep on a Active Directory Domain Controller.
    So, I went to one of my 2003 domain controllers and ran adprep /forestprep.  Another problem!
    The image file C:\support\adprep\adprep.exe is valid, but is for a machine type other than the current machine.
    It took a few minutes but I finally figured out I need to run adprep32 /forestprep since my 2003 server is 32 bit.  Ah, hah!  Of course, there's this little message:
    ADPREP WARNING:
    Before running adprep, all Windows 2000 Active Directory Domain Controllers in the forest should be upgraded to Windows 2000 Service Pack 4 (SP4) or later.
    [User Action]
    If ALL your existing Windows 2000 Active Directory Domain Controllers meet this requirement, type C and then press ENTER to continue. Otherwise, type any other key and press ENTER to quit.

    Just a little bit more....

    From the same 2003 server you'll have to run adprep32 /domainprep as well.

    Now that adprep(32) /forestprep  and adprep(32) /domainprep were successfull I can promote my 2008 R2 server to DC.

    Wednesday, March 16, 2011

    How to Unlock Secure PDFs

    Tonight I needed to print a couple pages of a service manual that was in a secure PDF.  So I did a little googling and found a few ways to do this, however most were commercial products costing $40 or so.  Then I found FreeMyPDF.com, a FREE site that will "unlock" a PDF so you can print it.  Give it a try - then send them a couple bucks for this great tool.

    Charlie Sheen for Halloween

    Mom, can I be Charlie Sheen for Halloween?

    Tuesday, February 15, 2011

    Truncate (or Purge) Transaction Log in SQL 2008

    Over the weekend one of our critical servers ran out of disk space on the volume which contains the transaction logs & all hell broke loose.  Our DBA was at a wedding and couldn't be reached so it was up to me to get things working ASAP.  I've truncated logs before in SQL 2005 and SQL 2000 (I've even written about it on this blog) with the following:
    BACKUP LOG <DataBase_Name>
    WITH TRUNCATE_ONLY
    GO
    DBCC SHRINKFILE (2,1, TRUNCATEONLY)
    GO
    However, our dear friends at Microsoft have removed TRUNCATEONLY from SQL 2008. Searching the 'net I found a few fragmented suggestions. But the one that was the bomb and corrected things for me right away was this great post by Otto R. Radke.  There is only one item that has to be customized (highlighted) with the DB name and voila, it fixed by problem by truncating my huge transaction log.  Thanks Otto!

    ------------------------------------------------------------------------------
    -- Otto R. Radke - http://ottoradke.com
    -- Info: T-SQL script to shrink a database's transaction log. Just set the
    -- database name below and run the script and it will shrink the
    -- transaction log.
    ------------------------------------------------------------------------------
    ------------------------------------------------------------------------------
    -- Update the line below with the name of the database who's transaction
    -- log you want to shrink.
    ------------------------------------------------------------------------------
    USE <YourDatabaseName>
    ------------------------------------------------------------------------------
    -- Don't change anything below this line.
    ------------------------------------------------------------------------------
    GO
    -- Declare variables
    DECLARE @SqlStatement as nvarchar(max)
    DECLARE @LogFileLogicalName as sysname
    -- Alter the database to simple recovery
    SET @SqlStatement = 'ALTER DATABASE ' + DB_NAME() + ' SET RECOVERY SIMPLE'
    EXEC ( @SqlStatement )
    -- Make sure it has been altered
    SELECT [name], [recovery_model_desc] FROM sys.databases WHERE [name] = DB_NAME()
    -- Set the log file name variable
    SELECT @LogFileLogicalName = [Name] FROM sys.database_files WHERE type = 1
    -- Shrink the logfile
    DBCC Shrinkfile(@LogFileLogicalName, 1)
    -- Alter the database back to FULL
    SET @SqlStatement = 'ALTER DATABASE ' + DB_NAME() + ' SET RECOVERY FULL'
    EXEC ( @SqlStatement )
    -- Make sure it has been changed back to full
    SET @SqlStatement = 'SELECT [name], [recovery_model_desc] FROM ' + DB_NAME() + '.sys.databases WHERE [name] = ''' + DB_NAME() + ''''
    EXEC ( @SqlStatement )
    ------------------------------------------------------------------------------

    Windows 7 RUNDLL32 Shortcuts

    Here is a good list of RUNDLL32 shortcuts / commands that can be used in Windows 7 and Windows 2008 (most also work in Vista and Windows 2003).

    Add/Remove Programs
    RunDll32.exe shell32.dll,Control_RunDLL appwiz.cpl,,0
    Content Advisor
    RunDll32.exe msrating.dll,RatingSetupUI
    Control Panel
    RunDll32.exe shell32.dll,Control_RunDLL
    Date and Time Properties
    RunDll32.exe shell32.dll,Control_RunDLL timedate.cpl
    Device Manager
    RunDll32.exe devmgr.dll DeviceManager_Execute
    Folder Options – Opens to General Tab
    RunDll32.exe shell32.dll,Options_RunDLL 0
    Forgotten Password Wizard (requires removable disk)
    RunDll32.exe keymgr.dll,PRShowSaveWizardExW
    Hibernate
    RunDll32.exe powrprof.dll,SetSuspendState
    Keyboard Properties
    RunDll32.exe shell32.dll,Control_RunDLL main.cpl @1
    Lock Screen
    RunDll32.exe user32.dll,LockWorkStation
    Mouse Properties
    RunDll32.exe shell32.dll,Control_RunDLL main.cpl @0
    Map Network Drive
    RunDll32.exe shell32.dll,SHHelpShortcuts_RunDLL Connect
    Network Connections
    RunDll32.exe shell32.dll,Control_RunDLL ncpa.cpl
    Power Options
    RunDll32.exe Shell32.dll,Control_RunDLL powercfg.cpl
    Regional Settings
    RunDll32.exe shell32.dll,Control_RunDLL intl.cpl,,3
    Stored Usernames and Passwords
    RunDll32.exe keymgr.dll,KRShowKeyMgr
    System Properties: Advanced
    RunDll32.exe shell32.dll,Control_RunDLL sysdm.cpl,,4
    Taskbar Properties
    RunDll32.exe shell32.dll,Options_RunDLL 1
    User Accounts
    RunDll32.exe shell32.dll,Control_RunDLL nusrmgr.cpl
    Windows Security Center (Windows 7 only)
    RunDll32.exe shell32.dll,Control_RunDLL wscui.cpl
    Windows – About
    RunDll32.exe SHELL32.DLL,ShellAboutW
    Unplug/Eject Hardware
    RunDll32.exe shell32.dll,Control_RunDLL hotplug.dll
    Windows Firewall
    RunDll32.exe shell32.dll,Control_RunDLL firewall.cpl
    Wireless Network Setup
    RunDll32.exe shell32.dll,Control_RunDLL NetSetup.cpl,@0,WNSW

    List of Windows 7 Shell Commands

    Windows 7, Windows 2008 (including R2) and Windows Vista shell commands. These can be executed from the "run" command, the "search programs and files" dialog or straight in the address field of Windows Explorer (not Internet Explorer).

    shell:AddNewProgramsFolder
    shell:Administrative Tools
    shell:AppData
    shell:AppUpdatesFolder
    shell:CD Burning
    shell:CSCFolder
    shell:Cache
    shell:ChangeRemoveProgramsFolder
    shell:Common Administrative Tools
    shell:Common AppData
    shell:Common Desktop
    shell:Common Documents
    shell:CommonDownloads
    shell:CommonMusic
    shell:CommonPictures
    shell:Common Programs
    shell:Common Start Menu
    shell:Common Startup
    shell:Common Templates
    shell:CommonVideo
    shell:ConflictFolder
    shell:ConnectionsFolder
    shell:Contacts
    shell:ControlPanelFolder
    shell:Cookies
    shell:CredentialManager
    shell:CryptoKeys
    shell:Default Gadgets
    shell:Desktop

    shell:Downloads
    shell:DpapiKeys
    shell:Favorites
    shell:Fonts
    shell:Gadgets
    shell:GameTasks
    shell:Games
    shell:History
    shell:InternetFolder
    shell:Links
    shell:Local AppData
    shell:LocalAppDataLow
    shell:LocalizedResourcesDir
    shell:MAPIFolder
    shell:MyComputerFolder
    shell:My Music
    shell:My Pictures
    shell:My Video
    shell:NetHood
    shell:NetworkPlacesFolder
    shell:OEM Links
    shell:Original Images
    shell:Personal
    shell:PhotoAlbums
    shell:Playlists
    shell:PrintHood
    shell:PrintersFolder
    shell:Profile
    shell:ProgramFiles
    shell:ProgramFilesCommon
    shell:ProgramFilesCommonX86
    shell:ProgramFilesX86
    shell:Programs
    shell:Public
    shell:PublicGameTasks
    shell:Quick Launch
    shell:Recent
    shell:RecycleBinFolder
    shell:ResourceDir
    shell:SampleMusic
    shell:SamplePictures
    shell:SamplePlaylists
    shell:SampleVideos
    shell:SavedGames
    shell:SearchHomeFolder
    shell:Searches
    shell:SendTo
    shell:Start Menu
    shell:Startup
    shell:SyncCenterFolder
    shell:SyncResultsFolder
    shell:SyncSetupFolder
    shell:System
    shell:SystemCertificates
    shell:SystemX86
    shell:Templates
    shell:TreePropertiesFolder
    shell:UserProfiles
    shell:UsersFilesFolder
    shell:Windows

    Monday, February 7, 2011

    Bon Jovi Live in Concert

    Watch live streaming video of Bon Jovi concert in State College, PA this Wednesday night at 8:30 PM EST, right here!  FREE.

    Friday, February 4, 2011

    Smart Phones Directly Affect Bathroom Habits


    With the proliferation of smartphones over the past few years time spent in the, ah, rest room has greatly increased.  My wife and kids don't understand this but I'm sure all the men will relate. . .

    Tuesday, January 25, 2011

    Amazon Simple Email Service on Windows - How To

    Today Amazon announced AWS Simple Email Service (SES) beta.  SES is a great addition to Amazon Web Services, with it an organization can send marketing, transactional, subscription or system notification messages without have to manage their own messaging infrastructure.  And just like all other AWS services it's pay-as-you-go - even free in some instances.

    Soon as I received the announcement from Amazon I immediately set out to give it a try.  Since I normally use Windows that's what I used for this.  I ran into a couple of minor problems but was easily able to resolve them and now I'm sending email through SES like a mad man. . .

    Summary - Quick Steps
    If you're anxious to get started and don't want any fluff here you go.  For everyone else read below.
    • Sign-up for SES
    • Install Perl
      • Install XML-LibXML via Perl Package Manager (instructions below)
    • Download AWS SES scripts
    • Setup "credentials" file (see below for details)
    • Get verified: ses-verify-email-address.pl -k creds.txt -v test@powercram.com
    • Send email: ses-send-email.pl -k creds.txt -s "Test One" -f test@powercram.com test@powercram.com
    Prerequisites
    Sign-up for SES.  If you already have an AWS account you're one step closer, if not you'll have to start there.

    SES uses Perl scripts, therefore you must have Perl installed on your Windows machine.  I installed ActivePerl Community Edition.  Soon as that was done I ran the first SES script to get an email address verified but ran into my first problem - c:\perl\bin didn't get added to my path by the installation (for some reason it added c:\perl\site\bin) so I had to do that manually (if you don't know how to do this you probably shouldn't be here anyway. . . )

    Amazon Simple Email Service Scripts
    Download the SES scripts and save to a useful location - I used d:\aws\ses.  This download includes the following SES scripts:
    • ses-get-stats.pl - retrieves statistics about Amazon SES account usage
    • ses-send-email.pl - send email using Amazon SES
    • ses-verify-email-addresses.pl - verify email addresses to be used with Amazon SES
    Next problem - when I ran ses-verify-email-address.pl --help I received the message: "Can't locate XML/LibXML.pm in @INC (@INC contains: C:/Perl/site/lib C:/Perl/lib.) at D:\AWS\SES\ses-verify-email-address.pl line 26.  BEGIN failed--compilation aborted at D:\AWS\SES\ses-verify-email-address.pl line 26."

    After tooling around the web for a few minutes I realized I needed to manually install XML-LibXML.  This was easily done by opening the Perl Package Manager off the Start menu.  In there:
    • Click the "View All Packages" button or press Ctrl+1
    • Type libxml in the search box
    • Right-click on XML-LibXML and select Install . . .
    • Click File, Run Marked Actions or press Ctrl+Enter
    Now when you run ses-verify-email-address.pl --help from the command line you can actually see the help for this command.

    Credentials File for SES Commands
    All of the SES scripts or commands require authentication to AWS, which makes sense.  You can save your credentials (both AWSAccessKeyId and AWSSecretKey) to a file, creds.txt and pass that to each script with the -k <filename> command.

    Example credentials file:
    AWSAccessKeyId=022QF06E7MXBSH9DHM02
    AWSSecretKey=kWcrlUX5JEDGM/LtmEENI/aVmYvHNif5zB+d9+ct

    Verify Email Address for SES
    In order to send any email you must add & verify at least one email address to which you have access.  The verification is a two-step process.  First run the command: ses-verify-email-address.pl -k creds.txt -v test@powercram.com.  Amazon will send an email to that address with a link to click to finalize verification.

    NOTE: Until you are granted production access to Amazon Simple Email Service you can only send to verified addresses. Click to Request for Production Access to Simple Email Service.  They say it may take up to 24 hours, but my access request was granted in about 30 minutes - now I can send to any address!


    View List of Verified SES Addresses
    By running the command ses-verify-email-address.pl -k creds.txt -l you are supposed to be able to view a list of verified addresses, however when I run this nothing is returned.  I did discover though that using the --verbose switch, ses-verify-email-address.pl -k creds.txt -l --verbose, I am able to view a list of verified addresses:

    <listverifiedemailaddressesresponse xmlns="http://ses.amazonaws.com/doc/2010-12</p><p>01/">
     </listverifiedemailaddressesresponse>
    <listverifiedemailaddressesresult></listverifiedemailaddressesresult>
        <verifiedemailaddresses></verifiedemailaddresses>
          <member>test@powercram.com</member>
     <responsemetadata></responsemetadata>



    Send Email With SES
    Finally we are ready to send email using the command ses-send-email.pl -k creds.txt -s "Test One" -f test@powercram.com test@powercram.com.  Press Enter then you can type the body of your message.  When that's done press CTRL+Z, then Enter.  It will hesitate for a second or two while your credentials, etc. are verified and the message is queued.  Finally, check your email.

    Summary
    Amazon Simple Email Service looks to be a very useful tool and is a great addition to Amazon Web Services.  In just a few minutes you can be sending email through SES, and it can be adapted for myriad purposes.  Get started today and start emailing (useful messages - NO SPAM or other crap!).

    Additional Info
    See Also

    Sunday, January 23, 2011

    Roboplow - Awesome robot snowplow

    This is how snow should be plowed!

    Dude Builds Snow Plowing Robot - Watch more

    Saturday, January 22, 2011

    GNUWin32 Grep for Windows

    Grep for Windows 7, Windows 2008, etc.

    Grep searches one or more input files for lines containing a match to a specified pattern. By default, grep prints the matching lines.

    The general synopsis of the grep command line is
    grep options pattern input_file_names
    Grep for Windows examples


    Download GNUWin32 Grep.

    Wednesday, January 19, 2011

    1.78 Million Facebook Users May Die This Year (2011)

    Does Facebook really have more than 500 million "active" users?

    According to data from digital-legacy planning firm Entrustet, a big portion of these users will soon no longer be considered "active," by any reasonable measure. The company compared Facebook usership data with average death rates from the Center for Disease Control, and discovered that this year, around 480,000 Facebook users may pass away in the U.S., and 1.78 million worldwide. These figures are only likely to grow year to year, especially as Facebook expands pass the 600 million user mark.



    So many profiles now fall out of the range of an "active" user. Beyond the deceased, there are endless duplicate accounts--Entrustet found that 150% of 20- to 24-year-olds in the U.S. are on Facebook--not exactly a plausible tally. What's more, a recent Gartner report estimated that in the coming years, roughly one in every ten of your friends on Facebook and other social networks will be nonhuman, meaning they'll be "social bots," automated profiles created by brands and organizations to engage consumers.

    Read entire article.

    Thursday, January 13, 2011

    My Favorite Firefox Add-ons

    While there are thousands of Firefox add-ons there are a few I can't live without; in fact, I install most of these on almost every computer I touch.
    • Video DownloadHelper - DownloadHelper is a tool for web content extraction. Its purpose is to capture video and image files from many sites.  Very useful for downloading videos from YouTube or other video sites.
    • Elasticfox Firefox Extension for Amazon EC2 - ElasticFox is a Mozilla Firefox extension for managing your Amazon EC2 account. Launch new instances, mount Elastic Block Storage volumes, map Elastic IP addresses, and more. NOTE: Elasticfox is no longer officially supported by Amazon.  But, thanks to Genki Sugawara Elasticfox-ec2tag lives on and is actively developed.
    • New Tab Homepage - A very simple tabbed browsing extension that loads your homepage when you open a new tab. If you have multiple homepages, the first is chosen.
    • Session Manager - Session Manager saves and restores the state of all windows - either when you want it or automatically at startup and after crashes. It can also automatically save the state of open windows individually.
    • Tree Style Tab - This provides tree-style tab bar, like a folder tree of Windows Explorer. New tabs opened from links (or etc.) are automatically attached to the current tab.
    • Web Developer - The Web Developer extension adds various web developer tools to a browser.
    Honorable mentions.  These are other great Firefox add-ons.
    • Firesheep - A Firefox extension that demonstrates HTTP session hijacking attacks.
    • Live HTTP Headers - View HTTP headers of a page and while browsing.
    • MeasureIt - Draw a ruler across any webpage to check the width, height, or alignment of page elements in pixels.
    • Tab Slideshow - Cycles through tabs as a slideshow.
    • Sothink Web Video Downloader for Firefox - A simple, clean and easy-to-use FREE Firefox extension for video download and Flash download. Supports Windows/Mac/Linux operating systems and the latest Mozilla Firefox 3.
    • User Agent Switcher - The User Agent Switcher extension adds a menu and a toolbar button to switch the user agent of a browser.



    Monday, January 10, 2011

    Install Citrix XenApp 6 Fundamentals Edition for Windows Server 2008 R2

    I get this question all the time, sometimes from random people on the street: "Hey, Powercram guy, how do I install XenApp 6 Fundamentals on Windows Server 2008 R2?" Or "What are the prerequisites for XenApp 6 Fundamentals on Windows 2008 R2?" Or this one, "Can I install XenApp 6 Fundamentals on regular Windows 2008 - not R2?" Or my favorite, "How do I upgrade previous versions of XenApp Fundamentals to XenApp 6?"

    Summary
    • Start with fresh install of Windows 2008 R2
    • NO Windows Updates - NO .NET 4
    • Enable .NET 3.5.1 SP1 (in Server Manager, Add Roles)
      • Other necessary roles will be installed by XenApp installation as necessary
    • Launch installer as administrator
    I've gotten so tired of these questions from strangers I'm going to lay it all out here, and refer people to my blog to answer these age-old questions.  Well, actually the questions are fairly recent as XenApp 6 Fundamentals For Windows 2008 R2 was only released last month - December, 2010.  And, there's the answer to one of those questions - XenApp 6 Fundamentals can ONLY be installed on Windows 2008 R2.  Period.

    Let's back up a little.  The Citrix XenApp 6 Fundamentals Edition for Windows Server 2008 R2 Administrator's Guide is a good place to start and contains some of the information herein.  However, there are a couple things learned only from experience here as well.  This is intended to be a guide to get you started in the right direction, provide some additional info and some things to watch out for.

    First, XenApp 6 Fundamentals can only be installed on Windows 2008 R2, and it must be a fresh install - no upgrades from other Windows versions, and no other version of XenApp can be upgraded to version 6.  I can't stress this enough, you MUST start with a fresh install of Windows 2008 R2.  Oh, and NO Windows Updates.  Namely DO NOT install .NET 4 on this server - XenApp 6 will fail.

    Next, enable .NET Framework 3.5.1.  This can be done in Server Manager, Add Features.  As stated before, DO NOT install .NET 4.

    Finally, insert DVD or launch either autorun.exe or setup.exe (located in W2k8 folder, or XAF_6_0_0_ML_dvd\W2k8 if you just expanded the ISO [XAF_6_0_0_ML_dvd.iso] as I did).  **Make sure to launch installer as Administrator (right-click, Run As Administrator.  If you don't do this the install will fail with a cryptic message referring to the file C:\Users\powercram\AppData\Local\Citrix\<some_citrix_file>.txt with entries saying it failed.  These are the two I had, which I couldn't find anywhere on the 'net:
    • Failed to configure component 'Citrix Licensing'
    • Recording installation failure from component 'Citrix Licensing'
    Additional notes (answers to other questions):
    • If you decide to uninstall for whatever reason you MUST start all over including installing Windows 2008 R2 afresh.
    • You CANNOT upgrade an older version of XenApp Fundamentals to XenApp Fundamentals 6.  You must start with a new installation, then migrate to the new environment.
    • Do NOT install XenApp 6 Fundamentals Edition on a domain controller.
    There seem to be plenty of resources (including the above referenced administrator guide) which have details on the installation from here.  I just wanted to help people get to that point.

    why the xenapp 6 fundamentals edition installer fails