Skip to content

Instantly share code, notes, and snippets.

@abtrout
abtrout / encrypted_raid1.md
Last active March 4, 2024 20:16
Encrypted RAID1

Encrypted RAID1 array

This document details how to make an encrypted RAID1 array from two devices, and was pieced together from Archlinux and Debian wikis.

Disks

I have 2x1TB drives that I want to put in a RAID1 array so that data is duplicated on both devices for redundancy.

The drives are already partitioned.

@abtrout
abtrout / redis-pipe.md
Last active August 11, 2023 03:29
Bash script to prepare Redis commands for mass insertion via `redis-cli --pipe`

Redis supports mass insert via redis-cli --pipe, but commands need to be written in redis protocol. For more details, check out the Redis mass insertion page. This script takes care of converting ordinary redis commands to redis protocol.

#!/usr/bin/env bash

while read CMD; do
  # each command begins with *{number arguments in command}\r\n
  XS=($CMD); printf "*${#XS[@]}\r\n"
  # for each argument, we append ${length}\r\n{argument}\r\n
 for X in $CMD; do printf "\$${#X}\r\n$X\r\n"; done
@abtrout
abtrout / pass.md
Created July 8, 2014 14:51
Using password-store with git repository synching

Password-store keeps your passwords (or any other sensitive information) saved in GnuPG encrypted files organized in ~/.password-store. For more information about GPG, consult the GNU Privacy Handbook.

Getting started

To get started, install pass and generate a keypair.

$ brew install pass
$ gpg --gen-key
$ gpg --list-keys
@abtrout
abtrout / alarm_rpi.md
Last active August 29, 2015 13:59
ArchlinuxARM on Raspberry PI: initial setup notes

These are some notes from installing Archlinux ARM on my raspberry pi.

Expand the root partition.

The default root partition is much smaller than my 32gb SD card. We can resize it with fdisk as suggested in these useful forum posts on the subject.

# fdisk /dev/mmcblk0

Welcome to fdisk (util-linux 2.24.1).
@abtrout
abtrout / alarm_chromebook.md
Last active January 24, 2023 19:15
ArchlinuxARM on HP chromebook 11

Install onto USB

Make sure that developer mode (Hold ESC + Refresh and poke the power button, then ctrl+D when not prompted) and USB booting have been enabled (crossystem dev_boot_usb=1). Then reboot.

Follow these instructions until step 10, where we'll make some substitutions. Our directions will vary slightly because we need HP (spring) variants of the Samsung (snow) kernel and uboot. These can be found in a dropbox link in this thread.

Before we reboot, we install a few packages in chroot. Suppose that /dev/sda3 is mounted at /tmp/root.

$ cp /etc/resolv.conf /tmp/root/etc/resolv.conf