Skip to content

Instantly share code, notes, and snippets.

View thalin's full-sized avatar

Zeke Harris thalin

View GitHub Profile
@thalin
thalin / justfile
Created May 10, 2025 17:36
script to generate ssh keys, update .sops.yaml, and install a target host with nixos-anywhere using generated ssh keys
add host agekey:
sed -i "/keys:/a\ - &{{host}} {{agekey}}" .sops.yaml
sed -i "/- age:/a\ - *{{host}}" .sops.yaml
update:
sops updatekeys yoursecrets.yaml
@thalin
thalin / deathstar2.txt
Last active March 13, 2020 23:56
deathstar2
root@deathstar2:~# cat zpool_create_command
zpool create -f -o ashift=9 storage raidz2 /dev/sda /dev/sdb /dev/sdc /dev/sdd raidz2 /dev/sde /dev/sdf /dev/sdg /dev/sdh cache /dev/nvme0n1 log mirror /dev/nvme1n1 /dev/nvme2n1
root@deathstar2:~# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 931.5G 0 disk
├─sda1 8:1 0 931.5G 0 part
└─sda9 8:9 0 8M 0 part
sdb 8:16 0 931.5G 0 disk
├─sdb1 8:17 0 931.5G 0 part
└─sdb9 8:25 0 8M 0 part
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
from os import walk, rmdir, remove
from os.path import isdir, isfile, getsize
nuked = 1
while nuked > 0:
nuked = 0
for dirpath, dirnames, filenames in walk('.'):
if dirnames == [] and filenames == []:
if isdir(dirpath):
rmdir(dirpath)
@thalin
thalin / mkpw.py
Created May 7, 2011 22:15
Python password generator.
from optparse import OptionParser
from getpass import getpass
import base64, hmac, hashlib
'''
This small script is meant to generate long passwords by hashing a secret
password and a site identifier. The intent is to create a usable interface
for maintaining longer, somewhat more secure (?) passwords.
The idea here is that you remember a 'master' password and use it to generate
set bg=dark
set expandtab smarttab shiftwidth=4
set softtabstop=4
set backspace=2
colorscheme elflord
syntax on
from pyevolve import G1DList
from pyevolve import GSimpleGA
from pyevolve import Selectors
from pyevolve import Mutators
from pyevolve import Initializators
from pyevolve import GAllele
def eval_func(chromosome):
score = 0.0
from django.db import models
from django.contrib.admin.models import User
from django_extensions.db.models import *
class Project(TimeStampedModel, TitleSlugDescriptionModel):
"""
Project data.
"""
admins = models.ManyToManyField(User, null=True, related_name='admins_projects')
users = models.ManyToManyField(User, null=True, related_name='projects')
import os
print "Hello World"
os.path.join('/this/is/a', 'test')