Skip to content

Instantly share code, notes, and snippets.

@innyso
innyso / watch_with_color.md
Created May 9, 2020 08:14
#linux #cmd #watch #color

Display color when using watch

watch --color -n 2 <command>
@innyso
innyso / aws_cli_config.md
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
innyso / grep_regex.md
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

Anchoring

# a line begins with hello
grep '^hello' world.txt 
@innyso
innyso / hhkb_reset_bluetooth_pairing.md
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
innyso / hhkb_mod_control_escape.md
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