Skip to content

Instantly share code, notes, and snippets.

@mutability
mutability / OVERLAYFS
Last active May 30, 2024 16:46
readonly root via overlayfs
- install the two shellscripts into the appropriate places under /etc/initramfs-tools
- run update-initramfs
- put "overlay=yes" on the kernel command line
- reboot
With the overlay in place, the real root is mounted readonly on /ro.
Only the root fs is changed, other filesystems are mounted normally.
Remove "overlay=yes" (or change it to something other than yes) and reboot to go back to readwrite.
(This probably means that you want the commandline config to live somewhere other than on the root fs, e.g. under /boot)
@ParagDoke
ParagDoke / create-centos-box.bash
Last active November 2, 2020 15:21
Bash script to create a bare bones CentOS 7 VirtualBox VM with guest additions, as a local Vagrant box
#!/bin/bash -e
echo "Starting `basename $0`"
box_os=CentOS
box_os_version=7.1
echo "Searching for grep ..."
which grep
echo "Searching for sed ..."
which sed
@wouterd
wouterd / Vagrantfile
Last active October 21, 2018 12:17
Vagrant file to setup a 3-server mongo replica set and a script to intialize the mongod cluster
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
$mongoInitScript = <<-"SCRIPT"
YUM_REPO_CONFIG_PATH="/etc/yum.repos.d/mongodb.repo"
tee $YUM_REPO_CONFIG_PATH <<-"EOF"