Skip to content

Instantly share code, notes, and snippets.

View daveio's full-sized avatar

Dave Williams daveio

View GitHub Profile
@daveio
daveio / youtube.sh
Created February 10, 2018 19:28
Stream from the Raspberry Pi Camera to YouTube Live
#!/bin/bash
# Stream from the Pi camera to YouTube Live.
# Uses information from https://www.makeuseof.com/tag/live-stream-youtube-raspberry-pi/
# Modified to use v4l2 directly (lower cpu, lower latency, higher frame rate, basically More Better)
# Setup: standard Pi Camera setup, then sudo apt-get install libav-tools
# You may need to modify the horizontal and vertical flip options to suit your mount.
# Usage: youtube.sh YOUTUBE-SECRET-KEY
@daveio
daveio / README.md
Created September 17, 2021 19:42
README.md

Hi there!

🏳️‍⚧️ ➡️ ❄️

@daveio
daveio / dantemagic.sh
Created January 15, 2021 17:12
dante sending socks requests out alternate interface
# get dante to use uid 'proxy' for priv and unpriv
# echo "201 fastlane" >> /etc/iproute2/rt_tables
ip rule add fwmark 0x1 table fastlane
ip route add default via 10.0.104.1 dev fastlane table fastlane
iptables -A OUTPUT -t mangle ! -d 10.0.101.0/24 -m owner --uid-owner proxy -j MARK --set-mark 1
iptables -t nat -A OUTPUT -m owner --uid-owner proxy -p udp --dport 53 -j DNAT --to 10.0.104.1:53
iptables -t nat -A OUTPUT -m owner --uid-owner proxy -p tcp --dport 53 -j DNAT --to 10.0.104.1:53
@daveio
daveio / keys.pub.txt
Created April 27, 2020 15:07
keys.pub attestation
BEGIN MESSAGE.
xLrRsTkVjzReNoF M6ZcVecUkmypKNE KBpgihlKU5rAdFY GSgjJpTwuUbVkeL
HqC76slJXGOhcdc lr9dyS6CBvJTCKq 6Xr2MZHgg6Ne5dT Inb9J4iBiezDeHs
bbQGA3nH1BURZKX YaOaHkp8e8RVDjm k0T4qSNGMMdxXwU o2k0GKlBxCj705z
3vq7qbCpCF1lOiC YEGtzZU5KbqhlNZ FS1g221.
END MESSAGE.
@daveio
daveio / foo.rb
Last active February 15, 2020 18:54
ruby 'in' keyword abuse
# hi
# let's imagine we have this kind of structure for a website user. the user can add arbitrary websites,
# which are stored in the userdata[:websites] hash as { :user_selected_name => 'https://example.com' }.
userdata = {
username: 'dave',
websites: {
homepage: 'https://dave.io',
twitter: 'https://twitter.com/syn'

Acamprosate (Campral) – prescribed alongside counselling to treat alcohol dependence.

Aciclovir (Acyclovir) – an antiviral medication primarily used for the treatment of herpes simplex virus infections, chickenpox, and shingles.

Allopurinol (Zyloprim) – to decrease high blood uric acid levels. It is specifically used to prevent gout, prevent specific types of kidney stones and for the high uric acid levels that can occur with chemotherapy.

Amlodipine (Norvasc) – is a medication used to treat hypertension (high blood pressure) and coronary artery disease.

Baclofen (Lioresal) – to treat spasticity. It is used as a central nervous system depressant and skeletal muscle relaxant.

@daveio
daveio / keybase.md
Created April 11, 2019 11:37
keybase proof

Keybase proof

I hereby claim:

  • I am daveio on github.
  • I am dave (https://keybase.io/dave) on keybase.
  • I have a public key ASC4CBtFVpJlyTVB1Kk42Fl748ngJZpT6WqQ5w21o8ABZAo

To claim this, I am signing this object:

You have a shredder connected to an empty box, and various rubber balls. The balls are all the same colour, each ball of a certain type is identical, and each type is made of a different material from each other type. The shredder is special, in that if you put a ball in the shredder, the pattern of the shredded-up remains in the box will be the same every time, but distinct from any other type of ball.

You want to demonstrate to someone who does not know a secret that you and Bob both know that secret. The secret is a sequence of four balls of any type.

The secret value is a Type 1 ball, followed by a Type 2 ball, a Type 3 ball, and a Type 4 ball.

Bob puts his four balls in the machine, one after the other, and the resulting state of the box is a chaotic mess; each shredded bit has been buffeted around by all the other shredded bits. It looks nothing like any one ball’s pattern.

The state of the box is a hash of the secret information.

@daveio
daveio / result.txt
Created September 19, 2018 02:43
Did we find Vulcan?
ref: https://twitter.com/aussiastronomer/status/1042193826205454336
g(earth) = 9.81
g(vulcan) = g(earth) * 1.4
g(vulcan) = 9.81 * 1.4
g(vulcan) = 13.734
G = 6.67408e-11
M(earth) = 5.972e24
@daveio
daveio / autorefresh.js
Last active September 13, 2018 15:06
Auto-refresh for Twitter Web
/* Enable commented lines (beneath this documentation) if you want to use in a userscript or similar,
otherwise copy all uncommented lines (or the whole gist) and paste into the javascript console.
Note that the update will only happen if you're scrolled all the way to the top. This prevents the
page jumping around when the update happens.
If you're pasting into the Javascript console, bear in mind that if you refresh with your browser,
the functionality will be lost and you'll need to paste it in again.
MIT licenced
Dave Williams (github:daveio), September 2018 */
// $(document).ready(function () {