start new:
tmux
start new with session name:
tmux new -s myname
| package main | |
| import ( | |
| "bufio" | |
| "log" | |
| "net/rpc" | |
| "os" | |
| ) | |
| func main() { |
| package main | |
| import ( | |
| "flag" | |
| "io" | |
| "log" | |
| "net" | |
| "os" | |
| "os/signal" | |
| "runtime/pprof" |
| package main | |
| import ( | |
| "net" | |
| "fmt" | |
| "io" | |
| "os" | |
| ) | |
| func main() { | |
| if len(os.Args) != 3 { | |
| fatal("usage: netfwd local remote") |
| #!/usr/bin/env python2.7 | |
| # Matt's DNS management tool | |
| # Manage DNS using DDNS features | |
| # | |
| # See http://planetfoo.org/blog/archive/2012/01/24/a-better-nsupdate/ | |
| # | |
| # Usage: dnsupdate -s server -k key -t ttl add _minecraft._tcp.mc.example.com SRV 0 0 25566 mc.example.com. | |
| # -h HELP! | |
| # -s the server | |
| # -k the key |
| def capture_stderr(&block) | |
| original = $stderr | |
| captured = $stderr = StringIO.new | |
| begin | |
| yield | |
| ensure | |
| $stderr = original | |
| end |
替换上你的Email,密码,域名ID,记录ID等参数,就可以运行了。 会在后台一直运行,每隔30秒检查一遍IP,如果修改了就更新IP。
获得domain_id可以用curl
curl -k https://dnsapi.cn/Domain.List -d "login_email=xxx&login_password=xxx"
获得record_id类似
curl -k https://dnsapi.cn/Record.List -d "login_email=xxx&login_password=xxx&domain_id=xxx"
updated by undoZen:
This is a mix between two sources:
basically the first resource is great but didn't work for me: I had to remove the trailing "/*" in the resource string to make it work. I also noticed that setting the policy on the source bucket was sufficient. In the end these are the exact steps I followed to copy data between two buckets on two accounts
Basically the idea there is:
SSHPass is a tiny utility, which allows you to provide the ssh password without using the prompt. This will very helpful for scripting. SSHPass is not good to use in multi-user environment. If you use SSHPass on your development machine, it don't do anything evil.
apt-get install sshpass