Skip to content

Instantly share code, notes, and snippets.

View aguegu's full-sized avatar
🎯
Focusing

Weihong Guan aguegu

🎯
Focusing
View GitHub Profile
@aguegu
aguegu / README.md
Created September 27, 2016 15:19 — forked from chuangbo/README.md
Python dynamic DNSPod DNS Script

替换上你的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"

# Basic Strongswan ikev2 server setup
* paltform: atlantic.net ubuntu 14.04 x64
* the commands below are run with root account
## Strongswan
```
apt-get install strongswan
apt-get install iptables iptables-persistent
```
@aguegu
aguegu / in_venv.sh
Last active August 29, 2015 14:05 — forked from parente/runinenv.sh
#!/bin/bash
. venv/bin/activate
echo "Executing $@ in venv"
exec "$@"
deactivate
in progress (#1046): re-focus this page on deployment of python on linux, esp. suse; perhaps move to PythonDeployment?. for developer set-up, see WritingQualityCode
virtualenv is a tool to create isolated Python environments:
The basic problem being addressed is one of dependencies and versions, and indirectly permissions. Imagine you have an application that needs version 1 of LibFoo , but another application requires version 2. How can you use both these applications? Or what if you want to install an application and leave it be ? If an application works, any change in its libraries or the versions of those libraries can break the application. ... In all these cases, virtualenv can help you.
Machine Set-Up
If your development machine runs ubuntu (or debian) linux, install with apt-get:
#!/bin/bash
tmpfile=/tmp/$$.txt
iconv -f cp936 -t utf-8 $1 > $tmpfile
mv $tmpfile $1