Skip to content

Instantly share code, notes, and snippets.

pgib /
Created May 21, 2020
Clean up the bloated Backblaze bzfileids.dat

Place in /Library/Backblaze.bzpkg/bzdata/bzbackup, and run with:

ruby purge_nonexistent.rb

It will process bzfileids.dat placing any file that exists in bzfileids.dat-found and any missing file in bzfileids.dat-missing. You can then back up your original file and replace it with bzfileids.dat-found.

My original file was almost 1.4GB. It had grown so large that the backup would cause all my fans spin and it never seemed to complete. Backblaze support suggested I delete my entire backup with them and start over. After running this script, my new bzfileids.dat file is 301MB. Still huge, but about 1/5th the size. The backup seemed to go much more smoothly.

pgib /
Created Nov 9, 2019
nginx startup script for Amazon Linux 2
# Provides: nginx
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: S 0 1 6
# Short-Description: nginx initscript
# Description: nginx
pgib / Gemfile
Created Dec 14, 2018
Sign an S3 URL
View Gemfile
source ""
git_source(:github) {|repo_name| "{repo_name}" }
gem 'aws-sdk'
pgib / .zshrc
Last active Aug 29, 2015
My oh-my-zsh theme.
View .zshrc
# Path to your oh-my-zsh configuration.
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
# Example aliases

Keybase proof

I hereby claim:

  • I am pgib on github.
  • I am pgib ( on keybase.
  • I have a public key whose fingerprint is 68AE 1949 8D8A 05E4 E9B1 4654 A811 19F0 00B6 F040

To claim this, I am signing this object:

pgib / .tmux.conf
Last active Dec 2, 2017
Nice tmux copy and paste using OS X clipboard
View .tmux.conf
# =======================================================================
# vim-style copy and paste
setw -g mode-keys vi
bind ] paste-buffer
bind-key -t vi-copy 'v' begin-selection
bind-key -t vi-copy 'y' copy-pipe "reattach-to-user-namespace pbcopy"
bind-key -t vi-copy Space rectangle-toggle
# Update default binding of `Enter` to also use copy-pipe
unbind -t vi-copy Enter
View Users.csv
Joe Smith 123456 147852
Bill Jones 987654 369852
Steve Miller 654321 852147
pgib /
Last active Aug 29, 2015
Simple Unix program to output a terminal bell (beep)

Compile with:

gcc beep.c -o beep

Or on platforms that no longer have gcc by default (e.g. FreeBSD 10):

cc beep.c -o beep

Made for tmux/screen to get your attention in a background window.

pgib / ext.rb
Created Mar 11, 2014
Optional Jekyll monkey patch to use terminal-notifier to signal a Jekyll build completion. Put in _plugins/ext.rb
View ext.rb
require 'jekyll-assets'
# optional notification for jekyll build completion
# gem install terminal-notifier
# rbenv rehash
module Jekyll
class Site
pgib /
Last active Dec 28, 2015
Testing script to test Mac OS X Mavericks code signing for Profile Manager.

Install to /Applications/

Be sure to edit the file to set the path to your code-signing certificate.

Run with:

cd /Applications/
php -c /Applications/ signing_tester.php
You can’t perform that action at this time.