Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
# curl -ks https://gist.githubusercontent.com/daemonp/55b97a203415ad18d649/raw/fc73fb129b0429680af6c03719238c5df1a03f8b/get-cookies.sh | sh
STARTD=${PWD}
NOW=$(date -u +%Y%m%dt%H%M%S)
HOST=${HOSTNAME:-$(hostname)}
UNQ=${NOW}.${RANDOM}.$$
COOKIES=/tmp/${UNQ}
@daemonp
daemonp / gist:1fcccaf6cd10f0046a34
Created November 6, 2014 21:50
redsocks openwrt
# Create new chain
iptables -t nat -X REDSOCKS
iptables -t nat -N REDSOCKS
# Ignore LANs and some other reserved addresses.
iptables -t nat -A REDSOCKS -d 0.0.0.0/8 -j RETURN
iptables -t nat -A REDSOCKS -d 10.0.0.0/8 -j RETURN
iptables -t nat -A REDSOCKS -d 10.10.1.0/22 -j RETURN
iptables -t nat -A REDSOCKS -d 127.0.0.0/8 -j RETURN
iptables -t nat -A REDSOCKS -d 169.254.0.0/16 -j RETURN
Verifying that +daemonp is my openname (Bitcoin username). https://onename.io/daemonp

/etc/mkinitcpio.conf

HOOKS="systemd autodetect modconf block keymap sd-encrypt filesystems keyboard fsck"

lsblk

NAME                                          MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
nvme0n1 259:0 0 477G 0 disk

OpenWRT/LEDE using redsocks to route pandora traffic through redsocks to shadowsocks proxy in the US

/etc/rc.local

iptables -t nat -N REDSOCKS
iptables -t nat -A REDSOCKS -p tcp -j REDIRECT --to-ports 12345
iptables -t nat -A PREROUTING -p tcp -d 208.85.40.0/24 -j REDSOCKS
@daemonp
daemonp / encrypted-root-arch-linux-pixelbook.md
Last active May 2, 2024 16:01
Installing Arch Linux on a Google Pixelbook (i7 16gb 500gb NVMe)

Overview

Stable enough for my initial use-case, light-duty laptop for travel and presentations, running Linux all the time but retain a small ChromeOS volume for firmware updates and restoring settings.

1st attempt I wiped the drive and then found that when the machine attempted to suspect when the lid closed it wiped the NVRAM with no other option to boot into legacy mode than to restore ChromeOS and enable it again.

  • Setup base system in ChromeOS
  • Fully encrypted Btrfs root partition & ext4 boot
  • Install Arch Linux

Overview

  • Fully encrypted Btrfs root partition & ext4 boot
  • Install Arch Linux
  • Configure some basics

Status

Everything works out of the box!

jq '[path(..)|map(if type=="number" then "[]" else tostring end)|join(".")|split(".[]")|join("[]")]|unique|map("."+.)|.[]'

Simple way to post an encrypted screenshot to IPFS and decrypt it on the fly with the public key as an anchor in the link.

Garto:

ipfs hash A is just the encrypted image, and ipfs hash B is a page that isn't encrypted and contains js that downloads the image using a hard coded (in B) reference to A and decrypts using the frag identifier from url B. Then you just share B and it Just Works.

Features

  • Ephemeral Elliptic Curve (ed25519) for one shot asymmetric encryption
  • encrypt, put and pin asset

Pull latest image

kubectl patch -p "{\"spec\":{\"template\":{\"metadata\":{\"labels\":{\"date\":\"`date +'%s'`\"}}}}}" -n home deployments.apps radarr