Skip to content

Instantly share code, notes, and snippets.

@pbrisbin
pbrisbin / headache.md
Created October 27, 2014 18:55
ZSH startup file headaches

Default behavior dictates the following order for ZSH startup files:

  • /etc/zshenv
  • ~/.zshenv
  • /etc/zprofile (if login shell)
  • ~/.zprofile (if login shell)
  • /etc/zshrc (if interactive)
  • ~/.zshrc (if interactive)
  • /etc/zlogin (if login shell)
  • ~/.zlogin (if login shell)
@pbrisbin
pbrisbin / refresh.md
Last active June 12, 2023 13:50
Refreshing GPG keys

These are my own notes for my re-expiration of GPG keys.

1- Mount flashdrive

sudo cryptsetup open /dev/sdb1 --type=tcrypt flashdrive
sudo mkdir -p /mnt/flashdrive
sudo mount /dev/mapper/flashdrive /mnt/flashdrive
export GNUPGHOME=/mnt/flashdrive/gnupg
@pbrisbin
pbrisbin / actual.txt
Created March 24, 2022 13:32
Stack build with touched artifacts
Version 2.7.5, Git revision ba147e6f59b2da75b1beb98b1888cce97f7032b1 x86_64 hpack-0.34.4
2022-03-24 09:08:46.951150: [debug] Checking for project config at: /home/patrick/code/freckle/hspec-junit-formatter/stack.yaml
2022-03-24 09:08:46.951255: [debug] Loading project config file stack.yaml
2022-03-24 09:08:46.954176: [debug] (SQL) SELECT COUNT(*) FROM "last_performed" WHERE ("action"=?) AND ("timestamp">=?); [PersistInt64 1,PersistUTCTime 2022-03-23 13:08:46.954156978 UTC]
2022-03-24 09:08:46.954530: [debug] Using package location completions from a lock file
2022-03-24 09:08:46.956786: [debug] Loaded snapshot from Pantry database.
2022-03-24 09:08:47.095209: [debug] RawSnapshotLayer {rslParent = RSLCompiler (WCGhc (mkVersion [8,10,4])), rslCompiler = Nothing, rslLocations = [RPLIHackage AC-Angle-1.0@sha256:e1ffee97819283b714598b947de323254e368f6ae7d4db1d3618fa933f80f065,544 (Just (TreeKey 7edd1f1a6228af27c0f0ae53e73468c1d7ac26166f2cb386962db7ff021a2714,210)),RPLIHackage ALUT-2.4.0.3@sha256:ab8c2af4c13bc04c7
@pbrisbin
pbrisbin / gist:883120
Created March 23, 2011 13:59
mpd visualizer setup.
mpd config
299 ## A Fifo output for visualizations in ncmpcpp-git
300 #
301 audio_output {
302 type "fifo"
303 name "ncmpcpp visualizer"
304 path "/tmp/mpd.fifo"
305 format "44100:16:1"
@pbrisbin
pbrisbin / install.md
Last active August 25, 2021 14:06
Installing OpenCart on Heroku

Installation

This gets OpenCart running enough that we can use the GUI Installer

  1. Create Heroku project with ClearDB MySQL add-on
  2. Download OpenCart sources
  3. Move ./upload/* to top-level (those are the PHP site files)
  4. Copy zlib.so into ./ext/zlib.so
  5. Write extension = /app/www/ext/zlib.so into php.ini
  6. Push
@pbrisbin
pbrisbin / semver-pvp.md
Created February 16, 2018 00:31
Versioning Haskell: Semver <> PVP

I personally prefer [Semver][]. I think it's reasonable, simple, and makes sense. But as a good Haskell citizen, I'd like to be [PVP][]-compliant as well. Here is a bit of a graphic showing how the two systems are almost the same:

PVP:            A . B     . C     . ...
Semver:             Major . Minor . Patch
                    ^       ^       ^
                    |       |       |
                    |       |       ` increment for other changes
                    |       |
                    |       ` increment on non-breaking change
-- Form 1
-----------------------------------------------------------------------------------------
data Job arg = Job
{ jobJid :: JobId
, jobJobtype :: String
, jobArgs :: NonEmpty arg
, jobRetry :: Maybe Int
, jobQueue :: Maybe Queue
, jobAt :: Maybe UTCTime
@pbrisbin
pbrisbin / example.md
Last active April 23, 2020 10:54 — forked from ericclemmons/example.md
HTML5 <details> in GitHub

Using <details> in GitHub

Suppose you're opening an issue and there's a lot noisey logs that may be useful.

Rather than wrecking readability, wrap it in a <details> tag!

<details>
 <summary>Summary Goes Here</summary>
@pbrisbin
pbrisbin / broken-index.js
Created April 7, 2020 19:23
logdna-cloudwatch repro
// External Libraries
const agent = require("agentkeepalive");
const asyncRetry = require("async").retry;
const request = require("request");
const zlib = require("zlib");
// Constants
const MAX_LINE_LENGTH = parseInt(process.env.LOGDNA_MAX_LINE_LENGTH) || 32000;
const MAX_REQUEST_TIMEOUT_MS =
parseInt(process.env.LOGDNA_MAX_REQUEST_TIMEOUT) || 30000;
@pbrisbin
pbrisbin / gpg-extend-expiration.md
Created March 17, 2020 18:53
Extending the expiration of my Signing subkey(s)

Extending subkey expiration

  1. Mount master keys flashdrive

    truecrypt
    
  2. Extend expiry of all keys