Skip to content

Instantly share code, notes, and snippets.

View Ephemera's full-sized avatar
🤡

GyuYong Jung Ephemera

🤡
View GitHub Profile
@Ephemera
Ephemera / AuthyToOtherAuthenticator.md
Created August 22, 2022 09:20 — forked from gboudreau/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy

Generating Authy passwords on other authenticators


There is an increasing count of applications which use Authy for two-factor authentication. However many users who aren't using Authy, have their own authenticator setup up already and do not wish to use two applications for generating passwords.

Since I use 1Password for all of my password storing/generating needs, I was looking for a solution to use Authy passwords on that. I couldn't find any completely working solutions, however I stumbled upon a gist by Brian Hartvigsen. His post had a neat code with it to generate QR codes for you to use on your favorite authenticator.

His method is to extract the secret keys using Authy's Google Chrome app via Developer Tools. If this was not possible, I guess people would be reverse engineering the Android app or something like that. But when I tried that code, nothing appeared on the screen. My guess is that Brian used the

@Ephemera
Ephemera / let_run_apply_also.md
Last active July 5, 2022 21:20 — forked from eungju/README.md
Kotlin let run apply also

let

inline fun <T, R> T.let(block: (T) -> R): R = block(this)

run

inline fun <T, R> T.run(block: T.() -> R): R = block()

apply

# Instructions for fresh install
$ sh <(curl -L https://nixos.org/nix/install) --darwin-use-unencrypted-nix-store-volume --daemon
# reboot
$ source /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
$ echo 'export NIX_PATH=darwin-config=$HOME/.nixpkgs/darwin-configuration.nix:$HOME/.nix-defexpr/channels${NIX_PATH:+:}$NIX_PATH' | tee -a ~/.zshrc
$ echo 'source $HOME/.nix-profile/etc/profile.d/hm-session-vars.sh' | tee -a ~/.zshrc
$ nix-channel --add https://nixos.org/channels/nixpkgs-unstable
$ nix-channel --add https://github.com/LnL7/nix-darwin/archive/master.tar.gz darwin
$ nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
@Ephemera
Ephemera / openresty.service
Created March 6, 2021 15:05 — forked from HauptJ/openresty.service
OpenResty Systemd service file
# Stop dance for OpenResty
# A modification of the Nginx systemd script
# Source: https://www.digitalocean.com/community/tutorials/how-to-use-the-openresty-web-framework-for-nginx-on-ubuntu-16-04
# =======================
#
# ExecStop sends SIGSTOP (graceful stop) to the Nginx process.
# If, after 5s (--retry QUIT/5) OpenResty is still running, systemd takes control
# and sends SIGTERM (fast shutdown) to the main process.
# After another 5s (TimeoutStopSec=5), and if OpenResty is alive, systemd sends
# SIGKILL to all the remaining processes in the process group (KillMode=mixed).
@Ephemera
Ephemera / raspberry-power-supply-check.sh
Created February 9, 2021 11:58 — forked from maxme/raspberry-power-supply-check.sh
Check your Raspberry pi power supply and USB cable
#!/bin/bash
# Before running this script, make sure you have sysbench installed:
# sudo apt-get install sysbench
#
# This script helps you check if your Raspberry pi is correctly powered.
# You can read more about Raspberry pi powering issues here: https://ownyourbits.com/2019/02/02/whats-wrong-with-the-raspberry-pi/
# If you're pi is correctly powered (stable power supply and quality cable), after running the script, you should get something like:
@Ephemera
Ephemera / latency.markdown
Created February 8, 2021 09:45 — forked from hellerbarde/latency.markdown
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

@Ephemera
Ephemera / README.md
Created August 9, 2019 05:50 — forked from steve-jansen/README.md
Stop and start Symantec Endpoint Protection on OS X

This script enables you stop and start Symantec Endpoint Protection on OS X

Installation

sudo curl https://gist.githubusercontent.com/steve-jansen/61a189b6ab961a517f68/raw/sep -o /usr/local/bin/sep
sudo chmod 755 /usr/local/bin/sep
sudo chown root:staff /usr/local/bin/sep
@Ephemera
Ephemera / HowToOTG.md
Created April 24, 2018 12:28 — forked from gbaman/HowToOTG.md
Simple guide for setting up OTG modes on the Raspberry Pi Zero

Raspberry Pi Zero OTG Mode

Simple guide for setting up OTG modes on the Raspberry Pi Zero - By Andrew Mulholland (gbaman).

The Raspberry Pi Zero (and model A and A+) support USB On The Go, given the processor is connected directly to the USB port, unlike on the B, B+ or Pi 2 B, which goes via a USB hub.
Because of this, if setup to, the Pi can act as a USB slave instead, providing virtual serial (a terminal), virtual ethernet, virtual mass storage device (pendrive) or even other virtual devices like HID, MIDI, or act as a virtual webcam!
It is important to note that, although the model A and A+ can support being a USB slave, they are missing the ID pin (is tied to ground internally) so are unable to dynamically switch between USB master/slave mode. As such, they default to USB master mode. There is no easy way to change this right now.
It is also important to note, that a USB to UART serial adapter is not needed for any of these guides, as may be documented elsewhere across the int

@Ephemera
Ephemera / tmux-color-palette.sh
Last active July 31, 2017 09:39
[tmux color palette] #tmux #color
for i in {0..255}; do
printf "\x1b[38;5;${i}mcolour${i}\x1b[0m\n";
done
PassengerId Pclass Name Sex Age SibSp Parch Ticket Fare Cabin Embarked
892 3 Kelly, Mr. James male 34.5 0 0 330911 7.8292 Q
893 3 Wilkes, Mrs. James (Ellen Needs) female 47 1 0 363272 7 S
894 2 Myles, Mr. Thomas Francis male 62 0 0 240276 9.6875 Q
895 3 Wirz, Mr. Albert male 27 0 0 315154 8.6625 S
896 3 Hirvonen, Mrs. Alexander (Helga E Lindqvist) female 22 1 1 3101298 12.2875 S
897 3 Svensson, Mr. Johan Cervin male 14 0 0 7538 9.225 S
898 3 Connolly, Miss. Kate female 30 0 0 330972 7.6292 Q
899 2 Caldwell, Mr. Albert Francis male 26 1 1 248738 29 S
900 3 Abrahim, Mrs. Joseph (Sophie Halaut Easu) female 18 0 0 2657 7.2292 C