Skip to content

Instantly share code, notes, and snippets.

@amiorin
amiorin / README.md
Last active April 25, 2024 21:54
How to configure Home Row Mods with KMonad on macOS

Intro

Karabiner and KMonad are great open source software. Don't forget to support the authors and contributors.

If you want to try home row mods on OSX, don't use Karabiner but KMonad. KMonad is harder at the beginning but then it is easier than Karabiner. Creating layers in KMonad is trivial and without drawbacks, while it is impossible in Karabiner without drawbacks.

You need to compile a PR of the project. Install https://github.com/pqrs-org/Karabiner-DriverKit-VirtualHIDDevice/releases/download/v2.1.0/Karabiner-DriverKit-VirtualHIDDevice-2.1.0.pkg

@amiorin
amiorin / rule.json
Created May 3, 2020 14:39
Change command + h/j/k/l to Arrows in Intellij and PyCharm
{
"title": "Vi Style Arrows",
"rules": [
{
"description": "Change command + h/j/k/l to Arrows",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "h",
@amiorin
amiorin / hive-site.xml
Created October 2, 2019 21:21
EMR settings
[
{
"Classification": "hive-site",
"Properties": {
"hive.users.in.admin.role": "amiorin,hive"
}
}
]
@amiorin
amiorin / hit.sh
Created October 5, 2017 15:27 — forked from pesterhazy/hit.sh
hit - git-style interface for project helper scripts
#!/usr/bin/env bash
set -euo pipefail && cd "$(dirname "${BASH_SOURCE[0]}")/.."
# hit - git-like command dispatcher. Who needs Makefiles?
#
# Create a directory `bin/` at the top level of your project
# directory (the one committed to git). Copy this file into
# that folder, call it `hit` and make it executable.
#
# Type `bin/hit NAME` to run a subcommand called NAME. Subcommands
@amiorin
amiorin / s3-curl-backups.md
Created April 10, 2017 13:52 — forked from jareware/s3-curl-backups.md
Simple, semi-anonymous backups with S3 and curl

⇐ back to the gist-blog at jrw.fi

Simple, semi-anonymous backups with S3 and curl

Backing stuff up is a bit of a hassle, to set up and to maintain. While full-blown backup suites such as duplicity or CrashPlan will do all kinds of clever things for you (and I'd recommend either for more complex setups), sometimes you just want to put that daily database dump somewhere off-site and be done with it. This is what I've done, with an Amazon S3 bucket and curl. Hold onto your hats, there's some Bucket Policy acrobatics ahead.

There's also a tl;dr at the very end if you just want the delicious copy-pasta.

Bucket setup

@amiorin
amiorin / S3Puller.scala
Created August 8, 2016 15:22 — forked from pjrt/S3Puller.scala
S3 List Status ad-infinitude
import com.amazonaws.services.s3._, model._
import com.amazonaws.auth.BasicAWSCredentials
val request = new ListObjectsRequest()
request.setBucketName(bucket)
request.setPrefix(prefix)
request.setMaxKeys(pageLength)
def s3 = new AmazonS3Client(new BasicAWSCredentials(key, secret))
val objs = s3.listObjects(request) // Note that this method returns truncated data if longer than the "pageLength" above. You might need to deal with that.
@amiorin
amiorin / proxy.pac
Last active December 21, 2018 14:39
function regExpMatch(url, pattern) {
try { return new RegExp(pattern).test(url); } catch(ex) { return false; }
}
function FindProxyForURL(url, host) {
// Important: replace 172.31 below with the proper prefix for your VPC subnet
if (shExpMatch(url, "*172.31.*")) return "SOCKS5 localhost:8157";
if (shExpMatch(url, "*saiki.zalan.do*")) return "SOCKS5 localhost:8157";
if (shExpMatch(url, "*ec2*.amazonaws.com*")) return 'SOCKS5 localhost:8157';
if (shExpMatch(url, "*.compute.internal*") || shExpMatch(url, "*://compute.internal*")) return 'SOCKS5 localhost:8157';
<?xml version="1.0"?>
<root>
<item>
<name>PageUp/PageDown to Right/Left</name>
<identifier>remap.pagetocursor</identifier>
<autogen>__KeyToKey__ KeyCode::PAGEUP, KeyCode::CURSOR_LEFT</autogen>
<autogen>__KeyToKey__ KeyCode::PAGEDOWN, KeyCode::CURSOR_RIGHT</autogen>
</item>
</root>
/**
* Required Variables.
*/
variable "name" {}
variable "port" {}
variable "elb_security_group" {}
variable "elb_subnets" {}