Skip to content

Instantly share code, notes, and snippets.

@rnelson
rnelson / README.md
Last active December 30, 2024 20:57
fuck you, program!

About

Need to kill a program? Make it fun.

$ fuck you firefox
(╯°□°)╯ firefox
$
server {
listen 80;
server_name www.DOMAIN;
rewrite ^ http://DOMAIN$request_uri?;
}
server {
listen 80;
server_name DOMAIN;
root /srv/DOMAIN/htdocs;
index index.html index.htm index.php;
@rnelson
rnelson / jail.md
Last active December 30, 2015 17:39
PC-BSD PHP Jail

About

This gist is my instructions for setting up a jail on PC-BSD/TrueOS to do PHP web development, specifically WordPress. As long as I keep using jails to do project development, I'll keep this document updated.

Initial Setup

Setup for these jails is pretty simple. The first time this is done (or when there's a new release you want to use), first you need to create a Warden template:

@rnelson
rnelson / newnetbsd.sh
Last active November 17, 2024 13:08
Script to set up a NetBSD install to my liking
#!/bin/sh
#
# newnetbsd.sh - set up a fresh NetBSD install
#
# Prereq:
# - During install:
# - Configure your network
# - Install pkgin ("Enable installation of binary packages")
# - Fetch/unpack pkgsrc
# - Run ntpdate at boot
@rnelson
rnelson / buildall.bat
Created July 31, 2012 13:32
VB batch build via MSBuild
@ECHO OFF
REM Make sure to set up those platforms under Build > Configuration Manager before
REM running this.
set PROJFILE=MyAwesomeApp.sln
msbuild %PROJFILE% /nologo /t:Rebuild /p:Configuration=Debug;Platform=x86;RunCodeAnalysis=False
msbuild %PROJFILE% /nologo /t:Rebuild /p:Configuration=Release;Platform=x86;RunCodeAnalysis=False
msbuild %PROJFILE% /nologo /t:Rebuild /p:Configuration=Debug;Platform=x64;RunCodeAnalysis=False
msbuild %PROJFILE% /nologo /t:Rebuild /p:Configuration=Release;Platform=x64;RunCodeAnalysis=False
@rnelson
rnelson / mkbigfile.rb
Created April 19, 2012 15:44
Makes a big file.
#!/usr/bin/env ruby
require 'optparse'
require 'ostruct'
require 'pp'
class MkBigFile
attr_reader :name, :version, :options
TYPES = %w[zero sparse]
def initialize()
@rnelson
rnelson / mkbigfile.c
Created April 18, 2012 21:44
Makes a big file.
#include <sys/stat.h>
#include <fcntl.h>
#include <inttypes.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
void usage();
@rnelson
rnelson / mkbigfile.py
Created April 18, 2012 17:14
Makes a big file.
#!/usr/bin/env python
# Based on http://stackoverflow.com/questions/982659/quickly-create-large-file-on-a-windows-system
import os
import sys
if len(sys.argv) != 3:
print 'usage: mkbigfile.py <filename> <size in gb>'
sys.exit(1)
# Grab the filename and requested size, convert the size to bytes
@rnelson
rnelson / in.rdf
Created February 23, 2012 19:20
Steve's Problem #1894467
#!/usr/bin/env ruby
require 'rexml/document'
# Open in.rdf and parse it as XML
xml = REXML::Document.new File.new('in.rdf')
# Go through every <rdf:Description> tag
xml.elements.each('//rdf:Description') do | description |
# Go through every <find> tag underneath the <rdf:Description>
# that we're currently looking at
@rnelson
rnelson / NetworkTest.scpt
Created November 2, 2011 19:34
Test for a working network connection
set testHost to "google.com"
set errorSubject to "Internet Died"
set errorRecipientName to "Your Name"
set errorRecipientAddress to "your@ddr.ess"
set audioFile to "Macintosh HD:Users:rnelson:Music:iTunes:iTunes Music:Bad Religion:The Process of Belief:04 Broken.mp3" -- Broken, just like my internet
repeat
-- Try to use the network
set command to "/usr/sbin/scutil -r " & testHost