Skip to content

Instantly share code, notes, and snippets.

View shemul's full-sized avatar
🏠
Working from home

Kief H. Shemul shemul

🏠
Working from home
  • TomTom, Delivery Hero
  • Amsterdam, Netherlands
View GitHub Profile
Evar (
concurrent = 5
semaphoreChan = make(chan struct{}, concurrent)
)
func doWork(item int) {
semaphoreChan <- struct{}{} // block while full
go func() {
defer func() {
<-semaphoreChan // read to release a slot
@7rin0
7rin0 / gist:ea890d2d4bf25a890b86aff01290e7d0
Created March 3, 2017 01:52
Docker exec root or default user
# Root.
$ docker exec -u 0 i -t {container_id/image_name} bash
or
# Default container's user.
$ docker exec i -t {container_id/image_name} bash
@aniruddha-adhikary
aniruddha-adhikary / ubuntu-release-checker.py
Last active March 21, 2016 16:45
ubuntu release checker
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import urllib
import json
version = "15.10"
arch = "i386" # i386 or amd64
mirrorlist = ["http://ubuntu.mirror.mendoza-conicet.gob.ar/", "http://releases.ubuntu.unc.edu.ar/", "http://ftp.iinet.net.au/pub/ubuntu-releases/", "http://mirror.aarnet.edu.au/pub/ubuntu/releases/", "http://mirror.netspace.net.au/pub/ubuntu-releases/", "http://ubuntu.mirror.serversaustralia.com.au/ubuntu-releases/", "http://ubuntu.mirror.uber.com.au/releases/", "http://mirror.internode.on.net/pub/ubuntu/releases/", "http://ubuntu.lagis.at/releases/", "http://mirrors.ispros.com.bd/ubuntu-release/", "http://by.releases.ubuntu.com/", "http://ubuntu-releases.mirror.nucleus.be/", "http://ubuntu.mirrors.skynet.be/pub/ubuntu.com/releases/", "http://bw.releases.ubuntu.com/", "http://ubuntu.c3sl.ufpr.br/releases/", "http://mirror.globo.com/ubuntu/releases/", "http://mirror.pop-sc.rnp.br/mirror/ubuntu/", "http://ubuntu.mirror.pop-sc.rnp.br/mirror/ubuntu-releases/", "http://mirror.unesp.br/ubuntu