Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@rasky
rasky / .config
Created September 2, 2015 15:00
Host *
ControlPersist yes
ControlMaster auto
ControlPath /tmp/ssh-%r@%h:%p
ServerAliveInterval 60
@jssjr
jssjr / flush_dns.sh
Last active February 3, 2016 22:51
case "$(sw_vers -productVersion)" in
10.5.*|10.6.*)
alias flush_dns="sudo dscacheutil -flushcache"
;;
10.8.*|10.7.*)
alias flush_dns="sudo killall -HUP mDNSResponder"
;;
10.9.*)
alias flush_dns="sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder"
;;
@JakeWharton
JakeWharton / Oauth1SigningInterceptor.java
Last active November 27, 2023 10:04
An OkHttp interceptor which does OAuth1 signing. Requires Guava and Java 8, although those dependencies wouldn't be too hard to break if you didn't have them.
/*
* Copyright (C) 2015 Jake Wharton
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software

Preview build: Container grouping and stack composition

NOTE: this is out of date - refer to moby/moby#9694

Here is a preview build of two new features we’re working on concurrently: container grouping (docker groups) and stack composition (docker up). Together, they will eventually form a complete replacement for Fig.

#!/bin/sh
remove_dangling() {
echo "Removing dangling images ..."
docker rmi $(docker images -f dangling=true -q)
}
remove_stopped_containers() {
echo "Removing stopped containers ..."
docker rm $(docker ps -qa)
Things to note
==============
No miracles:
* If you're already getting near the top end of what your ISP advertises then it's unlikely you can get any improvement.
* This only applies to ADSL, not Fibre/Cable
Improve poor connection speed due to noise from internal extension wiring
@tbroyer
tbroyer / README.md
Last active May 25, 2016 13:46
Error-prone in Gradle

UPDATE: This is now available as a plugin https://github.com/tbroyer/gradle-errorprone-plugin

To use it, just add the following to your build.gradle and it'll change all JavaCompile tasks to use the error-prone compiler:

apply from: 'https://gist.github.com/tbroyer/6847494/raw/errorprone.gradle'
@carchrae
carchrae / main.js
Last active December 22, 2015 11:08
javascript verticle for template rendering with dust.js
var vertx = require("vertx.js")
var console = require('vertx/console');
console.log('module ' + JSON.stringify(module));
var dust;
var x = function(){
var module = undefined;
@jpetazzo
jpetazzo / README.md
Last active December 22, 2015 08:30
Securing Docker with socat and certificates
@jed
jed / how-to-set-up-stress-free-ssl-on-os-x.md
Last active February 25, 2024 17:35
How to set up stress-free SSL on an OS X development machine

How to set up stress-free SSL on an OS X development machine

One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.

Most workflows make the following compromises:

  • Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the secure flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection.

  • Use production SSL certificates locally. This is annoying