Skip to content

Instantly share code, notes, and snippets.

View elquimista's full-sized avatar
🏠
WFH

elquimista elquimista

🏠
WFH
  • Houston, TX
View GitHub Profile
@edjdavid
edjdavid / file.md
Created October 13, 2022 12:45
Stream Windows webcam/desktop via RTSP

Can be used for streaming data (webcam or screen capture) from the Windows to WSL

Install

  1. Simple RTSP Server
  2. ffmpeg

Get the internal IP of WSL

Run from a WSL terminal

ip route list default | awk '{print $3}'
@mattmc3
mattmc3 / optparsing_demo.zsh
Last active April 5, 2024 21:22
Zsh option parsing example
# Manual opt parsing example
#
# Features:
# - supports short and long flags (ie: -v|--verbose)
# - supports short and long key/value options (ie: -f <file> | --filename <file>)
# - supports short and long key/value options with equals assignment (ie: -f=<file> | --filename=<file>)
# - does NOT support short option chaining (ie: -vh)
# - everything after -- is positional even if it looks like an option (ie: -f)
# - once we hit an arg that isn't an option flag, everything after that is considered positional
function optparsing_demo() {
@elquimista
elquimista / yubikey-reset.sh
Created March 12, 2019 00:44 — forked from pkirkovsky/yubikey-reset.sh
Utility for resetting a Yubikey to factory defaults using gpg-connect-agent. This will wipe out any stored keys and reset PINs to default values.
gpg-connect-agent <<EOF
/hex
scd serialno
scd apdu 00 20 00 81 08 40 40 40 40 40 40 40 40
scd apdu 00 20 00 81 08 40 40 40 40 40 40 40 40
scd apdu 00 20 00 81 08 40 40 40 40 40 40 40 40
scd apdu 00 20 00 81 08 40 40 40 40 40 40 40 40
scd apdu 00 20 00 83 08 40 40 40 40 40 40 40 40
scd apdu 00 20 00 83 08 40 40 40 40 40 40 40 40
scd apdu 00 20 00 83 08 40 40 40 40 40 40 40 40
@elquimista
elquimista / gpg2qrcode.sh
Last active January 17, 2024 16:44 — forked from joostrijneveld/gpg2qrcodes.sh
Produce printable QR codes for persistent, tangible storage of GPG private keys and vice versa.
# Depends on:
# paperkey (jabberwocky.com/software/paperkey/)
# libqrencode (fukuchi.org/works/qrencode/)
# Producing the QR codes:
# Split into 16 codes to ensure the data per image is not too large.
# Or split into 3 codes for smaller keys (e.g., ed25519)
gpg --export-secret-key KEYIDGOESHERE | paperkey --output-type raw | base64 > temp
if [ "$(uname)" == "Darwin" ]; then
split -n 16 temp IMG
@yatsu
yatsu / rbenv-ruby187-macos.sh
Last active July 13, 2023 19:36
Install ruby-1.8.7 with rbenv on macOS Catalina (10.15)
#!/bin/sh
# 1) Install Xcode 11
# 2) Install command line tools: `xcode-select --install`
# 3) Install HomeBrew
# 4) brew tap cartr/qt4 && brew install cartr/qt4/openssl@1.0 subversion rbenv
# 5) Setup rbenv
# 6) Run this command
PKG_CONFIG_PATH="$(brew --prefix cartr/qt4/openssl@1.0)/lib/pkgconfig" \
@dvdbng
dvdbng / vim-heroku.sh
Last active April 22, 2024 22:42
Run vim in heroku updated 2017
mkdir ~/vim
cd ~/vim
# Staically linked vim version compiled from https://github.com/ericpruitt/static-vim
# Compiled on Jul 20 2017
curl 'https://s3.amazonaws.com/bengoa/vim-static.tar.gz' | tar -xz
export VIMRUNTIME="$HOME/vim/runtime"
export PATH="$HOME/vim:$PATH"
cd -
@bynil
bynil / config-git-proxy.txt
Last active January 23, 2024 12:37
Use git over socks5 proxy
Port: 1080
1. Create a file /YOUR PATH/gitproxy.sh with content:
#!/bin/sh
nc -X 5 -x 127.0.0.1:1080 "$@"
2. Edit your ~/.gitconfig
# For git://
@hewerthomn
hewerthomn / install-oh-my-zsh.sh
Created January 26, 2017 11:30
Offline install of oh-my-zsh on Ubuntu
main() {
# Use colors, but only if connected to a terminal, and that terminal
# supports them.
if which tput >/dev/null 2>&1; then
ncolors=$(tput colors)
fi
if [ -t 1 ] && [ -n "$ncolors" ] && [ "$ncolors" -ge 8 ]; then
RED="$(tput setaf 1)"
GREEN="$(tput setaf 2)"
YELLOW="$(tput setaf 3)"
@remarkablemark
remarkablemark / Dockerfile
Last active April 24, 2024 13:40
Install node and npm with nvm using Docker.
# set the base image to Debian
# https://hub.docker.com/_/debian/
FROM debian:latest
# replace shell with bash so we can source files
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
# update the repository sources list
# and install dependencies
RUN apt-get update \
@pboling
pboling / PhantomJS Install.md
Last active July 23, 2019 17:54
How to install old PhantomJS 1.8.2 on Mac OS X