This file contains hidden or 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
#!/bin/sh | |
# | |
make_mac () { | |
echo "6A:AA:`ifconfig eth0 | head -1 | sed 's/.*HWaddr...:..:\(..:..:..:..\).*/\1/g'`" | |
} | |
if ! test -d /dev/net; then | |
mkdir /dev/net; | |
mknod /dev/net/tun c 10 200 |
This file contains hidden or 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
void@tahr:~/docker/etest$ cat Dockerfile | |
FROM ubuntu | |
RUN useradd -m user | |
RUN echo 'export TOKEN=ok' >> /home/user/.bashrc | |
USER user | |
void@tahr:~/docker/etest$ docker build -t local/test . | |
Sending build context to Docker daemon 2.048 kB | |
Sending build context to Docker daemon |
This file contains hidden or 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
ip netns add space-a | |
ip netns add space-b | |
ip link add veth0 type veth peer name veth1 | |
ip link set veth1 netns space-a | |
ip link add veth2 type veth peer name veth3 | |
ip link set veth3 netns space-b | |
ifconfig veth0 0.0.0.0 up | |
ifconfig veth2 0.0.0.0 up | |
ip netns exec space-a ifconfig veth1 192.168.1.130/32 up | |
ip netns exec space-a route add -host 192.168.7.141 dev veth1 |
This file contains hidden or 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
SIZE=400; STEP=100; for i in `wmctrl -l | awk '/VLC/ { print $1 }'`; do wmctrl -ir $i -e 100,$STEP,100,$SIZE,$SIZE; STEP=$(( $STEP + $SIZE )); done |
This file contains hidden or 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
==terminal 1=== | |
ip netns add space-a | |
ip netns add space-b | |
ip link add veth0 type veth peer name veth1 | |
ip link set veth1 netns space-a | |
ip link add veth2 type veth peer name veth3 | |
ip link set veth3 netns space-b | |
ifconfig veth0 10.0.0.0/31 up | |
ifconfig veth2 10.0.0.2/31 up | |
route add -host 10.0.0.1 dev veth0 |
This file contains hidden or 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
void@tahr:/tmp/tmp.6ZYoSGn0V1$ cat Makefile | |
a := foo | |
b := bar | |
var := $(sort $(a) $(b)) | |
all: | |
echo $(var) | |
void@tahr:/tmp/tmp.6ZYoSGn0V1$ make | |
echo bar foo | |
bar foo |
This file contains hidden or 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
#!/bin/bash -x | |
if ! ls /etc/apt/sources.list.d/ | grep project-calico-icehouse-trusty.list; then | |
dpkg --add-architecture i386 | |
apt-add-repository -y ppa:project-calico/icehouse | |
fi | |
apt-get update && apt-get install -y git docker.io | |
IP=`ec2metadata --local-ipv4` |
This file contains hidden or 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
{ | |
'status': 'DOWN', | |
'binding: host_id': u'ip-192-0-2-180', | |
'allowed_address_pairs': [ | |
], | |
'device_owner': 'network: dhcp', | |
'binding: profile': { | |
}, |
This file contains hidden or 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
{ | |
'status': u'DOWN', | |
'binding: host_id': u'ip-192-0-2-180', | |
'allowed_address_pairs': [ | |
], | |
'extra_dhcp_opts': [ | |
], | |
'device_owner': u'network: dhcp', |
This file contains hidden or 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
#!/bin/bash -e | |
# creating snapshot of jenkins instance | |
MOUNTPOINT=/u1 | |
DEVICE="/dev/xvdf" # TODO discover | |
AWS_DEVICE="/dev/sdf" | |
LINEAGE="ci" | |
KEEP=10 # how many shapshots to keep |
OlderNewer