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
--- | |
- hosts: all | |
become: true | |
tasks: | |
- name: kubelet gce config | |
copy: | |
dest: /etc/default/kubelet | |
content: KUBELET_EXTRA_ARGS=--cloud-provider=gce # Add your custom flag here | |
- name: Systemd reload configs |
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
# -*- coding: utf-8 -*- | |
""" | |
A very simple stack-based virtual machine in Python | |
Example: | |
PSH 1 # push 1 into the stack | |
PSH 2 # push 2 into the stack | |
ADD # add the topest 2 values and pop them | |
POP # pop the top of the stack and print 3 | |
HLT # end the program |
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
var nowall_proxy = "SOCKS5 127.0.0.1:1080; SOCKS 127.0.0.1:1080;"; | |
var wall_proxy = "DIRECT;"; | |
var direct = "DIRECT;"; | |
var ip_proxy = "DIRECT;"; | |
/* | |
* Copyright (C) 2014 breakwa11 | |
* https://github.com/breakwa11/gfw_whitelist | |
*/ |
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
class UF: | |
def __init__(self, n): | |
self.par = list(range(n)) | |
self.rank = [0] * n | |
def find(self, x): | |
if x != self.par[x]: | |
self.par[x] = self.find(self.par[x]) | |
return self.par[x] |
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
const createStore = (reducer) => { | |
const states = [reducer()]; | |
let sp = 0; // stack pointer | |
const listeners = new Set(); | |
function notify() { | |
for (const listener of listeners) { | |
listener(); | |
} | |
} |
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
def water_metabolism( | |
activity_level: float, # 1.5: static, 1.75: intermediate, 2: dynamic | |
weight: float, # in kgs | |
gender: int, # 0: female, 1: male | |
humidity: int = 50, # in percent, e.g. 50 | |
is_athlete: int = 0, # 0: not athlete, 1: athlete | |
hdi: int = 0, # 0: developed countries, 1: intermediate, 2: developing countries | |
above_sea_level: float = 25, # in metres | |
age: float = 30, # your current age | |
temperature: float = 15, # average daily temperature in celsius, e.g. 15 |
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
LOCAL=$1 # /home/user/test/ | |
REMOTE=$2 # /home/remoteuser/test/ | |
if [[ -z "$LOCAL" || -z "$REMOTE" ]]; then | |
echo 'No src/dst folder' | |
exit | |
fi | |
while inotifywait -r -e modify,create,delete $LOCAL; do | |
rsync -avuz --delete -e "ssh -o \"ProxyCommand=connect-proxy -H YOUR_PROXY_HOST:YOUR_PROXY_PORT %h %p\"" $LOCAL YOUR_USERNAME@YOUR_SERVER_IP:$REMOTE |
OlderNewer