Thursday, April 28, 2011

Accelerated QRcodes: QRcodes in an Internet Explorer 8 Accelerator

My previous post covered my AWS micro instance producing QRcodes from parameters specified in a URL.

Now its time to put the URL into an Internet Explorer 8 Accelerator.

Check out IE 8 accelerators here

To add my QRcode accelerator go to http://barcode.dyndns-web.com/ie8/qrcode.html

Obviously its my test server and maybe the server will be stopped at some point. See the code at the end of the post and make any changes to other QR code generators.

add the IE8 by clicking on the button "Add Robert Russell's QRcode accelerator to Internet Explorer 8"
(I have not tried it with ie9)

The next screen appears


Click the Add button and the accelerator is installed.

To generate the QRcode for a link, right click on the link and then follow the menu options -
"All Accelerators -> AWS QR codes" , then wait for the preview screen to generate the QRcode of the link.
(selecting the "aws qr codes" takes you a webpage with just the QRcode.)





The Webpage with the IE8 button code.
 <button id="myButton"
  
 onclick="window.external.AddService('http://barcode.dyndns-web.com/ie8/qrcode_ac.xml')">
  
 Add Robert Russell's QRcode accelerator to Internet Explorer 8</button>
  


The XML that adds the accelerator

 <?xml version="1.0" encoding="UTF-8"?>
  
 <openServiceDescription xmlns="http://www.microsoft.com/schemas/openservicedescription/1.0">
  
  <homepageUrl>http://barcode.dyndns-web.com/</homepageUrl>
  
  <display>
  
   <name>AWS QR codes</name>
  
   <icon>http://barcode.dyndns-web.com/ie8/qr.ico</icon>
  
  </display>
  
  <activity category="AWS QR codes">
  
   <activityAction context="link">
  
    <preview action="http://barcode.dyndns-web.com/b.php?">
  
     <parameter name="text" value="{link}"/>
  
     <parameter name="b" value="qrcode"/>
  
    </preview>
  
    <execute action="http://barcode.dyndns-web.com/b.php?">
  
     <parameter name="text" value="{link}" type="text"/>
  
     <parameter name="b" value="qrcode" type="text"/>
  
    </execute>
  
   </activityAction>
  
  </activity>
  
 </openServiceDescription>
  

Wednesday, April 27, 2011

Barcodes in the clouds: aztec code, datamatrix and maxicode

So now I have access again to my own free amazon micro instance

I am in the process of doing 2 things with the AWS EC2 micro instance - barcodes and geocodes.....

Here is the aztec code, datamatrix and maxicodes. I still have to add some more options to the process and will be creating a main web page to control the settings. I will cover this in more detail later but most of the methods I use are available here.

Example URL http://barcode.dyndns-web.com/b.php?b=datamatrix&text=datamatrix%20in%20the%20cloud

http://barcode.dyndns-web.com/b.php?  is the php in the cloud that controls the generation the barcode
b= option sets the barcode and the
text = is the text to encode

Examples below.

Datamatrix


Aztec Code


Maxicode

Sunday, April 24, 2011

AWS EC2: Create a new instance from a snapshot (when you lose your keys)

One small issue due to my work related absence from home is the loss of access to my Mac computer. On this computer I had my private SSH key for my Amazon Elastic Compute Cloud (EC2) instance.



I have a free* micro instance running in the cloud, if you are a NEW signup you can find out more about the  free micro instances here.

I could start my instance and access the apache web server in the cloud however but without my private key I could not connect via ssh :( and therefore not startup my geoserver application or start creating barcodes in the cloud.
Googling the issue and I found some answers but not the full resolution to my situation. So what follows is the way I created
* new key pair
* snapshot of the original volome
* install the command line java tools
* create an AMI linked to the snapshot
* start the instance with the new key
* convert the private key to be used with Putty

The following is based on a Windows XP system.


1) New key pair

From the AWS guide, generating a keypair

To generate a key pair
  1. Log in to the AWS Management Console and click the Amazon EC2 tab.
  2. Click Key Pairs in the Navigation pane.
    The console displays a list of key pairs associated with your account.
  3. Click Create Key Pair.
    The Key Pair dialog box appears.
  4. Enter a name for the new key pair in the Key Pair Name field and click Create.
    You are prompted to download the key file.
  5. Download the key file and keep it in a safe place. You will need it to access any instances that you launch with this key pair.
2) Snapshot of the original volume
To create a snapshot
  1. Click Create Snapshot.
    The Create Snapshot dialog box appears.
  2. Select a volume to make a snapshot of and click Create.
    Amazon EC2 creates a new snapshot, displaying its status in the list of snapshots.

3) Install command line Java tools
Java needs to be installed I have jdk1.6.0_12
The AWS EC2 API tools can be downloaded here http://aws.amazon.com/developertools/351

Unzip the AWS tools to c:\aws

Download the X.509 cert and key to the c:\aws from the following screen.

Create a DOS BAT script with the following contents.

rem sets Java home
set JAVA_HOME="C:\Program Files\Java\jdk1.6.0_12"

rem sets the X.509 private key and cert. (REPLACE {...} with your filenames ).
set EC2_PRIVATE_KEY=c:\aws\pk-{private key details}.pem
set EC2_CERT=c:\aws\cert-{cert details}.pem

rem set EC2 variables
set EC2_HOME=c:\aws\ec2
rem THIS IS ASIA PACIFIC norteast zone for my micro instance, change to your zone
set EC2_URL=https://ec2.ap-northeast-1.amazonaws.com

rem update PATH variable
set PATH=%PATH%;%EC2_HOME%\bin

rem check it works with the describe regions API command.
ec2-describe-regions

4) Create an AMI linked to the snapshot

ec2-register command help url
ec2-register -n {NAME of AMI) -d {description} --root-device-name /dev/sda1 -b "/dev/sda1=snap-xxxxxxxx" -a x86_64 --kernel aki-ba3adfd3

*note -b replace with the snapshot name
          --kernel I used the kernel id from my original instance

After running this command the AMI id will be displayed this is needed for step 5

5) Start the instance with the new key
ec2run command help url
ec2run {AMI id from step 4} -b "/dev/sda1=snap-xxxxxxxx:8:true" -g quick-start-1 -k {NEW KEY} -t t1.micro

*note -b replace with the snapshot name
          -k important to use the NEW KEY created in step 1. (and now I have this in my dropbox lesson learnt)

6) Convert the private key to be used with Putty

use puttygen.exe and chose the conversion option



select the AWS key downloaded in step 1

select save private key and I ignored the warning message.


create a new session for putty and add a reference to the new key

Add a reference to the ec2-user in the session



Save the new putty session and you are then able to log directly onto the new EC2 instance.

Saturday, April 23, 2011

QRcodes in the clouds (free Amazon EC2 micro instance)

Free Amazon EC2 micro instance generating barcodes in the clouds.

Following on from the BWIPP in SAP I am now checking out the amazon cloud services using the BWIPP as an example.

Below using the QRcode as a first example.



Thanks to
Free micro instance from Amazon EC2
Barcode Writer In Pure Postscript

Wednesday, April 6, 2011

PDF24: configure PDF24 to use Barcode Writer in Pure Postscript

For work related reasons I have a number of trips to Germany for the next few weeks/months.

Apart from the joys of using a German keyboard while in Germany I came accross another PDF program called PDF24. It can be downloaded here, PDF24

Alsongside blog entries for cutepdf or and pdfcreator this blog shows the way to include the Barcode Writer in Pure Postscript (from now referred to as BWIPP) with PDF24.

The way to include barcode writer in pure postscript is to use the ghostscript resource process

Download the BWIPP from the download section "Seperate file per named resource" as this is required for the ghostscript resource process.

The current PDF24 2.9.5 version comes with ghostscript version 8.61.

C:\Program Files\PDF24\gs\bin>gswin32c.exe -version
GPL Ghostscript 8.61 (2007-11-21)
Copyright (C) 2007 Artifex Software, Inc.  All rights reserved.


Copy the BWIPP to the PDF24 ghostscript related resource directory. As shown here.



Now all the barcodes from the BWIPP can be used to generate pdfs with barcodes. An example 26 barcode page generated with SAP.


Created with the Barcode Writer in Pure Postscript


For example the PDF24 program could now be used with SAP in place of pdfcreator in my previous blog Barcodes for free in SAP

The general page for BWIPP in SAP is here barcodes in sap with barcode writer in pure postscript


An alternate approach of including the BWIPP in an SAP device type and using cutepdf is demonstrated in the youtube video below.

Google +