Please goto my new blog on GitHub Pages
Creating QR codes on Python
Posted by Alec The Geek on 28 April 2013
If you want to create you own QR code then here is a simple Python script that will create PNG images for you.
First you need to install the Python Image Library and QR Code library. On my OS X system that was easy
$ pip install qrcode
Then you can create the following simple Pyton script.
#! /usr/bin/env python
import sys
import qrcode
qrcode.make("".join(sys.stdin.readlines())).save("/dev/stdout","png")
It reads any text from it’s standard input and writes a graphic image to the standard output. So you can do this
$ echo" 'My QR Text'|makeQR > myqr.png
Posted in Python | Comments Off
Handy Hack: Mount smbfs on OS X
Posted by Alec The Geek on 3 December 2012
I have a series of SMB shares that I mount manually when I’m at the office and I had written a helper script that used the OS X open command to mount the file systems. This worked fine and the credentials were stored in the Key Chain to no further action was required. However the open command then open a new OS X Finder window and destroyed my command line fu — I had to flip back to my iTerm2 window which was irritating me each time.
The alternative was to use the mount command, which was documented to support a -N option to read credentials from ~/Library/Preferences/nsmb.conf. However I could not get this to work and it appears that many other people had problems.
It is easy to use the mount command and supply the credentials as follows
mount -t smbfs //$user:$password@$server/$sharename /Volumes/$sharename
With the appropriate values and the /Volumes/$sharename directory already created. So I wipped up a quick script so make it all automatic.
Handy Hack for Git refugees in Subversion land
Posted by Alec The Geek on 23 November 2012
When you’re a Git user working on a project using Subversion (SVN) using the Git SVN client is a great option, I’ve been using it for the last twelve months and it works really well. However sometimes it’s not quite good enough when things like Ant scripts are written for SVN.
My colleagues use TortoiseSVN. which among other things provides support for standard commit message templates. This uses a SVN property called “tsvn:logtemplate“, is a specific feature of ToirtoiseSVN and it not standard in the SVN client. Git has a simliar feature using the config value commit.template and it’s standard on the git client.
Today I wrote an svn wrapper script to provide the standard template feature to the command line SVN client. You may find it useful. It’s written for OS X and assumes you have Git configured and SVN Installed via Mac Homebrew — however it will be trivial to modify it for your environment,
The script does does a number of things:
- It passes all SVN sub-commands, except commit, to svn without change
- It checks all the arguments to if the commit message has already been supplied (run the command and exit)
- It checks to see if the ”tsvn:logtemplate” is set
- If the TortoiseSVN template is not set then it attempts to find the Git template
- If that fails then it falls back to an internal template
- The template is placed in a file and another message file
- The user is prompted to edit the message file
- The updated message file is checked against the template — if the user has not made a change the commit is aborted
- The svn client is called with the message file.
Updated March/2013 – Somehow an stupid bug crept in. Now squashed.
Updated Jan/2013
I have added a new feature when using svn update:
- Check if the working copy has uncommitted changes. NB Files that are not registered are ignored in this check
- Abort the
updateif files are already modified
YMMV
Posted in Git, LinkedIn, Mac, Open Source Software, Software Development, Work Practices | Comments Off
The last generation of personal computer users and Orwellian future
Posted by Alec The Geek on 23 June 2012
The trend to towards the post personal computer age gathers pace and I can’t help but feel a little apprehensive. For those who have been missing the current bruha here is the short version
- For the last few decades owners have been able to control what they put on their computers and how they use them. They could even get code written for their specific need
- In the new world devices are locked down by the vendor. You can only install their operating system, approved applications from their distribution channels and only consume their partners media. Most people will be happy as it will be a simpler stress free experience. So a large market for open personal computers disappears
- Governments will increase their control on the information disseminated through the internet, the advent of national fibre networks with a single choke point wil make this a lot easier
- Corporations will deploy their line of business applications via the cloud to desktop and mobile. The’ll be happy with the cost savings and improved security and this removes the second major market for open personal computers
So what price engineering expertise and personal liberty?
Posted in Open Source Software, Personal Opinion | Comments Off
Top Tip: “”Bad URL passed to RA layer: Unrecognized URL scheme for:” when running git svn
Posted by Alec The Geek on 24 March 2012
If you are getting the above problem try installing Subversion. If you are using homebrew for OS X then make sure you install package svn, not subversion.
Posted in Git, Mac, Open Source Software, Software Setup | Comments Off
Cool things at the Melbourne Maker Faire
Posted by Alec The Geek on 14 January 2012
I’m at the Melbourne Maker Faire and a few cool things have caught my eye:
- the FreeRTOS for Arduino — and @fei_li_pu has persuaded me to take another look at Eclipse as an AVR development environment
- Cool wooden journal covers from the Beehive
- the MHV Arduino board
- Up! 3D Printer — shame about the price and lack of Linux support though
- @legopoerty
- the Range of stuff from Freetronics. I hope they support the Raspberry Pi when it comes out
There was also lots of other cool things, steam punks, crafters, Smart Energy Group and so on. If you missed it hard luck.
Posted in Education, Open Source Software, Uncategorized | Comments Off
2011 in review
Posted by Alec The Geek on 1 January 2012
The WordPress.com stats helper monkeys prepared a 2011 annual report for this blog.
Here’s an excerpt:
The concert hall at the Syndey Opera House holds 2,700 people. This blog was viewed about 29,000 times in 2011. If it were a concert at Sydney Opera House, it would take about 11 sold-out performances for that many people to see it.
Posted in ego | Comments Off
Top Tip: Running Perl Regex Coach on OS/X
Posted by Alec The Geek on 16 November 2011
(updated Mar/2012)
If you’ve used the excellent Regex Coach for Perl programmers on Windows but have been dissapointed that the current version does not run on Mac OS/X, fear not. You can build Wine and then it runs well.
- Install HomeBrew
- Run the command
brew install wine && brew install winetricks && winetricks vcrun2005 - Download the Regex Coach installer
- Run the command
wine regex-coach.exeto install - To run Regex Coach run the command
wine ~/.wine/drive_c/Program\ Files/The\ Regex\ Coach/The\ Regex\ Coach.exe
The equivalent process also works for the Linux
Posted in Mac, Open Source Software, Perl | Comments Off
Setting up test printing on a Mac using CUPS-PDF
Posted by Alec The Geek on 9 November 2011
In my new job at PaperCut Software I do a lot more testing of print jobs and I’ve found the following useful for saving trees. Note that this actually creates a PDF printer device on the Mac, this is different the PDF option displayed on the standard OS/X print dialogue.
- Download and install the Mac CUPS-PDF package
- Create a new printer, as a generic colour postscript device
- You can now create print jobs from the command line as any user with the following
su - testuser -c 'lpr -P cups_pdf /etc/group' - You can check the output in
/Users/Shared/CUPS-PDF
Posted in Mac, Software Setup | Comments Off
Application or IT Environments Management
Posted by Alec The Geek on 17 August 2011
Note from Alec: I’ve copied this article here in case the original version disappears.
Author: Valentine
Application or IT Environments Management service will fall under Application Management as defined in ITIL2 (operational guidance) because it contributes to improving the overall quality of IT Software development and support through the lifecycle. Application Environments Management set encompasses a set of best practices proposed to provide an effective, end to end management service for test software platforms or development environments. The software test bed or development environment could consist of a client server application, Relational Database Management System (RDBMS), middleware, interfaces, daemons, customised processes (written in any software programming language), FTP utilities etc.
Functional test phases such as Unit, Integration, Acceptance, all manner of performance or non functional testing and development phases all require Application Environments.
The primary clients of an Application Environments Management service are Software Project and Test teams.
The service will cater for the following;
- Manage the creation, build, upgrade and support for all test and development Application Environments.
- Clearly defining auditable processes of allocating application environments, multiple bookings or shared usage, code upgrades, service level agreement, support, decommissioning and re-allocation.
- Manage data refreshes, collating test data and assist in the anonimising of production or other sensitive data if necessary.
- Supply, provision and manage all Application Environment Requirements from the Project and Test teams all through the software development cycle of a project.
- Assist the Project in establishing their application environment requirements, provide expert knowledge on the APPLICATION environment’s set up, connectivity and serve as a guide to the projects in using the application environment in the most efficient manner.
- Review and contribute to the Project Initiation Document (PID) ensuring that the IT Environments Management function and its deliverables are clearly defined and captured.
- Create and maintain project plans to assist in managing all activities required to successfully carry out major code upgrades to all application environments.
- Provide reports on usage/utilisation, availability, forward planning and schedules.
Application Environments Management is clearly a new and emerging area which has arisen due to the following reasons:
- The increased Application Environment requirements for many companies who have several software projects running at any one time.
- The increased levels of interfacing and connectivity between several systems in most organisations also known as spaghetti. For example in some companies more than thirty systems are interfaced or connected with each other exchanging files and data flows etc and has meant that any changes to one system most times could require a change to many others and then require large numbers of test and development application environments.
- Increased awareness and more commitment to carrying out rigorous software testing especially with more companies opting to use the Prince 2 methodology and ITIL Framework
A typical Application Environments Management tool should be able to provide the following services: environments bookings and allocation, manage multiple bookings and re-curring bookings. Provide reporting on usage, availability, interconnectivity or interfacing environments, utilisation and conflict reporting etc. It must also serve as a repository of all information on an Application Environment to include Host Server names, Hardware Type, Operating System, IP Address and Interfaces if any.
The ideal background for an Application Environments Management personnel could be Software Development, Application or Technical Support, Infrastructure Project Management, Configuration and Release Management etc but must be
exposed to at least the ITIL Framework, Client – Server development, System Architecture/Design, Networks, TCP/IP and Messaging systems etc.
Terminologies defined & explained:
Application Environment – A single test bed or development platform instance of a software application or system that can also be used for all manner of functional and non functional testing or could be the production instance (production environment). It could also be large, medium or small which normally refers to the size of data the RDBMS will be holding depending on the type of testing it is required for.
Integrated Application environments (also known as stripes): More than one application environment connected to each other also communicating with each other and exchanging files and data flows. Connections could be via Microsoft ODBC, via FTP, TCP/IP, daemons, middleware, defined interfaces and database links etc.
Anonimising of data
Anonimising of data refers to the manipulation or transformation of production data held in the RDBMS such as Oracle, SQL Server, Sybase, Microsoft Access, DB2 etc to be used in a test or development Application Environment ensuring that for example real names, addresses, date of birth, bank account details and other sensitive information or data is transformed to dummy data.
The data is transformed whilst still maintaining its defining characteristics in a Relational Database Management System table such as character length (Char 25 or Varchar 50) etc to ensure its usage in testing or development is not compromised and that the integrity is maintained. For example a valid name such as John Smith defined as Char 10 will now be updated in the table to become possibly a unique character string XXXXXXYYYY (comprising of ten characters including the space between John and Smith).
Pipe cleaning
Pipe cleaning caters for the all the activities required to be carried out before a test or development environment is handed over to the Test or Project team and includes disk clear down, archiving and purging logs, importing test data, killing off rogue processes, resetting passwords, changing environment settings, end to end connectivity or integration tests to make sure everything is working okay.
Depending on the complexity of the system a checklist of activities may be required and ticked off capturing all the checks and tests that have been completed on an environment or an integrated suite of environments prior to its hand over to a Project or Test team.
Smoke Test
A smoke test describes an initial end to end test of all the integrated or even stand alone environments very possibly using dummy data and carried out by the support teams who have created or built the environment or by the test team when the environment is handed over.
Article Source: http://www.articlesbase.com/information-technology-articles/application-or-it-environments-management-2884860.html
About the Author
- Freelance IT Environments Manager & Technical Project Manager
- Previously Global FX technology manager at Citibank International
- Worked in several sectors to include energy, utilities, Investment banking, railway transport, software development, healthcare, manufacturing, research, insurance and the gaming sectors.
Posted in Application Lifecycle Management, Change Audit, Configuration Audit, LinkedIn, Project Management, Software Configuration Management | Comments Off
Have a *nix sh script put itself into the background
Posted by Alec The Geek on 24 February 2011
In the Unix Bourne style shell languages (e.g. sh, bash, ksh etc) you can put a long running command (or another script) into the background so that control returns to the user. The original idea is that you can perform other work whilst the background process continues. This is achieved by adding a &, for example $ myVeryLongRunningCommand and options >/tmp/myOutput &.
It would be nice to be able to have scripts place themselves in the background, when appropriate, without the user having to worry about and I assumed there would be a “shell’ish” way to do that — however I couldn’t find anything so I knocked something up in a hurry. I put it here for future generations and in the hope that improvements will be suggested.
#! /bin/sh if [[ "$_myBackGround" != "_backGroundFlag" ]]; then nohup /bin/sh -c "_myBackGround=_backGroundFlag; export _myBackGround;$0 $*" > /tmp/$0.$$.stdout 2> /tmp/$0.$$.stderr & echo $0 passed to background with arguments "$*". NB stderr is /tmp/$0.$$.stderr and stdout is /tmp/$0.$$.stdout exit fi # Your script goes here e.g. echo hello: My arguments are $0 $* echo Hello -- this is an error >&2
Posted in Linux | 2 Comments »
Setting up a Perl development environment
Posted by Alec The Geek on 11 December 2010
Here are my suggestions on how to set up your Perl development environment:
(NB If you are a Perl novice then start here)
- Install a copy of Perl
- Windows: Strawberry Perl
- UNIX developer with a Windows desktop? Use Cygwin
- Linux: Your distro should have Perl. See here for some suggestions on installing CPAN modules
- UNIX: I built my own and manually installed the modules. Easier than it sounds.
- OS/X: Comes with Perl
- Download a copy of the Perl Documentation and create a convenient shortcut
- Configure your favourite editor for Perl. There are some guidelines on Perl.net
- A decent version control tool (I use Git)
- Install PerlCritic, Perltidy, Devel::REPL, Module::Starter::PBP, GetOpt::Long and RegEx Coach
- Depending on the work you do consider the following modules as part of your ‘base’ kit:
- Run “
perl -MModule::Starter::PBP=setup” and accept the defaults - Modify the templates used by your editor and Module::Starter so that .pl have the following additional code:
# Main program Entry point sub main { use Getopt::Long qw(GetOptionsFromArray); # TODO Add options variables here # GetOptionsFromArray(\@_, #TODO Add option processing here #); #TODO Add application code here } return main(@ARGV) unless caller(); 1; # So we can treat this as a module for test purposes
Use:
- Have the local Perl docs open in your browser — there is a build in search engine
- Test perl assumptions about how Perl will behave by using Regex Coach and re.pl (re.pl runs from a terminal)
- Write your script (and modules) as a set of subroutines that you can test using Test::More and it’s siblings. You can test script subroutines by writing test scripts in the normal fashion and then running prove with the command line options “
-I ./lib -I .“ - Get good with your editor
- Use the branching feature of your version control tool to manage features (you are using Git right?)
- Don’t be afraid to refactor and fix stuff as you discover issues with previously written code
Caveats: This is based on my personal experience and preferences. Use it as a starting point only. I currently use Perl on Cygwin, Solaris and Linux with the Vim or vi editor. I tend to hack data munching scripts and I don’t use OO programming. YMMV.
Posted in Open Source Software, Perl, Software Development | 8 Comments »
My presentation on software process improvement
Posted by Alec The Geek on 4 December 2010
I recently gave a new presentation on Improving Software Processes at OSDC 2010 in Melbourne, AU
Posted in Application Lifecycle Management, Change Audit, LinkedIn, Open Source Software, Work Practices | Tagged: linkedin | Comments Off
My 43 Folder Tickler File
Posted by Alec The Geek on 28 October 2010
In the parlance of Getting Things Done, a Tickler File consists of a series of 43 file folders: 12 monthly and 31 daily folders. Items are filed in a folder corresponding to when the item will need to be handled, thus reminding or “tickling” the user about it. These items might be action reminders, bills, receipts, reports, letters, or any number of other things.
I’ve been wanting a 43-folder tickler file for some time, however hunting in the stationary stores was proving fruitless until I discovered that you can buy dividers printed with 1-31 and Jan-Dec. With a cheap A4 binder, some clear plastic pockets and a pad of PostIt notes I have what feels like a very practical tickler file.
Setup: (assume today is the 5/Oct and we will not be using the tickler for today’s items)
- Throw away the cover index sheets on both sets of dividers
- Take the month dividers and place Jan-Sept behind Oct-Dec (so they are in the sequence O-N-D-J-F-M-A-M-J-J-A-S)
- Place the month dividers in the folder
- Take the 1-31 dividers and remove 1-4.
- Place 5-31 in the binder, in front of October
- Place 1-4 between October and November. The dividers are now in the sequence 5-31-O-1-4-N-J-F-M-A-M-J-J-A-S
- Add the empty pockets
Daily use (using 6/Oct as an example):
- Open to today by placing finger on number 6 and opening. Now divider with 6 is on right hand side and back of the divider for 5 is on left. This is today’s space. Process an items that need to go into the action list, calendar etc.
- Now process in-boxes etc. Suppose we locate an item that requires action on 10/Oct: Write a PostIt note (add today’s date) and stick onto back of divider for 9/Oct so that when we open the 10th it will be seen. Is there a piece of paper instead? Use a clear pocket to place it in the correct location.
- Place ATM slips, Credit card slips etc into the pocket for the following Sunday weekly review
- Flip back to the 5th (so the 5th appears on the right, back of the 4th on the left). Process any items.
- Remove divider for 4th and place behind divider for 3rd. Place pocket in back of binder.
Weekly review:
- Process as daily and additional review processing (for transaction slips, incubation decisions, project review etc)
- Add pocket and possibly a marker to date for next review ready to receive transaction slips and other material for weekly review
I assume processing for end of month is obvious?
This format is actually quite compact and can even be put in the suitcase when travelling
Powered by ScribeFire.
Posted in GTD, Work Practices | 1 Comment »
Using the Khan Academy effectively
Posted by Alec The Geek on 30 September 2010
The Khan Academy is a great resource for learning maths and science. There are a few tricks when you start using the site and here are the things I’ve discovered over the last couple of weeks using the site with my daughter.
Posted in Education | Comments Off
OSDC AU 2010: Get your papers in!
Posted by Alec The Geek on 4 August 2010
Updated 12/Oct/2010 — This proposal has been accepted so I hope to see you at OSDC 2010
The request for papers is up at The Open Source Developers Conference AU so get your ideas in. Here is my proposal for this year Read the rest of this entry »
Posted in Application Lifecycle Management, ego, LinkedIn, Open Source Software, Project Management, Software Configuration Management, Software Development, Work Practices | Comments Off
Handy Hack: Pass podcasts from Liferea to Rhythmbox
Posted by Alec The Geek on 18 July 2010
I’ve started using a plain RSS reader (Liferea) to subscribe to podcasts. It’s nice to have my feeds in one interface. I’ve written s small script to hand the RSS enclosures to Rhythmbox (just supply the name of the script when prompted by Liferea)
#!/bin/sh for i in "$@" ; do if test -f $i ; then /usr/bin/rhythmbox-client --play-uri=file://$(cd $(dirname $i) ; ls -1 $(pwd)/$(basename $i)) else /usr/bin/rhythmbox-client --play-uri=$i fi done
Suggestions for improvement welcome
Posted in Linux | 3 Comments »
Good habits are worth cultivating
Posted by Alec The Geek on 10 July 2010
Twitter / Amanda Palmer: “Habit is the death of vis …
“Habit is the death of vision.” – Earon Davis
A short sound “bite” that is actually less useful than it looks. It should say something a little less pithy like “Poor habits can be the death of many valuable resources like time, energy and growth. Uncritical, habitual, thinking is the death of vision”. However the value of cultivating good habits has been know for millennia
“We are what we repeatedly do. Excellence then, is not an act, but a habit.” – Aristotle
So the trick is adopt good habits and unlearn the bad ones.
How to uncover bad habits:
- Try and be conscious of what you do at all time
- Ask the people around you (family, close colleagues, friends)
- Keep a time log
- Film yourself using your PC with a webcam
- Review your day and consider what could have been better (the rule of threes — note three things that were good and three things that need to be improved)
What are some examples of bad habits:
- Procrastination
- Snacking on junk food
- Worrying about other peoples opinions and using what you guessed they thought to be beat yourself up
- Thinking that your state of mind is dependent on others peoples’ actions instead of it being your responsibility
- Being critical of other people and concerned with what they do when it has no direct affect on you
- Dwelling on missed opportunities and thinking “if only….”
- Picking your nose, not covering your mouth when you cough etc.
- Worrying about things without being able to use the thoughts to improve the outcome
Here some some suggestions for good habits:
- Review your habits and look for improvements
- Get enough sleep
- Get up early enough to make full use of the day
- Know what you need to do and get it done (people write books on that, I used their ideas and wrote a post)
- Love and like as many people as you can
- Shower daily, clean your teeth and wear clean clothes
- Set yourself goals to learn or experience new things
- Help others as much as you can
- Ask for help if you need it
- Smile and be courteous – remember most things that people do which annoy you are mistakes or bad habits, not deliberate attempts to upset you, you are not that important.
- Plan and think things through, then don’t dwell on them in a negative spiral of worry
- Look after yourself
How to unlearn bad habits:
I struggle with this, as do most people, and I’m not a psychologist so the advice is a bit mundane
- Elastic band on the wrist – ping yourself when you catch yourself doing it
- Ask friends to remind if they see you doing something
- Substitute. e.g. carry fruit and veg to eat instead of buying chocolate
- Try and make the habit redundant. e.g. Plan projects so that you feel in control and can stop worrying about them
- Remove triggers. If certain places or activities trigger a bad habit then try and avoid them
- Give yourself some credit and don’t do it all at once
- Try and look at the root cause when you catch yourself. e.g. are you procrastinating because you think you won’t succeed? Are you not planning because your system is too complicated to use?
Finally
Use tools and techniques that support your good habits e.g. mind mapping tools to help you brainstorm improvements. Make sure they work for you.
Powered by ScribeFire.
Posted in GTD, Personal Opinion, Work Practices | Comments Off
Starting study for RHCE
Posted by Alec The Geek on 20 June 2010
I’ve mentioned a couple of time that I planned to study for my RedHat Certified Engineer qualification. As I’ve now cleared the decks a bit I been able to start the process. So far I have:
- Bought the book
RHCE Red Hat Certified Engineer Linux Study Guide (Exam RH302) : McGraw-Hill Professional Online Book Store - Set up a CentOS (a RedHat Enterprise Linux compatible distro) instance on my laptop using VirtualBox
More Notes to follow
Posted in Education, EEE PC, LinkedIn, Linux, Open Source Software, Software Setup | 1 Comment »

![[FSF Associate Member]](http://static.fsf.org/nosvn/associate/fsf-10505.png)