Skip to content

Instantly share code, notes, and snippets.

View imsmith's full-sized avatar

Ian Smith imsmith

  • Seattle
  • 16:20 (UTC -07:00)
View GitHub Profile
@imsmith
imsmith / README.md
Created May 7, 2020 19:00 — forked from pamolloy/README.md
Mesh network using VXLAN over Wireguard
@imsmith
imsmith / create-cloud-template.sh
Created April 6, 2021 20:27 — forked from chriswayg/create-cloud-template.sh
This script will download a cloud image of many Linux distros and create a Proxmox 6 KVM template from it.
#!/bin/bash
set -o errexit
clear
printf "\n*** This script will download a cloud image and create a Proxmox VM template from it. ***\n\n"
### HOW TO USE
### Pre-req:
### - run on a Proxmox 6 server
### - a dhcp server should be active on vmbr1
@imsmith
imsmith / pandoc.Makefile
Created May 21, 2021 01:25 — forked from bertvv/pandoc.Makefile
Makefile for Markdown -> PDF using pandoc
# Generate PDFs from the Markdown source files
#
# In order to use this makefile, you need some tools:
# - GNU make
# - Pandoc
# - LuaLaTeX
# - DejaVu Sans fonts
# Directory containing source (Markdown) files
source := src
@imsmith
imsmith / bookmarks_from_sql.py
Created June 9, 2021 02:16 — forked from iafisher/bookmarks_from_sql.py
Programmatically access your Firefox bookmarks
"""
A script to automatically export bookmarks from Firefox's SQLite database.
There does not seem to be a programmatic way to get Firefox to export its bookmarks in
the conventional HTML format. However, you can access the bookmark information directly
in Firefox's internal database, which is what this script does.
Always be careful when working with the internal database! If you delete data, you will
likely not be able to recover it.
@imsmith
imsmith / k3s_on_alpine.md
Created June 20, 2021 00:46 — forked from ruanbekker/k3s_on_alpine.md
Install k3s on Alpine Linux
$ apk add --no-cache curl
$ echo "cgroup /sys/fs/cgroup cgroup defaults 0 0" >> /etc/fstab

$ cat > /etc/cgconfig.conf <<EOF
mount {
  cpuacct = /cgroup/cpuacct;
  memory = /cgroup/memory;
  devices = /cgroup/devices;
  freezer = /cgroup/freezer;
@imsmith
imsmith / cloudflare-ddns-update.sh
Created May 24, 2022 21:25 — forked from Tras2/cloudflare-ddns-update.sh
A bash script to update a Cloudflare DNS A record with the external IP of the source machine
#!/bin/bash
# A bash script to update a Cloudflare DNS A record with the external IP of the source machine
# Used to provide DDNS service for my home
# Needs the DNS record pre-creating on Cloudflare
# Proxy - uncomment and provide details if using a proxy
#export https_proxy=http://<proxyuser>:<proxypassword>@<proxyip>:<proxyport>
# Cloudflare zone is the zone which holds the record
@imsmith
imsmith / nsclient_update.sh
Created May 24, 2022 21:26 — forked from mbrownnycnyc/nsclient_update.sh
script for use with `nsupdate` to update linux client DNS on a DNS server... in this instance, I am targeting a Windows Server DNS server 2003/2008/2012+. I have manually created the PTR and A records once, and granted the Everyone ACE the "Write" permission in the DACL of the PTR and A records.
#!/bin/sh
#original from http://community.spiceworks.com/topic/262635-linux-does-not-register-on-the-windows-ad-dns
# reply of Phil6196 Oct 1, 2012 at 12:41 AM (EDT)
ADDR=`/sbin/ifconfig eth0 | grep 'inet addr' | awk '{print $2}' | sed -e s/.*://`
HOST=`hostname`
echo "update delete $HOST A" > /var/nsupdate.txt
echo "update add $HOST 86400 A $ADDR" >> /var/nsupdate.txt
echo "update delete $HOST PTR" > /var/nsupdate.txt
echo "update add $HOST 86400 PTR $ADDR" >> /var/nsupdate.txt
nsupdate /var/nsupdate.txt
@imsmith
imsmith / vscode-extensions.md
Last active December 10, 2022 06:27
export installed extensions from vscode on the command line
code --list-extensions --show-versions
@imsmith
imsmith / obsidian-extensions.md
Created December 10, 2022 06:58
get obsidian extensions

in <vault>/.obsidian/plugins und the following command

find . -name manifest.json -prune -exec jq -r '"* [\\(.name)](\\(.authorUrl))", "  - \\(.description)"' {} \;
@imsmith
imsmith / prompt_generator.py
Created August 18, 2023 03:31
GPT-4 prompt generator for DALL-E Space Images
from apscheduler.schedulers.background import BackgroundScheduler
from apscheduler.jobstores.base import JobLookupError
from app import write_log
from models import Prompt, Image
import random
from flask import Flask
import openai
import models
from extensions import db
import time