Skip to content

Instantly share code, notes, and snippets.

View bcicen's full-sized avatar

bradley bcicen

View GitHub Profile
@drsnyder
drsnyder / urandom-reads.py
Last active August 11, 2021 10:44
Demonstrate the contention on /dev/urandom with N threads.
# Create a user land file for testing.
# dd if=/dev/urandom of=/tmp/urandom bs=1M count=10
#
# urandom-reads.py infile threads
# Examples:
# time python2.6 urandom-reads.py /tmp/urandom
# time python2.6 urandom-reads.py /dev/urandom
#
# R to generate a plot of the read time distribution at each level of concurrency
# rdt = read.csv("output.csv", header=F)
@jdoconnor
jdoconnor / gist:32ef0314cecb80157c4e
Created September 26, 2014 21:38
Update mtimes based off commit time
#!/bin/bash -e
####
# based on https://gist.github.com/jeffery/1115504
# Helper script to update the Last modified timestamp of files in a Git SCM
# Projects working Copy
#
# When you clone a Git repository, it sets the timestamp of all the files to the
# time when you cloned the repository.
#
# This becomes a problem when you want the cloned repository, which is part of a
# this forces dpkg not to call sync() after package extraction and speeds up install
RUN echo "force-unsafe-io" > /etc/dpkg/dpkg.cfg.d/02apt-speedup
# we don't need and apt cache in a container
RUN echo "Acquire::http {No-Cache=True;};" > /etc/apt/apt.conf.d/no-cache

#cargo, docker hub without docker, how to

18 Jan 2015

###Background

I have been using linux containers for almost 2 years now. It started during an internship at Applidget, a startup in Paris. My job was to integrate linux containers technology in their private PaaS. At this time, there where no doubt, the technology to use was LXC. One week or so after I started digging into LXC, one of my co-worker talked to me about this new thing called docker. He told me "isn't it what you are supposed to do during your internship ?". And it was kind of it.

At this time I already highlighted a big challenge of containers in PaaS: creation time. Waiting for bundle install to complete is already long enough to have to wait for another 40 secondes to create a container :). Docker landed just in time !

@klmr
klmr / Makefile
Last active March 21, 2024 19:55
Self-documenting makefiles
# Example makefile with some dummy rules
.PHONY: all
## Make ALL the things; this includes: building the target, testing it, and
## deploying to server.
all: test deploy
.PHONY: build
# No documentation; target will be omitted from help display
build:
@dannguyen
dannguyen / sqlmd.sh
Last active June 13, 2022 20:05
A command-line function that runs a SQLite query and gets a Markdown-ready table; See console demo at https://asciinema.org/a/89573
### sqlmd
# Bash function for outputting SQLite results in Markdown-friendly table
### Dependency:
# csvlook can be found here: http://csvkit.readthedocs.io/en/540/scripts/csvlook.html
### USAGE
# $ sqlmd "SELECT name, age FROM people;" optional_db_name_argument.sqlite
### OUTPUT
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active April 19, 2024 15:41
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@randallmlough
randallmlough / translate.go
Last active April 10, 2023 15:40 — forked from hvoecking/translate.go
Golang reflection: traversing arbitrary structures – []map[string]interface{} support
// Traverses an arbitrary struct and translates all stings it encounters
//
// I haven't seen an example for reflection traversing an arbitrary struct, so
// I want to share this with you. If you encounter any bugs or want to see
// another example please comment.
//
// The MIT License (MIT)
//
// Copyright (c) 2014 Heye Vöcking
//