This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
block_global: false | |
ssl_insecure: true | |
connection_strategy: lazy | |
keep_alive: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# copy database to avoid locks and messing up real database | |
$ cd /tmp | |
$ cp ~/Pictures/Photos\ Library.photoslibrary/database/Photos.sqlite photosdbcopy | |
# get favorites | |
$ sqlite3 photosdbcopy 'select a.ZUUID, cm.ZORIGINALFILENAME from ZASSET a JOIN ZCLOUDMASTER cm ON a.ZMASTER = cm.Z_PK where a.ZFAVORITE=1 limit 10;' | |
E34F59CF-332D-40EB-80B2-48EDD30D5122|IMG_0125.JPG | |
BFDEF572-1E73-4187-99CD-F3B22A8A0349|IMG_0444.JPG | |
21D1788D-D0A0-4C03-BD8E-BE32B11C179D|IMG_0490.JPG | |
12755BB5-C836-4ED0-8915-2E0BE685E9B4|IMG_0521.JPG |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
schema = pkgs.stdenvNoCC.mkDerivation { | |
name = "schema"; | |
src = schemaSrc; | |
nativeBuildInputs = [ postgres ]; | |
installPhase = '' | |
mkdir $out | |
export PGDATA="$out" | |
export PGHOST="$out" | |
export PGUSER=postgres | |
export PGDATABASE=postgres |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ config, pkgs, ... }: | |
{ | |
imports = [ <nixpkgs/nixos/modules/virtualisation/amazon-image.nix> ]; | |
ec2.hvm = true; | |
nix.settings.experimental-features = [ "nix-command" "flakes" ]; | |
networking.hostName = "nixos"; | |
security.sudo.wheelNeedsPassword = false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
parted /dev/vda -- mklabel gpt | |
parted /dev/vda -- mkpart primary 1GiB -8GiB | |
parted /dev/vda -- mkpart primary linux-swap -8GiB 100% | |
parted /dev/vda -- mkpart ESP fat32 1MiB 512MiB | |
parted /dev/vda -- set 3 esp on | |
mkfs.ext4 -L nixos /dev/vda1 | |
mkswap -L swap /dev/vda2 | |
mkfs.fat -F 32 -n boot /dev/vda3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
### Generate a list of iptables rules to redirect port 53 traffic (tcp+udp) and echo to console. | |
### This version of the script does NOT apply anything to the iptables on the machine it is run on. | |
### IPv4 DNS traffic is redirected to $PRIMARYDNS_IPV4 on port 53 | |
### IPv6 DNS traffic is redirected to $PRIMARYDNS_IPV6 on port 53 | |
# This is the DNS that you want clients to be forced to use on your network | |
# If you have a secondary DNS, add it to the whitelist below and it will still work. | |
PRIMARYDNS_IPV4="192.168.1.12" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# switch with `nix run . switch -- --flake .` | |
# https://www.chrisportela.com/posts/home-manager-flake/ | |
{ | |
description = "My Home Manager Flake"; | |
inputs = { | |
nixpkgs.url = "nixpkgs"; | |
unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable"; | |
unstable_nvim.url = "github:GaetanLepage/nixpkgs/neovim"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "pg" | |
require "ssh2" | |
# Add an initlizer that directly sets the socket | |
class PQ::Connection | |
def initialize(@soc, @conninfo) | |
end | |
end | |
# Add a new crystal-pg database context that can store a proc that returns a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ config, pkgs, ... }: | |
# https://mipmip.github.io/home-manager-option-search/ | |
{ | |
# Home Manager needs a bit of information about you and the | |
# paths it should manage. | |
home = { | |
stateVersion = "22.05"; | |
username = "will"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ENV["COUNT_QUERIES"] | |
require "stringio" | |
QUERIES = StringIO.new | |
RSpec.configure do |config| | |
config.before(:suite) do | |
Sequel::Model.db.loggers << Logger.new(QUERIES) | |
end | |
config.after(:suite) do |
NewerOlder