Skip to content

Instantly share code, notes, and snippets.

@jbott
jbott / build_falood_file_system_in_nix.md
Last active March 11, 2024 08:28
Building falood/file_system mac_listener in a nix environment

Building the Elixir package falood/file_system mac_listener binary in a nix environment

This confused me, so I'm documenting my workaround, which is probably not the correct workaround, but it seemed to work (leaving non-persistent state, lol).

When in a shell with mix and clang provided via nix, the file_system package fails to build the mac_listener binary via clang, with the error (reproduced in a shell):

$ clang -framework CoreFoundation -framework CoreServices -Wno-deprecated-declarations c_src/mac/*.c -o priv/mac_listener
In file included from c_src/mac/cli.c:2:
In file included from c_src/mac/cli.h:4:
@jbott
jbott / install.sh
Last active August 22, 2023 19:09 — forked from mx00s/install.sh
NixOS install script based on @grahamc's "Erase Your Darlings" blog post
#!/usr/bin/env bash
#
# NixOS install script synthesized from:
#
# - Erase Your Darlings (https://grahamc.com/blog/erase-your-darlings)
# - ZFS Datasets for NixOS (https://grahamc.com/blog/nixos-on-zfs)
# - NixOS Manual (https://nixos.org/nixos/manual/)
# - Original gist by @nuxeh (https://gist.github.com/nuxeh/35fb0eca2af4b305052ca11fe2521159)
#
  1. Download latest Miniconda for Python 2.7
https://repo.continuum.io/miniconda/Miniconda2-latest-MacOSX-x86_64.sh
  1. Open terminal

  2. Change to download folder location

@jbott
jbott / ubnt_pkt_deconstruct.py
Last active June 12, 2022 19:07
De/construct ubnt discovery packets. Useful for spoofing ubnt discovery packets when on a VPN because this AmpliFi Wifi app is dumb and doesn't let you specify an IP address to connect to.
"""
De/construct ubnt discovery packets
references:
- https://github.com/nitefood/python-ubnt-discovery
- https://gist.github.com/trhura/5998584
"""
from base64 import b64decode, b64encode
from enum import IntEnum
@jbott
jbott / download.sh
Created December 7, 2013 21:20
Script to update minecraft server to latest version, either snapshot or release
#!/bin/sh
# Can be snapshot or release
DEFAULTREVISION=release
# Pull out latest snapshot version
REVISION=${1-$DEFAULTREVISION}
REGEX="(?<=$REVISION\": \").*?[^\\\\](?=\")"
VERSION=`curl -silent "http://s3.amazonaws.com/Minecraft.Download/versions/versions.json" | grep -Po "$REGEX"`
if [ "$VERSION" = "" ]; then
echo "Invalid Version"; exit
# Configure vim keybindings for switching panes
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Configure ctrl-vim keybindings for switching windows
bind C-h previous-window
bind C-l next-window
@jbott
jbott / .vimrc
Created May 21, 2019 18:01
Dotfiles
" Get the defaults that most users want.
source $VIMRUNTIME/defaults.vim
if &t_Co > 2 || has("gui_running")
" Switch on highlighting the last used search pattern.
set hlsearch
endif
" Add optional packages.
"

Keybase proof

I hereby claim:

  • I am jbott on github.
  • I am jbott (https://keybase.io/jbott) on keybase.
  • I have a public key ASAFNpW_jSPXfcC0WKxhCBfQ0UCQUtBqVfZPxhhbBXTGrwo

To claim this, I am signing this object:

" When started as "evim", evim.vim will already have done these settings.
if v:progname =~? "evim"
finish
endif
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}