Skip to content

Instantly share code, notes, and snippets.

View netj's full-sized avatar

Jaeho Shin netj

View GitHub Profile
sepal.length sepal.width petal.length petal.width variety
5.1 3.5 1.4 .2 Setosa
4.9 3 1.4 .2 Setosa
4.7 3.2 1.3 .2 Setosa
4.6 3.1 1.5 .2 Setosa
5 3.6 1.4 .2 Setosa
5.4 3.9 1.7 .4 Setosa
4.6 3.4 1.4 .3 Setosa
5 3.4 1.5 .2 Setosa
4.4 2.9 1.4 .2 Setosa
@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 / memusg
Last active January 29, 2024 15:04
memusg -- Measure memory usage of processes
#!/usr/bin/env bash
# memusg -- Measure memory usage of processes
# Usage: memusg COMMAND [ARGS]...
#
# Author: Jaeho Shin <netj@sparcs.org>
# Created: 2010-08-16
############################################################################
# Copyright 2010 Jaeho Shin. #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #
@netj
netj / Fix-Windows7-WebDAV-Parameters.reg
Created February 15, 2012 06:35
Registry File for Fixing Windows7 WebDAV/WebClient Parameters: Download >50MB files (still <4GB) and Upload large files that takes longer than 30mins
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\WebClient\Parameters]
"FileSizeLimitInBytes"=dword:ffffffff
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\MRxDAV\Parameters]
"FsCtlRequestTimeoutInSec"=dword:ffffffff
@netj
netj / 🎨=github.com.1h.sh
Last active April 22, 2023 18:50
macOS xbar menu item for GitHub Pull Requests/Issues
#!/usr/bin/env bash
# macOS xbar menu item for GitHub Pull Requests/Issues
#
# <xbar.title>GitHub assigned Pull Requests and Issues</xbar.title>
# <xbar.version>v2023.16.0</xbar.version>
# <xbar.author>Jaeho Shin</xbar.author>
# <xbar.author.github>netj</xbar.author.github>
# <xbar.desc>Quick handle for showing number of assigned Github Pull Requests / Issues and giving access to the most recent ones</xbar.desc>
# <xbar.image>https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png</xbar.image>
# <xbar.abouturl>https://gist.github.com/netj/082aa1d431db0e240eb492f0a3f16873</xbar.abouturl>
@netj
netj / relpath
Created January 7, 2012 06:32
A Bash script providing a command for computing relative path between two filesystem paths
#!/bin/bash
# relpath -- Compute relative path from a given DIR to given PATHs
# Usage: relpath DIR PATH...
#
# Example: relpath /a/b/c /a/d/e/f
# prints: ../../d/e/f
#
# Example: relpath /a/b/c /
# prints: ../../../
#
#!/usr/bin/env bash
# yeshup -- wraps given command with a parent process that sends SIGTERM upon receiving SIGHUP, the opposite of nohup
# See also: https://github.com/RhysU/yeshup
set -eu
pid=$$
trap 'kill -TERM $pid' HUP
"$@" & pid=$!
wait
#!/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)
@netj
netj / .zprofile
Last active July 25, 2022 22:45
zprofile for using latest bash instead of zsh
# ~/.zprofile for launching login shells to latest bash from Homebrew on macOS
# Origin: https://gist.github.com/netj/f76dffced1995a10a4c455d8418ed47d
#
# If you still have old bash (3.x) as your shell, please change it to zsh before using this with:
# chsh -s /bin/zsh
[ -n "${INTELLIJ_ENVIRONMENT_READER-}" ] || # to not interfere with PyCharm or IntelliJ IDEs
PATH="/opt/homebrew/bin:$PATH" exec env -u SHELL bash -il
@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