Skip to content

Instantly share code, notes, and snippets.

View AkihiroSuda's full-sized avatar

Akihiro Suda AkihiroSuda

View GitHub Profile
@kolyshkin
kolyshkin / gist:bd25e9de97954b330d8a
Created August 12, 2015 06:36
How to run go pprof on Docker daemon
Enable port 8080 through the firewall:
firewall-cmd --add-port=8080/tcp
Run socat to make docker sock available via tcp port (note the IP to listen at)
socat -d -d TCP-LISTEN:8080,fork,bind=192.168.122.214 UNIX:/var/run/docker.sock
Run pprof on your client:
go tool pprof http://192.168.122.214:8080/debug/pprof/profile
Fetching profile from http://192.168.122.214:8080/debug/pprof/profile
Please wait... (30s)
@ThatRendle
ThatRendle / explanation.md
Last active July 3, 2022 07:56
Why I was previously not a fan of Apache Kafka

Update, September 2016

OK, you can pretty much ignore what I wrote below this update, because it doesn't really apply anymore.

I wrote this over a year ago, and at the time I had spent a couple of weeks trying to get Kafka 0.8 working with .NET and then Node.js with much frustration and very little success. I was rather angry. It keeps getting linked, though, and just popped up on Hacker News, so here's sort of an update, although I haven't used Kafka at all this year so I don't really have any new information.

In the end, we managed to get things working with a Node.js client, although we continued to have problems, both with our code and with managing a Kafka/Zookeeper cluster generally. What made it worse was that I did not then, and do not now, believe that Kafka was the correct solution for that particular problem at that particular company. What they were trying to achieve could have been done more simply with any number of other messaging systems, with a subscriber reading messages off and writing

@hayajo
hayajo / README.md
Last active March 20, 2019 05:05
Docker単体でコンテナに固定IPを設定する(--privilege)

Docker単体でコンテナに固定IPを設定する

pipeworkweaveを利用せずにコンテナに固定IPを設定するには、docker run--privilegedオプションを指定し、コンテナ内でIPを設定する方法がある。

$ HOST1=$(docker run --privileged -t -d ubuntu /bin/bash)
$ docker exec $HOST1 ip addr add 192.168.0.10/24 dev eth0

$ HOST2=$(docker run --privileged -t -d ubuntu /bin/bash)
$ docker exec $HOST2 ip addr add 192.168.0.11/24 dev eth0
@thejh
thejh / seccomp_ptrace_escape.c
Last active September 2, 2024 05:46
PoC for bypassing seccomp if ptrace is allowed (known, documented issue, even mentioned in the manpage)
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <signal.h>
#include <errno.h>
#include <fcntl.h>
#include <stddef.h>
#include <sys/syscall.h>
#include <sys/types.h>
#include <sys/stat.h>
@byt3bl33d3r
byt3bl33d3r / nfqueue
Last active February 21, 2020 19:41
Simple packet manipulation with fqrouter's fork of python-netfilterqueue (https://github.com/fqrouter/python-netfilterqueue)
#! /usr/bin/env python2.7
from scapy.all import *
from netfilterqueue import NetfilterQueue
def modify(packet):
pkt = IP(packet.get_payload()) #converts the raw packet to a scapy compatible string
#modify the packet all you want here
@mapk0y
mapk0y / docker-strage-drivers.mkd
Last active March 14, 2016 05:10
docker strage driver についてのメモ

内容

Docker Storage Drivers を読んでのメモです。

aufs

p31

With O_WRONLY or O_RDWR - write access look it up in the top branch;

@Liryna
Liryna / ARMDebianUbuntu.md
Last active April 21, 2025 18:35
Emulating ARM on Debian/Ubuntu

You might want to read this to get an introduction to armel vs armhf.

If the below is too much, you can try Ubuntu-ARMv7-Qemu but note it contains non-free blobs.

Running ARM programs under linux (without starting QEMU VM!)

First, cross-compile user programs with GCC-ARM toolchain. Then install qemu-arm-static so that you can run ARM executables directly on linux

@mainyaa
mainyaa / gce-boot2docker-image-boot.sh
Last active August 17, 2016 04:15
boot instance from boot2docker image on Google Compute Engine (WIP)
#!/usr/bin/env bash
VERSION="0.0.1"
set -e
[ -n "$DEBUG" ] && set -x
usage() {
printf "
Usage: $(basename $0) PROJECT_ID
@vishvananda
vishvananda / docker_netns.sh
Last active January 8, 2022 18:21
Expose the netns of a docker container to the host.
#!/usr/bin/env bash
if [ "$1" == "" ]; then
echo "usage: $0 <docker_id>"
echo "Exposes the netns of a docker container to the host"
exit 1
fi
ppid=`docker inspect $1 | grep Pid | awk '{print $2 + 0}'`
if [ "$ppid" == "" ]; then
echo "lxc parent pid not found"
@hikoma
hikoma / 3 Concurrent Objects.md
Created August 9, 2012 14:59
3 Concurrent Objects

3 Concurrent Objects (並行オブジェクト)

この章では並行オブジェクトの correctness と progress を規定する様々な方法を学ぶ。

correctness の3つタイプ

  • Quiescent consistency
    • 弱い制約。ハイパフォーマンスを必要とするシステムに使える
  • Sequential consistency