Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# get-docker-socket-from-remote <name> <user>@<host>
# Create a unix socket at /tmp/<name>-docker.sock which, when
# used will ssh to <user>@<host> and connect to the docker
# socket at <host>:///var/run/docker.sock
# Note:
# 1. This forks a subjob that manages the local socket.
# Rmember to kill that when your finished
@bhyde
bhyde / grant_voice_desktop_access_to_my_microphone.sh
Created March 8, 2022 23:35
Script to grant the Voice Desktop application access to the microphone.
#!/bin/bash
set -e -u -o pipefail
# Grant this Voice Desktop access to the user's microphone.
app='com.jerrkawz.voiceDesktop'
svc='kTCCServiceMicrophone'
# Modifying user's Transparency, Consent, and Control settings, e.g. TCC
access_db="$HOME/Library/Application Support/com.apple.TCC/TCC.db"
INFO [05-17|21:32:02] /networking/handshake_handlers.go#284: Attempting to discover peer at 3.227.207.132:21001
INFO [05-17|21:32:02] /networking/handshake_handlers.go#284: Attempting to discover peer at 34.207.133.167:21001
2020-05-17 21:32:02.232566 [net info] created <Conn fd=49 addr=<NetAddr 3.227.207.132:21001> mode=active>
2020-05-17 21:32:02.233003 [net info] created <Conn fd=52 addr=<NetAddr 34.207.133.167:21001> mode=active>
INFO [05-17|21:32:02] /networking/handshake_handlers.go#284: Attempting to discover peer at 107.23.241.199:21001
INFO [05-17|21:32:02] /networking/handshake_handlers.go#284: Attempting to discover peer at 54.197.215.186:21001
INFO [05-17|21:32:02] /networking/handshake_handlers.go#284: Attempting to discover peer at 18.234.153.22:21001
2020-05-17 21:32:02.233926 [net info] created <Conn fd=55 addr=<NetAddr 107.23.241.199:21001> mode=active>
2020-05-17 21:32:02.234637 [net info] created <Conn fd=58 addr=<NetAddr 54.197.215.186:21001> mode=active>
2020-05-17 21:32:02.234889 [net in
@bhyde
bhyde / init.org
Created March 30, 2020 15:19
Emacs init.org entry for grammarbot.io api

grammarbot

Grammarbot.io sells a grammar checking API with a generous free variant. Here I load an emacs interface is found here zevlg/grammarbot.el at github.

(use-package grammarbot
  :quelpa (grammarbot :url "https://raw.githubusercontent.com/zevlg/grammarbot.el/master/grammarbot.el" :fetcher url)
  :commands grammarbot
  :config (progn
            (customize-set-variable 'grammarbot-api-key "KS9C5N3Y")))
@bhyde
bhyde / transcript
Created February 20, 2020 15:13
Transcript of failed install of wireguard on centos 8
>->-> echo ==== Start $0 ====
==== Start /tmp/firstboot.exec ====
>->-> date
Thu Feb 20
14:41:29 UTC 2020
>->-> yum update -y
CentOS-8 - AppStream 15 kB/s | 4.3 kB 00:00
CentOS-8 - AppStream 17 MB/s | 6.4 MB 00:00
CentOS-8 - Base 14 kB/s | 3.8 kB 00:00
CentOS-8 - Base 12 MB/s | 5.0 MB 00:00
@bhyde
bhyde / gist:5673492
Created May 29, 2013 20:18
Snarf historical prices from ebay... via common lisp
(in-package "CL-USER")
(let ((*print-case* :upcase))
(ql:quickload '(#:fare-memoization #:parse-number
#:optima #:optima.ppcre #:fare-quasiquote-optima
#:drakma #:closure-html)))
(defpackage #:eb
(:use #:common-lisp #:fare-memoization #:parse-number
#:optima #:optima.ppcre
@bhyde
bhyde / establish-routing-to-boot2docker-container-network
Last active November 2, 2019 18:59
Boot2docker - teach the mac how to connect to the containers by adjusting it's routing.
#!/bin/bash
# Script to instruct the Mac how to route packets to the
# software defined network where containers created via boot2docker
# reside. This lets you casually directly to ports (ssh, http, etc. etc.)
# on those containers.
function ERROR(){ echo "ERROR: $*" ; }
function FAIL(){ echo "FAILING: $*" ; exit 1; }
if [[ 'running' != $(boot2docker status) ]]
then FAIL "boot2docker's VM not running" ; fi
IP_OF_DOCKER_HOST=$(boot2docker ip 2> /dev/null)
<img src='https://radblast.wunderground.com/cgi-bin/radar/WUNIDS_map?station=BOX&brand=wui&num=10&delay=50&type=N0R&frame=0&scale=1&noclutter=1&showstorms=99&mapx=400&mapy=240&centerx=400&centery=240&transx=0&transy=0&showlabels=1&severe=0&rainsnow=1&lightning=1&smooth=0&rand=26011761&lat=0&lon=0&label=you'>
<img '<img src=https://forecast.weather.gov/meteograms/Plotter.php?lat=42.3833&lon=-71.0667&wfo=BOX&zcode=MAZ015&gset=20&gdiff=10&unit=0&tinfo=EY5&ahour=0&pcmd=11101111110000000000000000000000000000000000000000000000000&lg=en&indu=1!1!1!&dd=&bw=&hrspan=48&pqpfhr=6&psnwhr=6'>
<html>
<body>
<p>That site is currently on vacation.</p>
<body>
</html>
@bhyde
bhyde / s3_bucket_logging.py
Created January 5, 2018 17:09
context manager for boto3 ClientError
@contextmanager
def ignoring_aws_client_error(code-text):
try:
yield
except ClientError as e:
if e.response['Error']['Code'] == code-text:
pass
raise