Skip to content

Instantly share code, notes, and snippets.

View errordeveloper's full-sized avatar

Ilya Dmitrichenko errordeveloper

View GitHub Profile
@marccarre
marccarre / springer.py
Last active May 26, 2020 15:12
Download all open Springer ebooks
#!/usr/bin/env python
'''
Springer has released some ebooks freely in order to support learning during
these times of lockdown with the COVID-19 spreading.
Source: https://www.springernature.com/gp/librarians/news-events/all-news-articles/industry-news-initiatives/free-access-to-textbooks-for-institutions-affected-by-coronaviru/17855960
A spreadsheet containing the URLs of all available books can be found on the
aforementioned page. These URLs have been hardcoded below. And this script
lets you download all books automatically.
@ahmetb
ahmetb / gcpauth.go
Created May 22, 2018 17:21
Authenticating to GKE cluster with client-go, IAM service account and a Google auth plugin written from scratch
package main
import (
"context"
"fmt"
"log"
"net/http"
"golang.org/x/oauth2"
"golang.org/x/oauth2/google"
@acolyer
acolyer / jessfraz.md
Created November 19, 2017 13:39
Containers, operating systems and other fun things from The Morning Paper
@mcastelino
mcastelino / tc mirroring.md
Last active December 11, 2023 02:16
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
@r0l1
r0l1 / copy.go
Last active March 23, 2024 12:38
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:
@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
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

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
@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();
@kyledrake
kyledrake / ferengi-plan.txt
Last active April 6, 2024 00:30
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 / {