Securely Backup Text Files with LastPass CLI

LastPass users who typically interact with their vault via a browser plugin may be surprised to learn of an official command line utility called lpass that provides access to secure items (including notes). See the man page for subcommands and details.

Saving secure notes from the command line is particularly useful for software projects that utilize configuration files that contain sensitive information that should not be tracked in version control but should be securely backed up and easily restored.

LastPass secure notes are versioned and can be securely shared. Using LastPass shifts the responsibility of managing the secured data to a team of professionals who perform regular security audits and if you’re not sold yet, basic accounts are free.

Top

Cloud9 with a Chance of Hugo

Hugo beautifully facilitates the creation of static sites that are cheap to host and trivial to scale. Historically, the trade-off with static blogs has been a clunkier process for publishing new articles. The days of simply hitting “save” in a web browser to update a blog post from anywhere went away for a little while, but AWS Cloud9 is bringing them back.

Cloud9 is a web based IDE that is perfectly suited to managing a Hugo blog in the cloud. The static site source files can reside on any server accessible via SSH, but Cloud9 really shines when backed by an EC2 instance that it manages on your behalf. Persistent files are stored on an EBS volume and the EC2 instance can be automatically stopped after a configurable period of inactivity.

Top

Redirect Custom Short URLs with Lambda

An AWS API Gateway proxy resource can be configured to respond to requests using a proxy integration to invoke a Lambda function.

From Set up a Proxy Integration with a Proxy Resource:

With this integration type, API Gateway applies a default mapping template to send the entire request to the Lambda function and transforms the output from the Lambda function to HTTP responses.

This makes it trivial to implement a redirection function for custom short URLs.

Top

Bundle Lambda Functions Using Webpack

Creating a Deployment Package (Node.js) describes how to create a compressed payload that includes the node_modules folder for Lambda functions that require npm modules.

An alternative to including the entire node_modules folder in the payload is to use webpack to bundle the Lambda function code and it’s dependencies into a single file.

Top

Ship Access Logs to CloudWatch

If an S3 bucket or CloudFront instance has access logging enabled, the logs will be delivered as plain text files to the designated target bucket.

Having access logs split into many files in an S3 bucket is not inherently useful but presumably Amazon takes this approach for the flexibility of processing options it affords. Downloading the logs to a local machine for analysis is a bit inelegant; since the logs are already “in the cloud” it is preferable to access them in a searchable manner via a web browser. CloudWatch is a product seemingly tailor made to solve this problem but unfortunately there is no turnkey solution to import access logs from S3. Luckily, it’s not too difficult to roll your own.

Top

Generate Yearly and Monthly Archive Pages with Hugo Sections

This blog, which is now generated with Hugo, uses the permalink structure /:year/:month/:slug (the slug is a url-safe version of the title). There are also “archive” pages, which list the articles posted in a given month or year. These pages have a permalink structure that compliments the post permalinks: /:year/:month and /:year respectively.

Back when this blog was generated with Jekyll, I used a plugin to generate the archive pages but there is no such mechanism in Hugo. It is possible to use taxonomies to accomplish this, but it involves defining a taxonomy for each year in the Hugo config, creating a corresponding layout and also adding redundant frontmatter to each post.

As an alternative, I created 2 new “sections” (top level subfolders in the content folder): archy and archm. archy contains one file per year and archm contains one file per month. These files can be generated automatically (see below).

Top

Write Your Own Coda Plug-In

My love for Coda knows no bounds. Except maybe the bounds of the tab bar.

One especially sprawling project at work brought the problem to a head: switching between all the files had simply become too tedious. Rather than desert Coda (perish the thought) I decided to whip up a plug-in called Wing Man. Panic has a pretty good how to on the basics of plug-in building so I won’t rehash all of that here.

Top

Debian: Beep at Login Prompt

A spare PC that’s been kicking around my apartment recently got a fresh dose of Lenny.

As a headless machine, it’s handy to have the system beep when it reaches the log in prompt to announce that it’s ready to accept SSH connections.

Top

Stop Remote Desktop from Locking the Host

Closing a Windows Remote Desktop connection leaves the host machine locked, but it is possible to create a shortcut that will close the session without locking the screen.

Top

Google Voice + Fluid (SSB)

Google Voice Icon
Google Voice Icon by malabooboo

Google Voice is the eighth wonder of the world.

Mac users lucky enough to have secured an invite might consider creating a Fluid site specific browser to carve out some space for Google Voice on the Dock.

An SSB is quite useful in itself, but even more so when a few CSS tweaks are applied.

Top