Skip to content

Instantly share code, notes, and snippets.

@robertgc
robertgc / create-arch-image-raspberry-pi-2.sh
Last active May 8, 2016 21:17 — forked from larsch/create-arch-image-raspberry-pi-2.sh
Shell script that creates a Arch Linux image for the Raspberry Pi 2. Downloads the latest distribution from archlinuxarm.org and creates the flash filesystems including boot partition. Partitions are aligned for typical SD cards and ext filesystem tuned accordingly.
#!/bin/sh -ex
losetup /dev/loop0 && exit 1 || true
image=arch-linux-$(date +%Y%m%d).img
wget -N http://archlinuxarm.org/os/ArchLinuxARM-rpi-2-latest.tar.gz
truncate -s 1G $image
losetup /dev/loop0 $image
parted -s /dev/loop0 mklabel msdos
parted -s /dev/loop0 unit MiB mkpart primary fat32 -- 1 32
parted -s /dev/loop0 set 1 boot on
parted -s /dev/loop0 unit MiB mkpart primary ext2 -- 32 -1
@robertgc
robertgc / pb.sh
Created September 4, 2013 19:55 — forked from cameri/pb.sh
#!/bin/bash
PUSH_URL="https://www.pushbullet.com/api/pushes"
function pb_pushnote {
/usr/bin/curl "${PUSH_URL}" \
-u "$1:" \
-d "device_id=$2" \
-d "type=note" \
-d "title=$3" \