Skip to content

Instantly share code, notes, and snippets.

View errordeveloper's full-sized avatar

Ilya Dmitrichenko errordeveloper

View GitHub Profile
@mhubig
mhubig / README.md
Last active December 27, 2015 11:39
Testing a possible workflow with paker.io and vagrant.

The intended workflow should be:

  1. Build the images

    $ packer build template.json
    
  2. Import and start an image.

    $ vagrant up --provider=aws
    

$ vagrant up --provider=virtualbox

# encoding: utf-8
require File.join(File.dirname(__FILE__), 'helper')
class TestIntegration < MosquittoTestCase
def setup
@result = nil
@client = nil
connected = false
@client = Mosquitto::Client.new(nil, true)
@cuviper
cuviper / MOVED-sdt.rs.txt
Last active August 29, 2015 14:00
Prototype Rust probe!() macro creating SystemTap SDT probes
I'm leaving this gist in place for posterity, but the project now has a home:
https://github.com/cuviper/rust-libprobe
@kyledrake
kyledrake / ferengi-plan.txt
Last active November 14, 2025 04:39
How to throttle the FCC to dial up modem speeds on your website using Nginx
# The blog post that started it all: https://neocities.org/blog/the-fcc-is-now-rate-limited
#
# Current known FCC address ranges:
# https://news.ycombinator.com/item?id=7716915
#
# Confirm/locate FCC IP ranges with this: http://whois.arin.net/rest/net/NET-165-135-0-0-1/pft
#
# In your nginx.conf:
location / {
@pczarn
pczarn / deps.rs
Last active March 20, 2016 07:28 — forked from alexcrichton/deps.rs
Rust: dependency graph
use std::io;
fn main() {
println!("digraph {{");
let mut input = io::stdin();
let mut lines = input.lines();
loop {
match lines.next() {
Some(line) => {
let line = line.unwrap();
let line = line.as_slice();

Current state

    attach    Attach to a running container
    build     Build an image from a Dockerfile
    commit    Create a new image from a container's changes
    cp        Copy files/folders from a container's filesystem to the host path
    diff      Inspect changes on a container's filesystem
    events    Get real time events from the server
    export    Stream the contents of a container as a tar archive
    history   Show the history of an image
brew install docker-machine
brew install docker
docker-machine create -d virtualbox default
eval $(docker-machine env default)
# Create a juju2 workspace
mkdir -p $HOME/.juju2
# Dont forget to create a credentials.yaml per the 2.0 release announcement
# see: juju mailing list archives - https://lists.ubuntu.com/archives/juju/2016-February/006618.html
@jbrisbin
jbrisbin / riak-ts-cluster.sh
Last active May 9, 2016 18:20
Start and stop a 5-node Riak TS cluster using the Docker image
#!/bin/bash
eval $(docker-machine env --shell=bash)
eval $(weave env)
CLUSTER_NAME=${2:-dev}
WEAVE=`which weave`
if [ "" == "$WEAVE" ]; then
LINK="--link ${CLUSTER_NAME}1"
fi
@r0l1
r0l1 / copy.go
Last active August 3, 2025 11:39
Copy a directory tree (preserving permissions) in Go.
/* MIT License
*
* Copyright (c) 2017 Roland Singer [roland.singer@desertbit.com]
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
@mcastelino
mcastelino / tc mirroring.md
Last active November 11, 2025 21:46
Using tc redirect to connect a virtual machine to a container network

Connecting a veth device to tap

  • veth device from CNI/CNM plugin: eth0
  • tap device that connects to the VM: tap0

Redirecting traffic between the two devices

tc qdisc add dev eth0 ingress
tc filter add dev eth0 parent ffff: protocol all u32 match u8 0 0 action mirred egress redirect dev tap0