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; |
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.
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:
| #!/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 |
| @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 |
| #!/usr/bin/env ruby | |
| require 'optparse' | |
| require 'ostruct' | |
| require 'pp' | |
| class MkBigFile | |
| attr_reader :name, :version, :options | |
| TYPES = %w[zero sparse] | |
| def initialize() |
| #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(); |
| #!/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 |
| #!/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 |
| 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 |