Skip to content

Instantly share code, notes, and snippets.

View netj's full-sized avatar

Jaeho Shin netj

View GitHub Profile
@netj
netj / gcp-start-iap-tunnel-ssh-proxy-magic.sh
Last active April 15, 2024 19:42
a nifty script for accessing with native SSH your IAP allowed Compute Engine instances
#!/usr/bin/env bash
# ~/.ssh/gcp-start-iap-tunnel-ssh-proxy-magic.sh
# a script to be used as SSH ProxyCommand to allow fully functional SSH access to any Google Cloud Compute Engine VMs allowing IAP access
#
# Author: Jaeho Shin <netj@sparcs.org>
# Created: 2022-10-31
# See also:
# - https://gist.github.com/netj/df4f9de1fefd254ab11979be7035b5d0/#readme
# - https://cloud.google.com/iap/docs/using-tcp-forwarding
#
@netj
netj / aws-ssm-ssh-proxy-magic.sh
Last active July 1, 2021 04:52
a nifty script for ssh'ing into any AWS SSM-enabled EC2 instance with no extra manual setup
#!/usr/bin/env bash
# ~/.ssh/aws-ssm-ssh-proxy-magic.sh -- a nifty script for ssh'ing into any AWS SSM-enabled EC2 instance with no extra manual setup
#
# Author: Jaeho Shin <netj@sparcs.org>
# Created: 2021-02-01
# See also:
# - https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-getting-started-enable-ssh-connections.html
# - https://gist.github.com/d9006a823163d7662d8ff105c9a49e0e
#
# 1. Copy this script to ~/.ssh/aws-ssm-ssh-proxy-magic.sh
#!/usr/bin/env bash
# a Day One CLI for macOS script generator for importing diary entries from Momento3 text exports
#
# Prerequisites:
#
# - install dayone2 CLI
# - brew install coreutils
#
#
# Usage: run the script inside a Momento Export (one text file per day format)
@mpkocher
mpkocher / DataClasses.ipynb
Created May 25, 2019 01:55
Overview of Dataclasses, namedtuple, typing.NamedTuple, attrs and pydantic
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@netj
netj / Enby Code R.css
Created March 11, 2019 08:22
a Blink Shell Font
@font-face {
font-family: "Envy Code R";
font-style: normal;
font-weight: normal;
src: url(data:font/opentype;charset-utf-8;base64,T1RUTwALAIAAAwAwQ0ZGIEFt83wAABB4AAHV7UZGVE1cbC2QAAHwwAAAABxHREVGArsABAAB5mgAAAAgT1MvMuc/K8kAAAEgAAAAYGNtYXBAlmy5AAAIoAAAB7ZoZWFk/f3CSgAAALwAAAA2aGhlYQvHBLUAAAD0AAAAJGhtdHj133xSAAHmiAAACjhtYXhwAo5QAAAAARgAAAAGbmFtZcZfgEgAAAGAAAAHIHBvc3T/NgBnAAAQWAAAACAAAQAAAAAUOTjh3h1fDzz1AAsIAAAAAADNQbHgAAAAAM1BseD/xP1OBJgIBgAAAAgAAgAAAAAAAAABAAAHaP4mAAAETP/E/7QEmAABAAAAAAAAAAAAAAAAAAACjgAAUAACjgAAAAMETAGQAAUAAADNAM0AAAEfAM0AzQAAAR8AZgIACAQCAAUJAAAAAgAEoAAAr0AAePsAAAAAAAAAAEVOVlkAQAAg+wYFjv4mAAAHaAHaIAAAk83UAAAEUgWOACAAIAABAAAAHgFuAAEAAAAAAAAASgCWAAEAAAAAAAEAGQEVAAEAAAAAAAIABwE/AAEAAAAAAAMAKgGdAAEAAAAAAAQAGQH8AAEAAAAAAAUADQIyAAEAAAAAAAYAFQJsAAEAAAAAAAcAOAL0AAEAAAAAAAgAGQNhAAEAAAAAAAkADAOVAAEAAAAAAAoASgQ4AAEAAAAAAAsAGQS3AAEAAAAAAAwAFgT/AAEAAAAAABAAGQVKAAEAAAAAABIAGQWYAAMAAQQJAAAAlAAAAAMAAQQJAAEAMgDhAAMAAQQJAAIADgEvAAMAAQQJAAMAVAFHAAMAAQQJAAQAMgHIAAMAAQQJAAUAGgIWAAMAAQQJAAYAKgJAAAMAAQQJAAcAcAKCAAMAA
@netj
netj / exshell
Last active September 21, 2018 14:23
#!/usr/bin/env bash
# exshell -- a handy way to use command-line formulae's output to augment a TAB-separated input
#
# Synopsis:
# $ cat a.txt
# USA United States of America
# India Republic of India
# South_Korea Republic of Korea (ROK)
#
# $ exshell <a.txt \
@netj
netj / remocon
Last active May 21, 2018 01:10
MOVED TO: https://github.com/netj/remocon since 2018-05
#!/usr/bin/env bash
# remocon -- run given command remotely, replicating local git work tree on a remote host, and downloading remote changes if needed
#
# Author: Jaeho Shin <netj@sparcs.org>
# Created: 2018-03-08
##
set -euo pipefail
error() { echo >&2 "📡 ‼️ " "$@"; false; }
warning() { echo >&2 "📡 ⚠️ " "$@"; }
@simont77
simont77 / elgato-eve.md
Last active January 27, 2024 13:31 — forked from gomfunkel/elgato-eve.md
Elgato Eve HomeKit Services & Characteristics

Elgato Eve HomeKit Services & Characteristics

A work in progress collection of proprietary and as of yet undocumented HomeKit characteristics and their UUIDs used by Elgato Eve.

Based on the work by gomfunkel and 0ff. Characteristics and data dump for Door, Motion and Thermo thanks to @NebzHB.

More infos not yet incorporated in the comment section.

This list is not including all Eve accessories available and some services and characteristics still make no sense to me. If you have anything to contribute, please leave a comment. There is no guarantee that the information listed below is correct.

@treyhunner
treyhunner / time_dict_merge.py
Last active November 3, 2023 08:13
Test performance of different dictionary merging functions in Python
"""
Results:
multiple_update: 33 ms
copy_and_update: 27 ms
dict_constructor: 29 ms
kwargs_hack: 33 ms
dict_comprehension: 33 ms
concatenate_items: 81 ms
union_items: 81 ms
@joshbode
joshbode / LICENSE.md
Last active April 5, 2024 14:52
YAML Loader with include constructor (Python 3)

MIT License

Copyright (c) 2018 Josh Bode

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: