Demo title

T2

OK first time try HackMD

Some diagram

2014-01-052014-01-122014-01-192014-01-262014-02-022014-02-092014-02-16A task           Another task     Task in sec      anther task      SectionAnotherA Gantt Diagram

Images

Code

:+1: cpp code :cry: :elephant:Back

:fire: :arrow_left: :fire_engine:

#!/bin/bash TOKEN="your-oauth-token" # The API v2 OAuth token ACCOUNT_ID="12345" # Replace with your account ID ZONE_ID="yourdomain.com" # The zone ID is the name of the zone (or domain) RECORD_ID="1234567" # Replace with the Record ID IP=`curl --ipv4 -s http://icanhazip.com/` curl -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -X "PATCH" \ -i "https://api.dnsimple.com/v2/$ACCOUNT_ID/zones/$ZONE_ID/records/$RECORD_ID" \ -d "{\"content\":\"$IP\"}"
#!/usr/bin/env python
# encoding: utf-8

# Setup introductions:
# Open Namecheap website, select a domain (e.g. abc.com) then go to Advanced DNS
# (Accounts > Domain List > Advanced DNS)
# Insert an "A + Dynamic DNS Record", with hostname (e.g. my) and type whatnever IP address.
# Edit scripts for proper HOSTNAME (e.g. my.abc.com) and APIKEY (Dynamic DNS Password).
# Run and have fun!

import requests
import io, json
import certifi
from xml.etree import ElementTree

HOSTNAME="YOUR_HOSTNAME"   # Namecheap hostname (including subdomain)
APIKEY="YOUR_DDNS_APIKEY"  # Namecheap DDNS Token (Accounts > Domain List > Advanced DNS)

def getIP():
	r = requests.get("https://ifconfig.co/json", verify=certifi.where()).json()
	return r['ip']

def updateRecord(ip):
	global HOSTNAME
	global APIKEY
	d = HOSTNAME.find('.')
	host = HOSTNAME[:d]
	domain = HOSTNAME[(d+1):]
	# DO NOT change the url "dynamicdns.park-your-domain.com". It's vaild domain provide by namecheap.
	return requests.get("https://dynamicdns.park-your-domain.com/update?host=" + host + "&domain=" + domain + "&password=" + APIKEY + "&ip=" + ip, verify=certifi.where())


ip = getIP()
print("External IP: " + ip)
r = updateRecord(ip)
errCount = ElementTree.fromstring(r.content).find("ErrCount").text
if int(errCount) > 0:
	print("API error\n" + r.content)
else:
	print("Updete IP success!")