This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Help nginx+passenger serve static index pages | |
# Site specific config | |
server { | |
listen 80; | |
server_name domain.com; | |
index index.html; | |
access_log logs/appname.access.log; | |
error_log logs/appname.error.log; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'yaml' | |
require 'logger' | |
require 'active_record' | |
namespace :db do | |
def create_database config | |
options = {:charset => 'utf8', :collation => 'utf8_unicode_ci'} | |
create_db = lambda do |config| | |
ActiveRecord::Base.establish_connection config.merge('database' => nil) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require "getoptlong" | |
module UnicornCTL | |
class Controller | |
def initialize(args, argv) | |
@args = args | |
@argv = argv | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <assert.h> | |
typedef unsigned int u32; | |
typedef unsigned long long u64; | |
//------------------------------------------------------------------------- | |
// WorkArea | |
//------------------------------------------------------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package subcommands | |
import ( | |
"fmt" | |
"log" | |
"os" | |
"strings" | |
) | |
type Command interface { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Runs Restic backup on a schedule via cron, emails with status | |
# 1. add a cred file with your repo logins to /etc/restic/cred | |
# 2. | |
FROM="restic@$(hostname)" | |
EMAIL="user@company.com" | |
LOG="/var/log/restic.log" | |
RDIR="/etc/restic" |