Skip to content

Instantly share code, notes, and snippets.

ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDEgjAbtKHYYzJuHiOl5quUIcpawlEWPXOp+qTotT7H76jCgGgLKCMN2ThYRhfoXKdTMRnIf3HJKedNHDGby2ERZ9eQ9uvtKE5bv2mcbR0QDbxHfoLPMNmZXzOnfifLRaxon+2JzMsL2vHnzsDjI34IXpgeZnCRScddTCz2xIZAk4/tn82Y/WSNZGbCJAAeZBIL+NAVUkvvPJ+fm54pKKdnM9isSPSMcGszuSa0bxrB3JWGWFjmItPBgXKhYN2Rd14cTXlo+mQOOZwazzoTirpZ3QFWbRPjMIQXdx3uSzHGUz6njzFZ6KrMQCG1viYjCmTQYr5ARk3lQbbs9w14dQYh
@rickardrosen
rickardrosen / zfs-load-key.service
Created December 7, 2019 13:59
Load ZFS encryption keys: /etc/systemd/system/zfs-load-key.service
[Unit]
Description=Load encryption keys
DefaultDependencies=no
Before=zfs-mount.service
After=zfs-import.target
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/bin/bash -c '/usr/bin/zfs load-key -a'
@rickardrosen
rickardrosen / locate_drive
Last active July 5, 2019 20:49
Locate drive
#!/bin/bash
udevadm info --query=all --name=/dev/$1 | grep -A3 -B9 SERIAL
pos=($(sas2ircu 0 display | grep -B9 $(udevadm info --query=all --name=/dev/$1 | grep ID_SCSI_SERIAL | awk -F "=" '{print $2}') | grep -Ei 'Enclosure|Slot' | awk -F ":" '{print $2}' | tr -d [:blank:]))
sas2ircu 0 locate ${pos[0]}:${pos[1]} ON
@rickardrosen
rickardrosen / configuration.nix
Created November 5, 2017 17:05
Mac mini headless spotify
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).
{ config, pkgs, ... }:
{
nix.nixPath = [ "nixpkgs=/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs" "nixos-config=/etc/nixos/configuration.nix" "/nix/var/nix/profiles/per-user/root/channels" ];
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
@rickardrosen
rickardrosen / sp
Created November 4, 2017 18:51 — forked from wandernauta/sp
sp is a command-line client for Spotify's dbus interface. Play, pause, skip and search tracks from the comfort of your command line.
#!/usr/bin/env bash
#
# This is sp, the command-line Spotify controller. It talks to a running
# instance of the Spotify Linux client over dbus, providing an interface not
# unlike mpc.
#
# Put differently, it allows you to control Spotify without leaving the comfort
# of your command line, and without a custom client or Premium subscription.
#