替换上你的 API Token,域名ID,记录ID等参数,就可以运行了。 会在后台一直运行,每隔30秒检查一遍IP,如果修改了就更新IP。
获得 domain_id 可以用 curl
curl -k https://dnsapi.cn/Domain.List -d "login_token=TOKEN"`
def format_filename(s): | |
"""Take a string and return a valid filename constructed from the string. | |
Uses a whitelist approach: any characters not present in valid_chars are | |
removed. Also spaces are replaced with underscores. | |
Note: this method may produce invalid filenames such as ``, `.` or `..` | |
When I use this method I prepend a date string like '2009_01_15_19_46_32_' | |
and append a file extension like '.txt', so I avoid the potential of using | |
an invalid filename. | |
#!/usr/bin/env python | |
# | |
# Converts any integer into a base [BASE] number. I have chosen 62 | |
# as it is meant to represent the integers using all the alphanumeric | |
# characters, [no special characters] = {0..9}, {A..Z}, {a..z} | |
# | |
# I plan on using this to shorten the representation of possibly long ids, | |
# a la url shortenters | |
# |
替换上你的 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 -*- | |
## | |
## | |
# Copyright (C) | |
# | |
# This program is free software; you can redistribute it and/or | |
# modify it under the terms of the GNU General Public License | |
# as published by the Free Software Foundation. | |
# 本程序是免费软件,基于GPL许可发布。 |
#!/bin/bash | |
# bash generate random alphanumeric string | |
# | |
# bash generate random 32 character alphanumeric string (upper and lowercase) and | |
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1) | |
# bash generate random 32 character alphanumeric string (lowercase only) | |
cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 32 | head -n 1 |
Since this is on Hacker News and reddit...
_t
in my types. I spend a lot of time at a level where I can do that; "reserved for system libraries? I am the system libraries".char *
s.type * name
, however, is entirely intentional.Look at LSB init scripts for more information.
Copy to /etc/init.d
:
# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
var request = require('request'); | |
var Iconv = require('iconv').Iconv; | |
var iconv = new Iconv('GBK', 'UTF-8//TRANSLIT//IGNORE'); | |
request.get('http://foo.bar', {encoding:null}, function(e, r, body) | |
{ | |
console.log(iconv.convert(body).toString()); | |
}); |