(wherever it says url.com, use your server's domain or IP)
Login to new server as root, then add a deploy user
sudo useradd --create-home -s /bin/bash deploy
sudo adduser deploy sudo
sudo passwd deployAnd Update the new password
| ### Keybase proof | |
| I hereby claim: | |
| * I am yiliangt5 on github. | |
| * I am yiliangt5 (https://keybase.io/yiliangt5) on keybase. | |
| * I have a public key ASBTWxGh2Bq4Bc7jg82WPTuwcqJYG-tLXaa6Mj6AyqqeWgo | |
| To claim this, I am signing this object: |
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
| def deco(*dargs): | |
| def wrapper(func): | |
| @functools.wraps(func) | |
| def wrapped(*args, **kwargs): | |
| for _ in range(dargs[0]): | |
| print('has argument') | |
| func(*args, **kwargs) | |
| return wrapped | |
| if len(dargs) > 1 or not callable(dargs[0]): |
| # coding=utf-8 | |
| import redis | |
| class Subscriber(object): | |
| def __init__(self, | |
| redis_client, | |
| ignore_subscribe_messages=True, |
| ifconfig eth0 | grep 'inet addr:' | awk -F'inet addr:' '{ print $2}' | awk '{ print $1}' |
| iptables -I INPUT -p tcp -m multiport --dports http,https -s 103.21.244.0/22 -j ACCEPT | |
| iptables -I INPUT -p tcp -m multiport --dports http,https -s 103.22.200.0/22 -j ACCEPT | |
| iptables -I INPUT -p tcp -m multiport --dports http,https -s 103.31.4.0/22 -j ACCEPT | |
| iptables -I INPUT -p tcp -m multiport --dports http,https -s 104.16.0.0/12 -j ACCEPT | |
| iptables -I INPUT -p tcp -m multiport --dports http,https -s 108.162.192.0/18 -j ACCEPT | |
| iptables -I INPUT -p tcp -m multiport --dports http,https -s 131.0.72.0/22 -j ACCEPT | |
| iptables -I INPUT -p tcp -m multiport --dports http,https -s 141.101.64.0/18 -j ACCEPT | |
| iptables -I INPUT -p tcp -m multiport --dports http,https -s 162.158.0.0/15 -j ACCEPT | |
| iptables -I INPUT -p tcp -m multiport --dports http,https -s 172.64.0.0/13 -j ACCEPT | |
| iptables -I INPUT -p tcp -m multiport --dports http,https -s 173.245.48.0/20 -j ACCEPT |
(wherever it says url.com, use your server's domain or IP)
Login to new server as root, then add a deploy user
sudo useradd --create-home -s /bin/bash deploy
sudo adduser deploy sudo
sudo passwd deployAnd Update the new password
| START=$1 | |
| END=$2 | |
| curr="$START" | |
| while true; do | |
| <command> $curr | |
| [ "$curr" \< "$END" ] || break | |
| curr=$( date +%Y-%m-%d --date "$curr +1 day" ) | |
| done |
| def last_commit_for_path_within_head_repo(path) | |
| # equal to `git rev-list --max-count 1 HEAD #{path}` | |
| walker = Rugged::Walker.new(Rugged:Repository) | |
| walker.sorting(Rugged::SORT_DATE) | |
| walker.push(head_commit) | |
| walker.hide(base_commit) | |
| walker.each { |commit| | |
| return commit.oid if commit.diff(paths: [path]).size > 0 | |
| } | |
| base_commit |