Skip to content

Instantly share code, notes, and snippets.


gregf gregf

View GitHub Profile
View mattermost.diff
evaluating file '/nix/store/csrmkvlyfikij2h0kdqsgbkmqlsjspwg-nix-2.3.6/share/nix/corepkgs/derivation.nix'
evaluating file '/home/gregf/nixpkgs/lib/minver.nix'
evaluating file '/home/gregf/nixpkgs/pkgs/top-level/impure.nix'
evaluating file '/home/gregf/nixpkgs/pkgs/top-level/default.nix'
evaluating file '/home/gregf/nixpkgs/pkgs/stdenv/booter.nix'
evaluating file '/home/gregf/nixpkgs/lib/default.nix'
evaluating file '/home/gregf/nixpkgs/lib/fixed-points.nix'
evaluating file '/home/gregf/nixpkgs/lib/lists.nix'
evaluating file '/home/gregf/nixpkgs/pkgs/stdenv/default.nix'
evaluating file '/home/gregf/nixpkgs/lib/systems/default.nix'
#!/usr/bin/env bash
set -euo pipefail
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit 1
if [ -z $DISK ]; then
View configuration.nix
# 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, ... }:
imports =
[ # Include the results of the hardware scan.
gregf /
Last active Oct 19, 2020
Battery script for Polybar on FreeBSD
battery_percent=$(acpiconf -i 0 | grep -i "Remaining capacity:" | awk -F " " '{print $3}' | sed 's/%//g')
tstate=$(acpiconf -i 0 | grep -i "State:" | awk -F " " '{print $2}')
remaining_time=$(acpiconf -i 0 | grep -i "Remaining time:" | awk -F " " '{print $3}')
#echo $battery_percent
#echo $state
#echo $remaining_time
View tmux.conf
setw -g automatic-rename on
set -g visual-bell off
# Increase scrollback lines
set -g history-limit 9999
# Use Vi mode
setw -g mode-keys vi
setw -g status-keys vi
View gist:593af703721a7e341c7c5f9db36c4126
root@fluffy:~ # portsnap fetch extract && portsdb -u
Looking up mirrors... 6 mirrors found.
Fetching snapshot tag from done.
Latest snapshot on server matches what we already have.
No updates needed.
files/89293e86814c7477ec31df743d726b56aef8fab65a1693c55fe58c170d1ff738.gz not found -- snapshot corrupt.
#!/usr/bin/env bash
dosbox -conf dosbox.conf -conf launcher.conf
View smtpd.conf
# Enable queue compression and encryption
# (create key with 'openssl rand -hex 16')
queue compression
pki cert "/etc/letsencrypt/live/"
pki key "/etc/letsencrypt/live/"
# Define tables for:
# - aliases
# - domains
gregf / holidays2org.rb
Last active Dec 20, 2019
Generates a org-mode agenda file with US Holidays for the current year
View holidays2org.rb
#!/usr/bin/env ruby
require 'ical_importer'
ical_url = ""
holiday_file = "~/org/"
current_year =
open(File.expand_path(holiday_file), 'w') do |f|
f.puts "* #{current_year} Holidays"
set -euf -o pipefail
# Host with username
# Dir name on the server backups will all live under
# How many days worth of backups to keep
You can’t perform that action at this time.