Skip to content

Instantly share code, notes, and snippets.

@johnko
johnko / gist:66515a2db2aa22aa51bd
Last active May 6, 2024 09:31
How to iPXE boot from http iso on www.vultr.com

If your custom iso is not mounting, and your console is at an iPXE shell, you can:

initrd http://mfsbsd.vx.sk/files/iso/10/amd64/mfsbsd-se-10.1-RELEASE-amd64.iso

While the iso is downloading, vultr's iPXE does not include memdisk, so we have to upload it ourselves to another host.

Here's one I found public, though I wouldn't recommend using it: http://preseed.panticz.de/ipxe/memdisk

@johnko
johnko / instructions.md
Last active March 21, 2024 18:06
Installing FreeBSD on a USB drive with ZFS using bsdinstall unattended

Installing FreeBSD on a USB drive with ZFS using bsdinstall unattended

I typically wrap all these commands into a shell script that I can reuse, but here they are in steps.

Please read through all the instructions before actually performing the commands, just to avoid any surprises

Requirements:

  • careful typing and copy/paste skills
  • USB drive (8 GB+ ?) Make sure you don't need anything on that drive
@johnko
johnko / ttc2ttf.py
Created September 4, 2013 21:01 — forked from kayahr/ttc2ttf.py
ttc2ttf
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#First released as C++ program by Hiroyuki Tsutsumi as part of the free software suite “Beer”
#I thought porting it to Python could be both a challenge and useful
from sys import argv, exit, getsizeof
from struct import pack_into, unpack_from
def ceil4(n):

Add the following chunk to your existing ISC dhcpd.conf file.

if exists user-class and ( option user-class = "iPXE" ) {
    filename "http://boot.smidsrod.lan/bootstrap.ipxe";
}
else {
    filename "undionly.kpxe";
}

(or see https://gist.github.com/4008017 for a more elaborate setup

@johnko
johnko / ssh-multi.sh
Last active July 28, 2022 15:34 — forked from dmytro/ssh-multi.sh
a script to ssh multiple servers over multiple tmux panes
#!/bin/sh
# ssh-multi
# D.Kovalov
# Based on http://linuxpixies.blogspot.jp/2011/06/tmux-copy-mode-and-how-to-control.html
# Modified by johnko https://gist.github.com/johnko/a8481db6a83ec5ea2f37
# a script to ssh multiple servers over multiple tmux panes
starttmux() {
@johnko
johnko / _aws_delete-default-vpc.sh
Last active January 30, 2022 09:56 — forked from jokeru/aws_delete-default-vpc.sh
Script to delete all AWS default VPCs from all regions using AWS CLI
#/usr/bin/env bash
set -euo pipefail
exit 1
# Need the SystemAdministrator AWS SSO / IAM PermissionSet
for region in $(aws ec2 describe-regions --query 'Regions[].RegionName' --output text); do
echo "* Region ${region}"
@johnko
johnko / zfs_health.sh
Created August 30, 2018 05:38 — forked from petervanderdoes/zfs_health.sh
ZFS Health Check Script
#! /usr/local/bin/bash
#
# Calomel.org
# https://calomel.org/zfs_health_check_script.html
# FreeBSD 9.1 ZFS Health Check script
# zfs_health.sh @ Version 0.15
# Check health of ZFS volumes and drives. On any faults send email. In FreeBSD
# 10 there is supposed to be a ZFSd daemon to monitor the health of the ZFS
# pools. For now, in FreeBSD 9, we will make our own checks and run this script
@johnko
johnko / _notes.md
Last active February 16, 2018 12:04
Experiments with FreeBSD on Intel Compute Stick

Experiments with FreeBSD on Intel Compute Stick

Ingredients

Acquire an Intel Compute Stick with Atom CPU and 2GB of RAM, 32GB of storage.

The product code I got is BOXSTCK1A32WFC.

You'll also need:

@johnko
johnko / ubuntu-1404-preseed
Created July 14, 2017 21:44 — forked from scottslowe/ubuntu-1404-preseed
This is a preseed file, written for Ubuntu Server 14.04.2, that provides a fully automated installation (assuming the presence of a PXE boot infrastructure and a local HTTP server to provide the installation files).
# Ubuntu Server automated installation
# by Scott Lowe (scott.lowe@scottlowe.org)
d-i debian-installer/locale string en_US
d-i console-setup/ask_detect boolean false
d-i keyboard-configuration/layoutcode string us
d-i netcfg/choose_interface select eth0
d-i netcfg/get_hostname string hostname
d-i netcfg/get_domain string domain.com
d-i netcfg/wireless_wep string