Skip to content

Instantly share code, notes, and snippets.

View guillemcanal's full-sized avatar

Guillem CANAL guillemcanal

View GitHub Profile
@guillemcanal
guillemcanal / sse.go
Created November 21, 2018 00:48 — forked from schmohlio/sse.go
Example SSE server in Golang
// v2 of the great example of SSE in go by @ismasan.
// includes fixes:
// * infinite loop ending in panic
// * closing a client twice
// * potentially blocked listen() from closing a connection during multiplex step.
package main
import (
"fmt"
"log"
@guillemcanal
guillemcanal / configure_docker0.sh
Created November 16, 2017 13:05 — forked from kamermans/configure_docker0.sh
Change the IP subnet of Docker's docker0 interface
#!/bin/sh -e
#
# You can run this script directly from github as root like this:
# curl -sS https://gist.githubusercontent.com/kamermans/94b1c41086de0204750b/raw/configure_docker0.sh | sudo bash -s - 192.168.254.1/24
#
# * Make sure you replace "192.168.254.0/24" with the network that you want to use
#
# NOTE: This script is intended for Debian / Ubuntu only!
if [ $# -lt 1 ]; then
@guillemcanal
guillemcanal / dnsmasq-regex.rb
Created July 29, 2017 13:45 — forked from chriseldredge/dnsmasq-regex.rb
Homebrew Formula for installing dnsmasq with regex patch from Jan Seiffert See: http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/2013q2/007124.html
require 'formula'
class DnsmasqRegex < Formula
homepage 'http://www.thekelleys.org.uk/dnsmasq/doc.html'
url 'http://www.thekelleys.org.uk/dnsmasq/dnsmasq-2.66.tar.gz'
sha256 '36232fa23d1a8efc6f84a29da5ff829c2aa40df857b9116a9320ea37b651a982'
option 'with-idn', 'Compile with IDN support'
depends_on "libidn" if build.include? 'with-idn'