Skip to content

Instantly share code, notes, and snippets.

@beeftornado
beeftornado / nginx-conf
Last active January 18, 2024 19:54
Nginx reverse proxy for Sentry (github.com/getsentry/sentry). I removed some personal information and replaced it with <UPPERCASE> so look closely. Some key information in the sentry settings - SENTRY_URL_PREFIX, FORCE_SCRIPT_NAME, and ALLOWED_HOSTS. The rest of that is pretty standard.
server {
listen 80; ## listen for ipv4; this line is default and implied
listen [::]:80 default ipv6only=on; ## listen for ipv6
root /usr/share/nginx/www;
index index.php index.html index.htm;
# Make site accessible from http://localhost/
server_name _;
@beeftornado
beeftornado / app.coffee
Created November 16, 2013 00:14
Very rough, unoptimized, but functional plugin to Gridster.js that adds some responsiveness.
# Example to initialize gridster and handle resizing
# Module grid settings
WIDGET_BASE_DIMENSIONS_X = WIDGET_DESKTOP_X = 140
WIDGET_BASE_DIMENSIONS_Y = 20
WIDGET_CONTAINER_SELECTOR = '.widget-view'
WIDGET_MOBILE_CUTOFF_WIDTH = 768
NUM_WIDGETS = 15
$ ->
@beeftornado
beeftornado / byobu-persist.rb
Last active May 17, 2022 18:46
Save byobu (a tmux wrapper) sessions to a shell script that can be run to restore the session.
#!/usr/bin/env ruby
# Modified version of https://github.com/geebee/tmux-persistence to work with byobu
# and work on OSX.
require 'fileutils.rb'
# Start - Configuration Variables
sessionDir = ENV['HOME']+"/.byobu-sessions"
maxStoredSessions = 5
@beeftornado
beeftornado / broken_socket.py
Last active April 21, 2020 22:55
Python simulate broken dns for unit tests
# # Broken Socket
""" A broken socket implementation.
Credits:
* [A. Jesse Jiryu Davis](http://emptysqua.re/blog/undoing-gevents-monkey-patching/)
Monkey patches the built in socket implmentation so that various exceptions are
raised. Useful for running unit tests to validate behavior when connections
@beeftornado
beeftornado / sophos-anti-virus-home-edition91.rb
Last active July 27, 2018 15:29
sophos-anti-virus-home-edition91.rb
class SophosAntiVirusHomeEdition91 < Cask
module Utils
@@services = nil
def self.disable_sophos_services
# Stop any existing sophos or the install could hang
# Maybe it was only the permissions issue and not existing sophos, double check if needed
cmd = ['/usr/bin/sudo', '-E', '--', '/bin/launchctl', 'list'].join(' ')
@@services = `#{cmd}`
@@services.split.find_all{ |service| service.include? 'com.sophos' }.each do |service|
ohai "Stopping service #{service}..."
@beeftornado
beeftornado / rmtree.rb
Created July 16, 2014 22:41
Homebrew external command to remove a formula and its dependencies that are no longer used. Warning: Not all formulas declare all their dependencies.
# Install to /usr/local/Library/Homebrew/cmd/rmtree.rb
require 'keg'
require 'formula'
require 'shellwords'
module Homebrew
def rmtree
raise KegUnspecifiedError if ARGV.named.empty?
@beeftornado
beeftornado / _Library_LaunchDaemons_com.beeftornado.ipfw.plist
Last active March 5, 2016 09:43
Limiting time machine bandwidth on my OSX Mavericks machine
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST
1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.beeftornado.ipfw</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/ipfwstartup.sh</string>
@beeftornado
beeftornado / osx-for-hackers.sh
Last active August 30, 2015 05:01 — forked from brandonb927/osx-for-hackers.sh
OSX for Hackers: Yosemite Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned. Also, please don't email me about this script, my poor inbox...
#!/bin/sh
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
@beeftornado
beeftornado / raven.js.diff
Created July 27, 2015 23:24
Customizable auth string
diff --git a/src/raven.js b/src/raven.js
index 9dd5e14..88662d3 100644
--- a/src/raven.js
+++ b/src/raven.js
@@ -508,11 +508,20 @@ function each(obj, callback) {
}
+function getAuthParts() {
+ return [ 'sentry_version=4',
@beeftornado
beeftornado / api.py
Created June 4, 2014 19:28
API route prefixes with bottle. So you don't have to type @route('/api/name/blah') every time. You can just use @route('/blah')
# -*- coding: utf-8 -*-
# # Site API
# ## Imports
# Standard libs
# Third party libs
import bottle
from bottle import get, post, route