Karabiner custom key mappings for HHKB Pro 2 and Logitech K810 on Mac OSX

Early this year I started using Logitech K810 keyboard on Mac and, more recently purchased an additional keyboard that is popular among picky programmers, HHKB Professional 2 (US key, black). As is often the case for non-Apple-native keyboards on Mac OSX, I needed to modify some key bindings of these two keyboards to enjoy a comfortable coding experience on the Mac desktop environment.

Below is the custom Karabiner settings which I have put in ~/Library/Application\ Support/Karabiner/private.xml. The key bindings for Logitech K810 and HHKB Pro2 do not interfere with each other thanks to the device_only option, so it is okay to enable the options for the both keyboards at the same time. The custom key mappings for K810, if enabled, take effect only while K810 is being used and vice versa.

Combined with these tweaks, my favorite Karabiner key bindings are as follows:

f:id:userafmm:20151021233245p:plain

I can't live a day without these key mappings.

How to quickly upload your Play Framework web app to AWS Elastic Beanstalk

  1. Create your Play Framework application and initialize the project as a git repository.
  2. Install AWS CLI.
  3. Create your elastic beanstalk application environment using the Docker container in the online AWS Elastic Beanstalk Management Console.
  4. Create configuration files (Dockerfile, Dockerrun.aws.json and, optionally, .ebextentions/*.conf) in the project top directory.
  5. Place the following bash script file as aws.sh in the top directory of your play framework application (play-scala).
#!/bin/bash

readonly APP_NAME=play-scala
readonly APP_VERSION=1.0
readonly EB_BUCKET=<name of your S3 bucket to store your app bundles> #e.g., elasticbeanstalk-us-east-1-000000000000
readonly EB_APP=<name of your elastic beanstalk application>
readonly EB_ENV=<name of your elastic beanstalk environment>
GIT_COMMIT=`git rev-parse HEAD`
GIT_MSG=`git log --oneline -1`

production_build() {
    ./activator clean compile universal:package-zip-tarball
}

build_package() {
    cd `dirname $0`/target/universal
    cp ../../Dockerfile .
    cp ../../Dockerrun.aws.json .
    cp -r ../../.ebextentions/ .
    zip -r ../aws.zip Dockerfile Dockerrun.aws.json play-scala-1.0.tgz .ebextentions/
}

eb_upload() {
    cd `dirname $0`
    aws s3api put-object --bucket $EB_BUCKET --key $GIT_COMMIT.zip --body ./target/aws.zip
    aws elasticbeanstalk create-application-version --application-name $EB_APP --description "$GIT_MSG" --version-label $GIT_COMMIT --source-bundle S3Bucket=$EB_BUCKET,S3Key=$GIT_COMMIT.zip
    aws elasticbeanstalk update-environment --environment-name $EB_ENV --version-label $GIT_COMMIT
}

production_build
build_package
eb_upload
  1. Change the variables (APP_NAME, APP_VERSION, EB_BUCKET, EB_APP and EB_ENV) depending on your development environment.
  2. Make the script executable and run it.
chmod +x aws.sh
./aws.sh


Now that the automation script is in place, you can easily upload the latest version of your application to the Elastic Beanstalk production environment by repeating the following processes.

  1. Update your Play application code
  2. git add . && git commit -m "commit message"
  3. ./aws.sh
  4. Open the Elastic Beanstalk Management Console in your web browser: eb console
  5. Wait for a few minutes untill the environment update is completed.
  6. View your latest Play application in production in your web browser: eb open