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
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
To make the left control key also an escape
Change control key
?, +, |, ( and )
are interpreted as literal, hence need to escape with backslash-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
Code snippet for how to use jinja2 with file as an input for template.
from jinja2 import Environment,FileSystemLoader
env = Environment(loader=FileSystemLoader('files'))
template = env.get_template('somefilename.sh.j2')
output = template.render(name='elmo')
print output
Check if a command exist in Makefile
LS := ; @which ls > /dev/null
ifndef LS
$(eval ls := $(shell which ls))
else
$(eval ls := something/ls
endif
In hiera, when encounter a percentage symbol, it will try to interpolate it. In order to stop it from happening, make sure you quote the value
TIME_FORMAT: '%d/%m/%Y %H:%M:%S'
Prepend timestamp to command
command | ts '[%Y-%m-%d %H:%M:%S]'
Insert the result of a command to the current file:
# insert result of ls to current file
:r !ls
where
:r --> :r file Read contents of a file to the workspace