Skip to content

Instantly share code, notes, and snippets.

innyso /
Created April 13, 2023 01:42
#keyboard #hhkb #modkey

To make the left control key also an escape

  1. install Karabiner
  2. Search for complex_modifications rules, find somethin glike Change control key
  3. Impact and Enable
innyso /
Last active April 8, 2024 11:58
#hhkb #bluetooth #pairing #keyboard

Reset bluetooth hhkb pairing

- go into system preference > keyboard > setup bluetooth keyboard
- press Fn+q to get into pairing mode (blue light start flashing)
- Fn+crtl then 1 to reset first pairing

innyso /
Last active May 5, 2021 11:32
#linux #cmd #grep #regex

Difference between grep with and without extended-regex

  • by default grep interpret search pattern as basic regular expression i.e. the meta-characters ?, +, |, ( and ) are interpreted as literal, hence need to escape with backslash
  • can pass in extended regular expresson option -E (or --extended-regex) which means it doesn't take the meta-characters literally hence do not need to escape with backslash


# a line begins with hello
grep '^hello' world.txt 
innyso /
Last active January 12, 2021 11:41
#aws #config #cli #assumerole

Setting up aws cli with assume role

Let's say we have a tools account that we login and assume role with

  1. Run aws configure --profile tools and follow the prompt to setup initial aws related configuration files

  2. Open ~/.aws/config and add the following

[profile tools]
innyso /
Created May 9, 2020 08:14
#linux #cmd #watch #color

Display color when using watch

watch --color -n 2 <command>
innyso /
Last active May 9, 2020 08:08
#terraform #tfstate #move

Moving and renaming a resource out of terraform state file

One of my rule of thumb is never touch terraform state file if I want to live a happy life but recently I found myself having to separate a state file into 2. At first I was very irritated because I should've done this in the beginning but what happened, happened so lets deal with it.

With some quick online searching, to my surprised there are some terraform built-in command that can make my life easier.

Let says all the current terraform code are in foo/ and I would like to move out of foo/ to bar/ and also rename the module to module.balloon

Let's get an understand what we currently have

innyso /
Last active May 9, 2020 11:47
#linux #bash #default #variable #script

Default value in bash

# Set COFFEE to latte if there is no input 

# Set SIZE to small when ORDER is not set or null

# Set TOPPING and EXTRA to chocolate when EXTRA is not set or null
innyso /
Created April 26, 2020 09:11
#vim #ultisnips #plugins

How does Ultisnips know which snippet file(s) to load?

In the snippet definition directories, it look for the following patterns:

foo. snippets

where foo is the filetype

innyso /
Last active January 16, 2021 04:27
#linux #process #foreground #background #cmd #bg #fg

Linux foreground background process

Foreground Process

A command or process you run directly and wait for it to complete

Background Process

The shell does not need to wait for the process to end. You can run as many of background process as you want within your system memory limit.

innyso /
Created April 26, 2020 06:36
#nginx #atsign #namedlocation

Recently I need to do some updating for an nginx configuration, beside the fact that I am a bit rusty with my nginx config skills, I also encounter something like this

location @something {
  # ...

Not knowing what this mean, did some quick search and found that this is called a named location and it seems like a good alternative to if-then-else in certain scenario.