替换上你的 API Token,域名ID,记录ID等参数,就可以运行了。 会在后台一直运行,每隔30秒检查一遍IP,如果修改了就更新IP。
获得 domain_id 可以用 curl
curl -k https://dnsapi.cn/Domain.List -d "login_token=TOKEN"`
# 安装vim-powerline | |
cd ~/.vim/bundle | |
git clone git://github.com/Lokaltog/vim-powerline.git | |
# 配置vim-powerline | |
vim ~/.vimrc | |
# ~/.vimrc | |
set nocompatible | |
set laststatus=2 | |
set t_Co=256 |
class ImageWithThumbnail(models.Model): | |
name = models.CharField(max_length = 255) | |
image = models.ImageField(upload_to=settings.UPLOAD_ROOT,max_length=500,blank=True,null=True) | |
thumbnail = models.ImageField(upload_to=settings.UPLOAD_ROOT,max_length=500,blank=True,null=True) | |
def create_thumbnail(self): | |
# original code for this method came from | |
# http://snipt.net/danfreak/generate-thumbnails-in-django-with-pil/ |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
"""Kenneth Reitz's GitHub Syncer | |
This script uses the GitHub API to get a list of all forked, mirrored, public, and | |
private repos in your GitHub account. If the repo already exists locally, it will | |
update it via git-pull. Otherwise, it will properly clone the repo. | |
It will organize your repos into the following directory structure: |
# *-* coding: UTF-8 *-* | |
import hashlib | |
import requests | |
from urllib.parse import urlencode, unquote_plus | |
def ksort(d): | |
return [(k, d[k]) for k in sorted(d.keys())] |
- name: Ensure hostname set | |
hostname: | |
name: {{ inventory_hostname }} | |
when: not inventory_hostname|trim is match('(\d{1,3}\.){3}\d{1,3}') | |
- name: Ensure hostname is in /etc/hosts | |
lineinfile: | |
dest: /etc/hosts | |
regexp: "^{{ ansible_default_ipv4.address }}.+$" | |
line: "{{ ansible_default_ipv4.address }} {{ ansible_fqdn }} {{ ansible_hostname }}" |
#Image Captcha: | |
from captcha.image import ImageCaptcha | |
image = ImageCaptcha | |
data = image.generate(‘9876543’) | |
image.write (‘9876543’,’sam.png’) |
#!/bin/bash | |
set -euo pipefail | |
RELEASE="teleport-v4.2.3-linux-amd64-bin.tar.gz" | |
if [[ $EUID -ne 0 ]]; then | |
echo "--> Please run this script as root or sudo." | |
exit 1 | |
fi |
替换上你的 API Token,域名ID,记录ID等参数,就可以运行了。 会在后台一直运行,每隔30秒检查一遍IP,如果修改了就更新IP。
获得 domain_id 可以用 curl
curl -k https://dnsapi.cn/Domain.List -d "login_token=TOKEN"`
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Bootstrap Table Checkbox Select All and Cancel</title> | |
<link href="//cdn.bootcss.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"> | |
</head> | |
<body> | |
<h2>Bootstrap Table Checkbox Select All and Cancel</h2> | |
<table class="table table-striped"> |
#!/usr/bin/env python3 | |
# Use: ./subnet.py <ip/cidr> | |
# Alt: ./subnet.py <ip> <mask> | |
import sys | |
if __name__=="__main__": | |
addr = [0, 0, 0, 0] | |
mask = [0, 0, 0, 0] | |
cidr = 0 |