Local Hugo Deploy S3

Before I jump to an automated GitHub -> S3 deployment for Hugo, I needed to get hugo deploy working for me locally to write changes directly to S3 once I’m happy with a post. I’m a little paranoid about AWS credentials for obvious reasons, so for local work, I like to have specific profiles in my ~/.aws/credentials file. These look like :

[hugo]
aws_access_key_id=c3VwZXIgc2VjcmV0IHVzZXI=
aws_secret_access_key=SSdtIG5vdCB0aGF0IHN0dXBpZAo=

Where the given user Hugo has specific access only to the S3 bucket being published to along with the ability to invalidate a cloud front distribution.

Importing Blogger to Hugo

I have a bunch of historic content that I created on Blogger many years ago.

The vast majority of it is about devices and technology that are long since out of use for me (ant and Zaurus PDAs anyone?). However, on the off chance that anyone is interested in the excitement generated by wonders such as Skype incoming phone numbers back in 2005. I have migrated the content over to Hugo.

Starting With Hugo

I’ve been avoiding posting blog content for a while, in fact it’s been a very long while. Initially, this was due to my previous employment, and now having served a years garden leave it feels like it would be worth updating a few things here in the blog.

Heads up to @jbstans for reminding me that Hugo existed, so this is a little attempt at moving away from Blogspot to something more appropriate for me.

Alfred/iTerm/ssh

I’m a very happy Alfred and iTerm2 user on OSX.

I spent 30mins last night writing an Applescript Alfred extension to help me launch new tabs directly into iTerm and execute the ssh command directly. This means if you have ssh keys setup then it means a simple Alfred command can launch a new ssh session in a new tab in iTerm.

Applescript for the extension :

-- change this to ssh you want to run  
set myCommand to  "ssh -i /Users/goul/keys/myspecialkey.pem ec2-user@my.host.name"  
  
  
-- this will send it to iTerm  
tell application "iTerm"  
	activate  
	set myterm to (current terminal)  
	-- talk to the new terminal  
	tell myterm  
		set mysession to (make new session at the end of sessions)  
		-- talk to the session  
		tell mysession  
			-- set some attributes  
			exec command myCommand  
		end tell  
	end tell  
end tell

CURL Post a file in json format

I keep having to look this up, so putting it here ought to save some time. When attempting to post a block of JSON to a web service the Curl incantation is :

curl -X POST  -H 'content-type: application/json'  -d @myjsonfile.txt http://some.url/param

Alfred App + RTM

A month or so ago I raved about Alfred App and how impressed I was with it. I’ve also been a long time user of Remember The Milk to keep lists of the things I should be doing.

The good folks over at Ruk have shown how to bring these two worlds together using a Ruby command line script. This now means entering a TODO/reminder can be as simple as :

Alt+Space
r Mail Jim about bulk purchase rates of hamsters ^Wed 9am

This really helps my flow through the day - things that would have become interruptions can be quickly added to the TODO list without any real context switch.

IPad2 Xoom Initial development with PhoneGap

After a year of envy of my better half having an original iPad, I was lucky enough to pick one up about ten days ago. In this time its already become my go to device for a bunch of scenarios and I’m delighted with it.

With my professional hat on, we have been asked to take a look at building some tablet based applications. Much as I love my IOS based device, Apple keep a very tight reign on whats happens on that platform so I wanted to show the client alternatives.

Alfred App

I’ve been a long time user (3+years) of Quick Silver as a task launcher and general tool for keeping hands on keyboard rather than a mouse.

Around 6 weeks ago I decided to trial Alfred, Quick Silver got uninstalled about an hour later. Alfred lets you launch applications, web search, find local docs, open recent files etc etc with amazing ease. If you own a Mac, go try the free version either from http://www.alfredapp.com/ or the Apple Store. Once you are hooked go spend a few pounds to get the PowerPack and support an independent developer who is doing a great job.

ITerm2 - Growl Notification

As a heavy user of the Mac command line toolset, I spend a lot of time logged into remote machines. I’ve been an avid ITerm user for a long time, it allows me to have radically different looking consoles for QA/EA/Production machines.

I was reading  http://aming-blog.blogspot.com/2011/01/growl-notification-from-iterm-2.html on changes in ITerm2 to allow console commands to use Growl Notifications (including from remote machine). Typical use case would be a large data import/build etc - followed by growl telling you he jobs complete.

Static Hosting Using S3/AWS

We have been gradually moving large amount of our managed and internal services to AWS. EC2/RDS make for a very compelling model. As a software/consultancy house using these services let us concentrate on our core competencies. The benefit of no longer sitting waiting for hardware to fail and ruin someones weekend is hard to beat.

For those wanting to dip a toe in the water, Amazon now support S3 as a static website. i.e. you can link an S3 “bucket” to being a static website. Announcement blog post is here - it boils down to uploading the content to S3 and then pointing a CNAME at it.