Skip to content

Instantly share code, notes, and snippets.

View brpaz's full-sized avatar

Bruno Paz brpaz

View GitHub Profile
@drcongo
drcongo / fab deploy_static
Last active May 15, 2018 23:28
A Fabric task to deploy static assets to S3, gzipping the js and css files, and invalidating cache objects on CloudFront. Feel free to point out where it could be improved.
import datetime
import arrow
from fabric.api import *
import boto
from boto.cloudfront import CloudFrontConnection
import os
from datetime import date, timedelta
import gzip
import shutil
@oomathias
oomathias / CloudFlare x Dynamic DNS
Last active February 20, 2016 20:09
How to make your own DynDNS with CloudFlare.
#!/bin/sh
# Config
cfkey=89e495e7941cf9e40e6980d14a16bf023ccd4c91
[email protected]
cfhost=example.com
cfname=local.example.com
cfid=123456789
# cfid = DNS Record ID. Available by using the rec_load_all call.
@kr
kr / jsonenv
Created August 6, 2013 00:59
convert a json dictionary into environment variables
#!/usr/bin/env python
# jsonenv reads a json object as input and produces
# escaped shell commands for setting environment vars
import json
import pipes
import sys
for k, v in json.load(sys.stdin).items():
@jbenet
jbenet / simple-git-branching-model.md
Last active May 3, 2025 18:07
a simple git branching model

a simple git branching model (written in 2013)

This is a very simple git workflow. It (and variants) is in use by many people. I settled on it after using it very effectively at Athena. GitHub does something similar; Zach Holman mentioned it in this talk.

Update: Woah, thanks for all the attention. Didn't expect this simple rant to get popular.

@marek-saji
marek-saji / dev-tld.md
Last active February 26, 2024 16:12
Configure local DNS server to serve #dev #TLD #ubuntu #linux

Configure local wildcard DNS server

  1. Install Dnsmasq: sudo apt-get install dnsmasq
  2. Since Ubuntu's NetworkManager uses dnsmasq, and since that messes things up a little for us, open up /etc/NetworkManager/NetworkManager.conf and comment out (#) the line that reads dns=dnsmasq. Restart NetworkManager afterwards: sudo restart network-manager.
  3. Make sure Dnsmasq listens to local DNS queries by editing /etc/dnsmasq.conf, and adding the line listen-address=127.0.0.1.
  4. Create a new file in /etc/dnsmasq.d (eg. /etc/dnsmasq.d/dev), and add the line address=/dev/127.0.0.1 to have dnsmasq resolve requests for *.dev domains. Restart Dnsmasq: sudo /etc/init.d/dnsmasq restart.

source: http://brunodbo.be/blog/2013/04/setting-up-wildcard-apache-virtual-host-wildcard-dns

@h4cc
h4cc / Makefile
Created December 1, 2013 12:01
Very simple Makefile to deploy a existing symfony2 application. Using Doctrine ORM and MongoDB ODM for database. Inital usage: $ git clone https://exaple.com/project.git $ make permissions Deploying or Updating with database changes: $ make deploy $ make database
hello:
@echo "Hello! use other targets!"
deploy:
git reset --hard -q
git pull -q
rm -rf bin/
php composer.phar install --no-progress --no-dev -o --quiet
rm -rf app/cache/*
@branneman
branneman / better-nodejs-require-paths.md
Last active April 11, 2025 10:39
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

const Article = require('../../../../app/models/article');

Those suck for maintenance and they're ugly.

Possible solutions

@hiroakis
hiroakis / Rakefile_serverspec
Last active June 5, 2016 21:27
serverspec for my environment
require 'rake'
require 'rspec/core/rake_task'
require 'yaml'
require 'highline/import'
properties = YAML.load_file('properties.yaml')
ENV['SSH_USER'] = ask("Enter ssh user: ") { |q| q.echo = true }
ENV['SSH_PASSWORD'] = ask("Enter ssh password: ") { |q| q.echo = false }
@sandfox
sandfox / app.js
Created February 19, 2014 23:57
too simple express/restify/whatever controller + routemap example
var express = require('express');
var blahController = require('./example-controller'); //and so on and so forth
var routes = require('./routes');
var app = express()
var controllers = {
blah: blahController,
user: userController
}
@trdarr
trdarr / hubot-digitalocean.md
Last active March 28, 2022 20:34
Deploying Hubot on DigitalOcean (with Slack integration)