替换上你的 API Token,域名ID,记录ID等参数,就可以运行了。 会在后台一直运行,每隔30秒检查一遍IP,如果修改了就更新IP。
获得 domain_id 可以用 curl
curl -k https://dnsapi.cn/Domain.List -d "login_token=TOKEN"`
/* Better styles for embedding GitHub Gists */ | |
.gist{font-size:13px;line-height:18px;margin-bottom:20px;width:100%} | |
.gist pre{font-family:Menlo,Monaco,'Bitstream Vera Sans Mono','Courier New',monospace !important} | |
.gist-meta{font-family:Helvetica,Arial,sans-serif;font-size:13px !important} | |
.gist-meta a{color:#26a !important;text-decoration:none} | |
.gist-meta a:hover{color:#0e4071 !important} |
替换上你的 API Token,域名ID,记录ID等参数,就可以运行了。 会在后台一直运行,每隔30秒检查一遍IP,如果修改了就更新IP。
获得 domain_id 可以用 curl
curl -k https://dnsapi.cn/Domain.List -d "login_token=TOKEN"`
# !/usr/bin/env python | |
# -*- coding:utf-8 -*- | |
import sys | |
import time | |
import Queue | |
import threading | |
import traceback | |
class ExitException(Exception): |
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
""" | |
A simple thread pool. | |
@author: Junaid P V | |
@license: GPLv3 | |
""" | |
import os | |
from log_exceptions import log_exceptions | |
def throw_something(a1, a2): | |
raise Exception('Whoops!') | |
@log_exceptions(log_if = os.getenv('MYAPP_DEBUG') is not None) | |
def my_function(arg1, arg2): | |
throw_something(arg1 + 24, arg2 - 24) |
Every so often I have to restore my gpg keys and I'm never sure how best to do it. So, I've spent some time playing around with the various ways to export/import (backup/restore) keys.
cp ~/.gnupg/pubring.gpg /path/to/backups/
cp ~/.gnupg/secring.gpg /path/to/backups/
cp ~/.gnupg/trustdb.gpg /path/to/backups/
# 0 is too far from ` ;) | |
set -g base-index 1 | |
# Automatically set window title | |
set-window-option -g automatic-rename on | |
set-option -g set-titles on | |
#set -g default-terminal screen-256color | |
set -g status-keys vi | |
set -g history-limit 10000 |
/* | |
Copyright 2011 Martin Hawksey | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. | |
You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 | |
Unless required by applicable law or agreed to in writing, software |
Prereq:
apt-get install zsh
apt-get install git-core
Getting zsh to work in ubuntu is weird, since sh
does not understand the source
command. So, you do this to install zsh
wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh