Skip to content

Instantly share code, notes, and snippets.

View icve's full-sized avatar

Roy Cai icve

  • Sydney, Australia
View GitHub Profile
@icve
icve / pubkey.txt
Created March 15, 2020 03:58
my pub key
# Runner
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC0L/w0NruR9cxztlzgtbEv/jUpyxeU4Bm3VjpR8ZdghpAzODRuzyqs2Chh76AroWdGAy0+Y2CsZXADAW496jEAp3+rh7VPyOcZzA/rnNQc4IwqSrfi8803jfDhESKXgNvqFrTNwcnqi0xqT7XC5Q8k54tptLra+U5fPTEx8eepS15zVSXRq2v9QwI1Vp62kgXUbvzFqL7XEmVc1DRtdpWAj4/poHnNd11+fyCDjaDJ+6dvO1mWP/XsT0Jn4FEQSYn5zeWqB9zeaAsoqNhDWQfNyFGlF9Uj3pE6ubZRO2fO0drcbvipem0dMwLs964IjkmDrbqhNljq1NCd+wbf9MS5rxzoqkpDTfULXMQ+kN2sQT8vFfrCFVNKz4l6rtKdQKv8k9P95H2kHdA0NxOiFaeB6bX+fWlRMqrw9BN01iRsmlURz6BY+eVEHk5ar+AkU8QbVWJH+0Krw4uqJzWQAHkmvkEBMutzTQzo1SXSwqDvcAIs4YlCFItSXAMf2YxLcBU9pOuMcbYbqQd81wAFH+YccaVeSGM0Hp/SfN05+Ggy5Y21RL+83Ef/1r9Jv8J66jGIqS0UL23fTgyzL44l6cllpzUyRqNHcB2j9YI9NaHbivBzPz1PLuNWJ926iG2IoUdVn6RxTomsgdmB/3JeolE5w7qkefxLY6BgXAFjfTArGw== runner key
#
@icve
icve / caplock_to_super.md
Last active September 20, 2019 04:36
mapping caplock to super in linux

etxkbmap -option caps:super

copied from arch wiki: ssh keys

add following to bashrc

if ! pgrep -u "$USER" ssh-agent > /dev/null; then
    ssh-agent > ~/.ssh-agent-thing
fi
if [[ ! "$SSH_AUTH_SOCK" ]]; then
    eval "$(<~/.ssh-agent-thing)"
fi
@icve
icve / libinput trackpad config.md
Last active May 10, 2019 13:26
X11/xorg/libinput trackpad config

file path: /etc/X11/xorg.conf.d/30-touchpad.conf

  1. enables single tap to left click
  2. disbale trackpad middle click to prevent accidentally middle clicking(3 finger tap) and copy/pasting random things

reference:

set up vscode to install python package into a (global) python virtual environment (i.e virtualenv or venv).

why?

  • allow vscode to install package without root permission (compare to system wide package install)
  • dont have to create new virtual env, install pylint, pep8 etc every time you switch workspace (compare to local virtual env)

tested on python3.7

@icve
icve / ssh_config
Last active April 22, 2019 04:41
setup github .ssh/config
Host github.com
Hostname github.com
IdentityFile ~/.ssh/github_deploy.key
IdentitiesOnly yes
@icve
icve / [email protected]
Created July 31, 2018 07:27
LightDM Suspend hook (systemd)
[Unit]
Description=User suspend lightDM lock screen
Before=sleep.target
[Service]
User=%I
Environment=DISPLAY=:0
Environment=XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
ExecStart=/usr/bin/dm-tool lock
ExecStartPost=/usr/bin/sleep 1
@icve
icve / sigint_chain.py
Created November 8, 2017 01:41
python chaining signal handlers
from signal import signal, SIGINT
from sys import exit
from time import sleep
org_handler = lambda sig, frame: 0
def interup_handler(sig, frame):
print("caught")
org_handler(sig, frame)
@icve
icve / http_server_simple.py
Last active November 8, 2017 02:51
simple http server that responses OK
from http.server import BaseHTTPRequestHandler, HTTPServer
from time import sleep
PORT = 8008
class Handler(BaseHTTPRequestHandler):
def do_GET(self):
''' method that gets call when GET is recived'''
print(self.path)
self.send_response(200)