This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Get Docker Image | |
btrfs subvol create images/alpine | |
CID=$(docker run -d python:3.8-alpine true) | |
docker export $CID | tar -C images/alpine/ -xf- | |
btrfs subvol snapshot images/alpine/ containers/springrain | |
touch containers/springrain/I_AM_HERE | |
## tmux as a container and mount | |
tmux |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Cascade lending bot for Bitfinex. Places lending offers at a high rate, then | |
gradually lowers them until they're filled. | |
This is intended as a proof of concept alternative to fractional reserve rate | |
(FRR) loans. FRR lending heavily distorts the swap market on Bitfinex. My hope | |
is that Bitfinex will remove the FRR, and implement an on-site version of this | |
bot for lazy lenders (myself included) to use instead. | |
""" | |
from decimal import Decimal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
brew cask install virtualbox | |
brew cask install vagrant | |
mkdir docker-tranning | |
vagrant init centos | |
vagarnt up |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## 首先,我们先增加一个网桥lxcbr0,模仿docker0 | |
brctl addbr lxcbr0 | |
brctl stp lxcbr0 off | |
ifconfig lxcbr0 192.168.10.1/24 up #为网桥设置IP地址 | |
## 接下来,我们要创建一个network namespace - ns1 | |
# 增加一个namesapce 命令为 ns1 (使用ip netns add命令) | |
ip netns add ns1 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define _GNU_SOURCE | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <sys/types.h> | |
#include <sys/wait.h> | |
#include <sys/mount.h> | |
#include <sys/capability.h> | |
#include <stdio.h> | |
#include <sched.h> | |
#include <signal.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define _GNU_SOURCE | |
#include <sys/types.h> | |
#include <sys/wait.h> | |
#include <sys/mount.h> | |
#include <stdio.h> | |
#include <sched.h> | |
#include <signal.h> | |
#include <unistd.h> | |
#define STACK_SIZE (1024 * 1024) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define _GNU_SOURCE | |
#include <sys/types.h> | |
#include <sys/wait.h> | |
#include <stdio.h> | |
#include <sched.h> | |
#include <signal.h> | |
#include <unistd.h> | |
#define STACK_SIZE (1024 * 1024) | |
static char container_stack[STACK_SIZE]; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rpm -i https://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm | |
yum install -y -q autoconf automake btrfs-progs docker gettext-devel git libcgroup-tools libtool python-pip | |
fallocate -l 10G ~/btrfs.img | |
mkdir /var/bocker | |
mkfs.btrfs ~/btrfs.img | |
mount -o loop ~/btrfs.img /var/bocker | |
pip install git+https://github.com/larsks/undocker | |
systemctl start docker.service | |
docker pull centos | |
docker save centos | undocker -o base-image |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am aseaday on github. | |
* I am thinkghc (https://keybase.io/thinkghc) on keybase. | |
* I have a public key ASAIoEfLcfKuW4brLWZMSmrjheX-GsgbBtGYzZdbypEf_wo | |
To claim this, I am signing this object: |
NewerOlder