(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 deploy
And Update the new password
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 |
START=$1 | |
END=$2 | |
curr="$START" | |
while true; do | |
<command> $curr | |
[ "$curr" \< "$END" ] || break | |
curr=$( date +%Y-%m-%d --date "$curr +1 day" ) | |
done |
(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 deploy
And Update the new password
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 |
ifconfig eth0 | grep 'inet addr:' | awk -F'inet addr:' '{ print $2}' | awk '{ print $1}' |
# coding=utf-8 | |
import redis | |
class Subscriber(object): | |
def __init__(self, | |
redis_client, | |
ignore_subscribe_messages=True, |
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]): |
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
### 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: |