Skip to content

Instantly share code, notes, and snippets.

@thedod
thedod / index.pug
Created August 29, 2023 14:23
Retro pre code console styling
pre.i-has-teh-code
| $: > Booting systems...
| $: > Total memory found: 256kb
| $: > Scanning for bootable media ■■■■■■■■■■■ 100%
| $: > No media found. Booting from network address 3E:40:9C:75
| $: > Loading BIOS 2.3 ■■■■■■■■■■■ 100%
| $: > Reticulating splines ■■■■■■■■■■■ 100%
| $: > Booting console ■■■■■■■■■■■ 100%
| $:
| $: > Welcome to the retro console version 0.1a
@thedod
thedod / CHRIS.md
Created December 23, 2017 10:45
My 0.0000002 BTC's worth re ok cupid's decision to dox their users

Some of you may remember that what is now called follow in keybase, used to be called track. This led to a heavily commented issue.

My suggestion to use recognize wasn't because "it sounded nice", but because this was the most accurate description I could come up with for a non-trivial concept concerning crypto and identity — fields where god is in the details and NSA et al hide where they're absent or vague.

I don't claim my idea is or was the best, but facts are:

  • It was ignored.
  • The fact that the term pin wasn't (although it's bound to be confused with something irrelevant on pinterest and something compeletely different on ssh) suggests that @malgorithms et al actively chose not to dignify recognize with an answer (not even a negative one).
@thedod
thedod / README.md
Last active August 6, 2017 16:50
Trumpinator: a Lua cgi script that generates a random Trump speech

Trumpinator

A Lua cgi script that generates a random speech by walking a Markov chain generated from Trump's inauguration speech.

Disclaimer

The output text does not represent Trump's views or anything. It's just a stupid algorithm generating nonsense. If you feel uneasy with it, feel free to fork this and use text from somebody else's speech 😉.

Why Lua?

If I understand correctly, it's the easiest [non-php] way to serve dynamic web content from an OpenWRT router, so I've decided to learn it, and this is my first Lua program (not exactly mine. It's based on an example in the book 😉).

@thedod
thedod / README.md
Last active November 14, 2016 23:29
shinatra.sh variant for serving files

f.shinatra.sh

A variant of shinatra.sh that serves the current version of a file (f is for file).

Usage: f.shinatra.sh somefile.html [port] [filter]

  • Default port is 8080
  • Default filter is unix2dos (see edge effect example below)

Examples:

@thedod
thedod / README.md
Last active May 2, 2023 14:02
Quick workaround for a flask-bootstrap navbar with items at the right side

A quick workaround for a flask-bootstrap navbar with items at the right side, as requested at #126.

Bonus: ability to change navbar's style (navbar navbar-inverse in the example).

  • copy the flask-bootstrap sample app to a folder.
  • overwrite nav.py, __init__.py, and frontend.py with the files here.
@thedod
thedod / README.md
Last active May 18, 2022 04:53
WiFi QR code generation shell script

#Shelter1001's interactive [zenity] shell script for wifi qr-code generation.

Supports WPA [recommended] and open [sometimes useful] networks [no WEP support because duh].

Based on this [WPA only] commandlinefu.

party on, Garth

@thedod
thedod / index.html
Last active October 20, 2015 21:46
התקווה
<!DOCCTYPE html>
<html lang="he">
<head>
<meta charset='UTF-8'>
<title>התקווה 2K</title>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet" />
</head>
<body>
<div class="container">
<div style="direction:rtl">
@thedod
thedod / fubase.sh
Last active December 11, 2015 02:25
Privacyfu - handy privacy-related commandlinefu-esque scripts
#!/bin/sh
# gpg to a keybase user or [unlike the keybase app] more than one
# Note: only encrypts. Doesn't do the usual metadata dance keybase is famous for
# **Example:** fubase.sh bob carol [< somefile]
# !!!!!!!!!!!!!!!!!!!!!!! uncomnent and change:
# export ME=alice
`(echo -n "gpg -u $ME@keybase.io -r $ME@keybase.io -eas " ; for r in $* ; do echo -n -r \""$r"\"\ ; done) | xargs` | xclip -sel clipboard
@thedod
thedod / panoptchik.sh
Last active August 29, 2015 14:25
Launch GMotionLive as a sticky, always-on-top window (requires wmctrl)
#!/bin/sh
# Launch http://www.lavrsen.dk/foswiki/bin/view/Motion/GMotionLive as sticky,always-on-top
# Usage: panoptchik.sh [N]
# N is webcam index (default is 1)
### Config me!
export WEBCAM_PREFIX=http://192.168.1.41:808 # port's last digit is [1 based] cam index
if [ "$1" == "" ] ; then
export CAM=1 # Cam 1, I presume
else
@thedod
thedod / README.md
Last active March 1, 2022 04:13
Gotcha - Simple Arduiono alarm system with "dead man switch" support

Lately, somebody started stealing from us. Took us time to figure it out. At first we thought things got lost. When they took a gas tank, it became obvious ;). As far as I know, it ain't over and it's no game. It's a lousy perimeter to defend, especially for old hippies who moved to the land of smiles because they got tired of saying "perimeter"[1].

But enough about me

This is a generic Arduino sketch that lets you whip up a simple and friendly alarm system from whatever sensors and controllers you've got lying around in cat-infested shoe boxes.

  • A sensor (PIR motion detector, magnetic door switch, weight sensor, etc.).
  • A controller (hidden button, keypad, RFID reader, etc.) to temporarily disable ("chill") the system.
  • A noisy device (buzzer, ghetto-blaster, tennis ball cannon aimed at a gong, GSM modem for sending SMS, etc.).
  • A LED.