I hate GMail, but sometimes you gotta. They're notoriously awful at deleting lots of messages at once, as their own search engine will tell you. I had more than 1,000,000 messages I needed to purge and couldn't do it using their own tools. So I wrote my own.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -eu | |
container="$(basename "$0")" | |
program="$1" | |
shift | |
# logname returns the user calling sudo | |
host_user="$(logname)" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
## this is a total hack. acbuild needs systemd-nspawn. initially, I tried | |
## running the go agent in a rkt container, but failed for reasons I forget | |
## right now (overlayfs problems?). then I ran into more problems with systemd- | |
## nspawn on CentOS 7.1, and I forget the origin. we're getting closer: in | |
## CentOS 7.2 I'm able to run acbuild as root outside of a container. but when | |
## running within the go agent, systemd-nspawn is killed for no discernable | |
## reason. so, we're back to faking out acbuild by providing this systemd- | |
## nspawn-alike. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker_root=/var/lib/docker/btrfs | |
subvolumes=subvolumes | |
docker_image=aputs/archlinux | |
tar_file=/tmp/image.tar.gz | |
# tar | |
cd $docker_root/$subvolumes/$(docker inspect --format='{{.Id}}' $docker_image) | |
tar --exclude={'.','..'} -Pcvzf $tar_file .* * |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
set -o pipefail | |
function list_tars { | |
ROOT=$1 | |
TAG=${2:-latest} | |
BASE=$(sed -e 's/.*{\(".*"\)}.*/\1/g' "${ROOT}/repositories" | sed 's/"//g' | awk -v RS=',' -F: '/^'${TAG}'/ {print $2}') | |
CUR=$BASE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TGZ=http://hkg.mirror.rackspace.com/archlinux/iso/2014.11.01/archlinux-bootstrap-2014.11.01-x86_64.tar.gz | |
ROOT=/var/lib/archlinux | |
TMPROOT=/tmp/archlinux | |
sudo mkdir -p ${TMPROOT} | |
wget "${TGZ}" -O- | sudo tar --strip-components=1 -C ${TMPROOT} -Pxzf- | |
sudo sed --in-place s/^#//g ${TMPROOT}/etc/pacman.d/mirrorlist | |
sudo btrfs subvolume delete ${ROOT} | |
sudo btrfs subvolume create ${ROOT} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -x | |
control_c() | |
# run if user hits control-c | |
{ | |
echo -en "\n*** Ouch! Exiting ***\n" | |
exit $? | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
log=3 | |
fence="s/.*/ &/" | |
echo "# How to make a new base image" | |
echo "for containers." | |
echo | |
echo "Create a new logical volume:" | |
echo | |
lvcreate --help 2> /dev/null | head -n $log | sed "$fence" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Match] | |
Name=host* | |
[Network] | |
DHCP=yes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import argparse | |
import contextlib | |
import ctypes | |
import dbus | |
import errno | |
import fcntl | |
import io | |
import os | |
import pickle |