Skip to content

Instantly share code, notes, and snippets.

Avatar

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'
View install.sh
#!/usr/bin/env bash
set -euo pipefail
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit 1
fi
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.
./hardware-configuration.nix
@gregf
gregf / battery.sh
Last active Oct 19, 2020
Battery script for Polybar on FreeBSD
View battery.sh
#!/usr/local/bin/bash
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 portsnap.FreeBSD.org mirrors... 6 mirrors found.
Fetching snapshot tag from ec2-ap-southeast-2.portsnap.freebsd.org... done.
Latest snapshot on server matches what we already have.
No updates needed.
/usr/ports/.arcconfig
files/89293e86814c7477ec31df743d726b56aef8fab65a1693c55fe58c170d1ff738.gz not found -- snapshot corrupt.
View launcher.sh
#!/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 mail.hugops.pw cert "/etc/letsencrypt/live/mail.hugops.pw/fullchain.pem"
pki mail.hugops.pw key "/etc/letsencrypt/live/mail.hugops.pw/privkey.pem"
# Define tables for:
# - aliases
# - domains
@gregf
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 = "https://www.calendarlabs.com/ical-calendar/ics/76/US_Holidays.ics"
holiday_file = "~/org/holidays.org"
current_year = DateTime.now.year
open(File.expand_path(holiday_file), 'w') do |f|
f.puts "* #{current_year} Holidays"
View backup.sh
#!/bin/bash
set -euf -o pipefail
# Host with username
HOST="sftp://backups@somehost.io"
# Dir name on the server backups will all live under
LOC="backups"
DUP="/usr/bin/duplicity"
# How many days worth of backups to keep
You can’t perform that action at this time.