Skip to content

Instantly share code, notes, and snippets.

@bitsandbooks
bitsandbooks / ubuntu-focal-autoinstall-virtualbox.md
Last active December 23, 2025 07:27
Ubuntu 20.04 with Autoinstall using VirtualBox [DRAFT]

Ubuntu 20.04 + Autoinstall + VirtualBox

Intro

This guide will explain how to set up a [VirtualBox][] VM running [Ubuntu 20.04][] and, using the new [autoinstall][] tool and cloud-init, install OpenSSH server, add a group and a user, who can then connect to the machine via SSH. This was done on a 2016 MacBook Pro running macOS 10.15 "Catalina" and VirtualBox 6.1.6 (with the VirtualBox Guest Additions installed).

You will also need a group name, a username, a password hash and an SSH key pair.

How Autoinstall Works

@bitsandbooks
bitsandbooks / code.py
Last active February 16, 2020 20:23
Simple Game Show Buzzer in CircuitPython for Circuit Playground Express
#!/usr/bin/env python
"""
Simple Game Show Buzzer in CircuitPython for Circuit Playground Express
Author: Rob Dumas
License: MIT
Copyright 2020 Elk Grove Village Public Library.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
@bitsandbooks
bitsandbooks / el-user.yml
Last active June 17, 2021 19:40
Elk Lab Ansible
---
- hosts: 127.0.0.1
connection: local
tasks:
- name: ensure personalized dconf settings
dconf:
key: "{{ item.key }}"
value: "{{ item.value }}"
state: present
@bitsandbooks
bitsandbooks / update-container.sh
Last active September 18, 2018 00:02
Update Tautulli Docker Container
#!/bin/sh
# by Rob Dumas
# When Tautulli tells me there's a new version available, I run this
# shell sript to remove the old container and create a new one.
# License: 2-clause BSD
CONTAINER_NAME="mycontainer"
CONTAINER_ID=$(docker ps -aqf "name=$CONTAINER_NAME")
CONTAINER_UID=1000
CONTAINER_GID=2000
# Public key for rdumas@egvpl.org
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBFvFOrIBEADeKGpBMxO2zgUjcRWg7xCgi1Z23DIJgZe81Rkfvq8axDyuEC40
XrUSL+i8ziXaTyQwPTFmKP/2HNhXFPl+ZzjYEGblw2nUtwusegiQOzyD1VUv2LRP
wUHk5sdiNTwed/qQuu3hzXsf2A3TrGUgw+1G80jLqNRHCZzwVf3a//OGIcHTR1JC
R/GdD1oly6jzQw9tWtzXiUZvEC0MlHYdhxFWXaZCrWSoMbahQLx79mD8zm8NZOKE
FQyo7Hk8aq1o5uCHA/z6v6ui1tg6jOuQSdFPzHGNM0iKRiu/ThvCgQwbX327tAmt
ldb88LqRAqDvj7zfNIqFSuQvnlVRGe5HpNiRi+GZ73ksODEEQjtjOcm+TnjOri2r
jLees36lFLPaxaIXnO//uPG6lZw1sBsc2DoYRV4Fau2z4LcBEaYCztEdAfeD4iu2
---
- name: ensure presence of user
user:
name: "{{ item.username }}"
uid: "{{ item.username }}"
password: "{{ item.passwd }}"
comment: "{{ item.comment }}"
shell: "{{ item.shell }}"
group: "{{ item.group }}"
groups: "{{ item.groups }}""
#cloud-config
groups:
- foo
users:
- default # use the default users/groups that come with this o.s.
- name: bar # create a user named bar
gecos: Bar User # comment field. use for full name, room number, etc.
primary-group: foo # set bar's primary group to foo
groups: sudo # also add bar to the sudo group
@bitsandbooks
bitsandbooks / bootstrap-cloud.sh
Last active February 7, 2018 05:55
Server Bootstrapper
#!/bin/sh
/usr/bin/apt update
/usr/bin/apt -y upgrade
/usr/bin/apt install -y ansible
/usr/bin/apt -y autoremove
import os
import time
import subprocess
import sys
fileList = []
rootdir = raw_input("Root Dir: ")
for root, subFolders, files in os.walk(rootdir):
for file in files:
theFile = os.path.join(root,file)
@bitsandbooks
bitsandbooks / lastbusers.txt
Last active December 16, 2016 21:56
Lastb Failed Users
List of Usernames and # of Attempts to
Log In Over the Last Few Weeks
Att, User
– – – – –
4974 root
320 admin
316 oracle
248 test
218 postgres