Skip to content

Instantly share code, notes, and snippets.

@eldondev
eldondev / CertBotNearlyFreeSpeechAuthHook.sh
Last active March 16, 2024 15:03 — forked from UnixSage/CertBotNearlyFreeSpeechAuthHook.sh
Drop in script for CertBot's --manual-auth-hook switch for DNS Hosted at NearlyFreeSpeech.com
#!/bin/bash
exec 19>/tmp/"${CERTBOT_DOMAIN}"."$(date +%F-%s)".certbot.log
export BASH_XTRACEFD=19
set -x
API_KEY="##NFS-API-KEY##"
LOGIN="##NFS-USER##"
updatedns() {
@eldondev
eldondev / traefik.toml
Created January 12, 2017 06:16
A Treafik configuration file with let's encrypt, https redirection, and hot reloading.
graceTimeOut = 10
traefikLogsFile = "log/traefik.log"
accessLogsFile = "log/access.log"
logLevel = "INFO"
defaultEntryPoints = ["http", "https"]
onDemand = true
OnHostRule = true
[entryPoints]
[entryPoints.http]
address = ":80"
@eldondev
eldondev / WhyAllwinner.md
Last active July 16, 2016 19:34
Why Allwinner

What is this all about

What has been going on?

  • Chips have been getting faster
    • Kind of topped out due to physics, but science advances all the time.
  • Instead, chips have been getting bigger
    • Adding Cores only makes properly architected systems faster, so what to do with all of those extra cores?

Virtualization

  • Makes programmers happy, because we can just say "restart the vm" rather than try to debug that old, poorly written program
@eldondev
eldondev / Dockerfile
Last active June 1, 2022 16:59
zxing dockerfile
FROM java
RUN wget https://oss.sonatype.org/content/repositories/snapshots/com/google/zxing/javase/3.2.2-SNAPSHOT/javase-3.2.2-20151101.162926-3.jar
RUN wget https://oss.sonatype.org/content/repositories/snapshots/com/google/zxing/core/3.2.2-SNAPSHOT/core-3.2.2-20151101.162918-3.jar
RUN wget https://repo1.maven.org/maven2/com/beust/jcommander/1.48/jcommander-1.48.jar
ENTRYPOINT ["java","-cp", "core-3.2.2-20151101.162918-3.jar:javase-3.2.2-20151101.162926-3.jar:jcommander-1.48.jar", "com.google.zxing.client.j2se.CommandLineRunner"]
@eldondev
eldondev / blkparse.py
Created October 25, 2015 05:08
Some basic code to parse some blocks
import struct, sys, io
from hashlib import sha256
from binascii import b2a_hex
blkfile = open("blk00000.dat", 'rb')
block_hashes = [b'\x00' * 32]
trans_hashes = [b'\x00' * 32]
def get_var(reader):
firstbyte = reader.read(1)
if ord(firstbyte) <= 0xfc:
@eldondev
eldondev / cmd
Last active December 4, 2023 16:33
Because everyone needs a good preseed
wget -nc http://ftp.debian.org/debian/dists/jessie/main/installer-amd64/current/images/netboot/debian-installer/amd64/linux
wget -nc http://ftp.debian.org/debian/dists/jessie/main/installer-amd64/current/images/netboot/debian-installer/amd64/initrd.gz
cp -nv ~/.ssh/id_rsa.pub .
qemu-system-x86_64 -machine accel=kvm -kernel linux -initrd initrd.gz -m 1G -smp 2 -append "blacklist=vga16fb fb=false video=false vga=normal auto=true url=http://10.0.2.10:8080/debian-preseed.txt hostname=otto domain=" -net user,guestfwd=:10.0.2.10:8080-cmd:"/bin/busybox httpd -i" -hda /dev/shm/deb.img -net nic -display none
@eldondev
eldondev / ubuntu boot args
Created September 24, 2015 03:15
Ubuntu boot args to prevent modeset
blacklist=vga16fb fb=false video=false vga=normal
@eldondev
eldondev / do.go
Last active August 29, 2015 14:28
Write nginx configs from combined cert/pem files
package main
import (
"crypto/md5"
"crypto/x509"
"encoding/pem"
"fmt"
"io/ioutil"
"log"
"os"
@eldondev
eldondev / gist:2888b96e2f2d3f7b5101
Last active August 29, 2015 14:25
A little gist that will comment out all but a single wpa config in a wpa_supplicant.conf (pass part of the SSID as an arg to the script)
#!/usr/bin/env python
lines = open('/etc/wpa_supplicant/wpa_supplicant.conf').readlines()
groups = [[]]
for line in lines:
if line[0] != '#':
line = '#' + line
groups[-1] += [ line ]
if '}' in line:
groups += [[]]
groups += [[]]
@eldondev
eldondev / check.sh
Created April 10, 2015 04:15
ssh key shenanigans
#!/bin/bash
ADDRESS=`echo $SERVICE_ADDR|cut -f 1 -d\:`
TMP_KEY=/tmp/`uuidgen`
ssh-keygen -t rsa -N "" -f $TMP_KEY
. <(ssh-agent )
ssh-add $TMP_KEY
ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=false -o IdentitiesOnly=true -o IdentityFile=$TMP_KEY root@$ADDRESS date