# set http proxy
export http_proxy=http://PROXYHOST:PROXYPORT
# set http proxy with user and password
export http_proxy=http://USERNAME:PASSWORD@PROXYHOST:PROXYPORT
# set http proxy with user and password (with special characters)
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 | |
#---- | |
# bootstrap fedora18 | |
#release=$(cat /etc/fedora-release | awk '/^Fedora/ {print $3}') | |
#arch=$(arch) | |
release=18 | |
arch=x86_64 | |
ROOTFS=/var/lib/libvirt/lxc/fedora$release-$arch |
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 | |
#Asking for sudo because the script needs it almost all the time | |
sudo echo -n | |
#Creating the key used to sign the two modules | |
echo 'Preparing vmware key...' | |
openssl req -new -x509 -newkey rsa:2048 -keyout VMWAREKEY.priv -outform DER -out VMWAREKEY.der -nodes -days 36500 -subj "/CN=VMware/" | |
#Sign the modules |
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
version: '2.1' | |
services: | |
php: | |
tty: true | |
build: | |
context: . | |
dockerfile: tests/Docker/Dockerfile-PHP | |
args: | |
version: cli | |
volumes: |
国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。
Dockerized 实践 https://github.com/y0ngb1n/dockerized
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 | |
VM_NAME=UbuntuAutoinstall | |
UBUNTU_ISO="$PWD/ubuntu-groovy-live-server-amd64.iso" | |
UBUNTU_DOWNLOAD_URL=http://cdimage.ubuntu.com/ubuntu-server/daily-live/current/groovy-live-server-amd64.iso | |
set -eux | |
[[ ! -e "$UBUNTU_ISO" ]] && wget -O "$UBUNTU_ISO" $UBUNTU_DOWNLOAD_URL |
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
#!/usr/bin/env python3 | |
""" | |
This is a tool for recovering lost machine units in current model | |
Usage: | |
{0} model-name dest-dir | |
""" | |
# changes summary: | |
# added logic to prevent overwrite /var/lib/juju to avoid removing non-machine units |
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
#!/usr/bin/gawk -f | |
# | |
# Usage: ./rabbit-tell.awk <rabbitmqctl_report> | |
# | |
# Common RabbitMQ issues that this script can be used to identify | |
# | |
# - Partitioned cluster | |
# | |
# - High binary/queue memory usage. There are mainly two causes of this: | |
# |
- I faced bandwidth issues between a WG Peer and a WG server. Download bandwidth when downloading from WG Server to WG peer was reduced significantly and upload bandwidth was practically non existent.
- I found a few reddit posts that said that we need to choose the right MTU. So I wrote a script to find an optimal MTU.
- Ideally I would have liked to have run all possible MTU configurations for both WG Server and WG Peer but for simplicity I choose to fix the WG Server to the original 1420 MTU and tried all MTUs from 1280 to 1500 for the WG Peer.
- On WG server, I started an
iperf3
server - On WG peer, I wrote a script that does the following:
wg-quick down wg0
- Edit MTU in the
/etc/wireguard/wg0.conf
file