Skip to content

Instantly share code, notes, and snippets.

View mjs's full-sized avatar
💭
curl -s http://104.196.37.21/|grep -Eo '^\S+'

Menno Finlay-Smits mjs

💭
curl -s http://104.196.37.21/|grep -Eo '^\S+'
View GitHub Profile
#!/usr/bin/perl
$mirror = "nz.archive.ubuntu.com";
#$mirror = "us.archive.ubuntu.com";
# For Cape Town
#$mirror = "ubuntu.saix.net/ubuntu-archive";
$| = 1;
while (<>) {
@line = split;
# listen on 127.0.0.1 so that apt on the host machine can use the cache
http_port 127.0.0.1:8888
# listen on lxdbr0 addresses
http_port 10.0.8.1:8888
http_port [fdc1:e6b1:6aac:99f5::1]:8888
acl allowed_src_networks src "/etc/squid-deb-proxy/autogenerated/allowed-networks-src.acl"
acl blockedpkgs urlpath_regex "/etc/squid-deb-proxy/autogenerated/pkg-blacklist-regexp.acl"
@mjs
mjs / demo.go
Created March 17, 2016 20:30
Demo of go-yaml issue under Go 1.6
package main
import (
"fmt"
// Swap these 2 for comparison. Under Go 1.6 the program works
// with json but not yaml.
"gopkg.in/yaml.v2"
// yaml "encoding/json"
)
@mjs
mjs / foo.go
Last active March 17, 2016 01:11
package foo
import "fmt"
func NewThing() *Thing {
return &Thing{
Name: "Thing",
other: make(other),
}
}
@mjs
mjs / timeout.go
Last active August 29, 2015 14:02 — forked from darkhelmet/timeout.go
func Download(out chan string, urls... string) {
for url := range(urls) {
go func() {
out <- HttpGet(url)
}()
}
}
func Process(in chan string) {
select {