Skip to content

Instantly share code, notes, and snippets.

View craig-m's full-sized avatar
💾

Craig-M craig-m

💾
View GitHub Profile
@craig-m
craig-m / readme.md
Created January 5, 2023 08:49 — forked from eddiewebb/readme.md
Hugo JS Searching with Fuse.js
@craig-m
craig-m / LICENSE.md
Created December 30, 2022 05:27 — forked from sj26/LICENSE.md
Bash retry function

This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.

In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit

@craig-m
craig-m / docker-compose.yml
Created December 30, 2022 02:05
smoke ping
---
version: "2.1"
services:
smokeping:
image: lscr.io/linuxserver/smokeping:latest
container_name: smokeping
environment:
- PUID=1000
- PGID=1000
- TZ=Europe/London
@craig-m
craig-m / 01-readme.md
Last active January 4, 2023 12:17
run transmission torrent client and VPN service under docker compose

container VPN torrent

Run transmission Torrent client with VPN service from containers.

Setup vpn info in gluetun container, seems very popular and covers all the big VPN providers.

setup

Create .env_vpn_live file. There is lots of good info on the gluetun wiki.

@craig-m
craig-m / docker-compose.yml
Last active December 29, 2022 03:01
docker compose wordpress
# Wordpress compose file
#
# use:
#
# $ mkdir -pv wpdata/
# $ docker-compose up
# $ docker-compose ps
# $ docker-compose run --rm wpcli wp option set siteurl http://localhost:8000
# $ docker-compose run --rm wpcli wp option set home http://localhost:8000
# Rocky Linux 9 Vagrant for VirtualBox and LibVirt hosts
Vagrant.require_version ">= 2.2.14"
BOX_BASE_URL = "https://download.rockylinux.org/pub/rocky/9.1/images/x86_64/"
BOX_PREFIX = "Rocky-9-Vagrant-"
BOX_PREFIX_V = "-9.1-20221213.0.x86_64.box"
BOXSHA_VB = "e5430e655dbc142f886d319cfde71a84fd6c4c5a980af27b92cebd07fb3dd01b"
BOXSHA_LV = "205a660088b12bacdfcbe24c49cd1e3d9c4e312cce09c3ddc893e8024299c5a9"
$script_prov_root = <<-SCRIPT
@craig-m
craig-m / 01-README.md
Last active December 29, 2022 13:53
backup all gists with gh command

gist backup with gh

Install the offical Github cli tool from here, login, and then dump all gists:

gh auth login
mkdir ~/gists
cd ~/gists
gh gist list | awk '{print $1}' | xargs -I{} gh gist clone {}
@craig-m
craig-m / 00_README.md
Created December 27, 2022 03:22 — forked from craig-m-unsw/00_README.md
Platform independent way of generating Linux compatible crypt(3) sha512 hashes ($6$ style). For systems (like macOS/OSX) where you can't `mkpasswd -m sha-512`.

Create Linux password hashes from Python

Platform independent way of generating Linux compatible crypt(3) sha512 hashes ($6$ style). For use in cloud-init, preseed files, or altering /etc/shadow. Use on systems where you can't mkpasswd -m sha-512 (which gets installed from sudo apt install whois weirdly on Ubuntu/Deb systems).

setup

We can install Passlib in a virtual environment anywhere we can run Python from with a small script.

So Install Python by downloading or using a package manager (eg sudo apt-get install python3 python3-virtualenv -y).

@craig-m
craig-m / README.md
Last active May 18, 2024 01:49
Packer Vagrant VirtualBox Ubuntu 22.04 install with Cloud-Init

Ubuntu Packer VirtualBox

A simple Packer + Vagrant VirtualBox install of Ubuntu live-server 22.04 (x86) using Cloud-Init, and documentation of my host desktop.

host setup

A fresh install of any supported LTS or the latest Ubuntu desktop version is good. I have tested this on ubuntu 18.04.6 running on an i5-4570 (4 core 3.20GHz) with 16GB of RAM, a nearly 10 year old computer. Get a dedicated machine, it need not be fancy or new.

Update and get setup with some tools + deps first: