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 / wg0.conf
Last active October 24, 2022 08:35
PublicKey = wKjSrciKsI5/Cgw/7K+IQmizfSllc1fZ1lX9Cu8ByDw=
AllowedIPs = 10.0.0.6/32
PublicKey = 9kbLtWCwINyQgKX3kjSvHA4ez1nji0IjDNuAkTRnlAA=
AllowedIPs = 10.0.0.9/32
@aguegu
aguegu / feeder.js
Created December 13, 2018 08:21
csv.tar.gz generator
/* eslint-env mocha */
/* eslint no-console: 'off' */
import chai from 'chai';
import chaiHttp from 'chai-http';
import 'chai/register-should';
import { createObjectCsvWriter } from 'csv-writer';
import config from 'config';
import _ from 'lodash';
import moment from 'moment';
@aguegu
aguegu / ss2qrcode.py
Created March 18, 2017 14:51
Shadowsocks QRCode generation
import pyqrcode
import base64
url = 'bf-cfb-auth:[email protected]:8888'
print pyqrcode.create('ss://' + base64.b64encode(url)).terminal()
@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"

@aguegu
aguegu / proxy_activate.sh
Created April 3, 2015 06:12
activate/deactivate terminal proxy
#!/bin/zsh
export {http,https,ftp}_proxy='http://localhost:7777'
@aguegu
aguegu / conv.py
Created December 17, 2014 03:00
python script to batch converting from mkv to mp4
#!/usr/bin/env python
from subprocess import call
for i in range(4, 25):
call(["avconv", "-i", "DFTV.Ipartment.S03E%02d.720p.HDTV.x264-NGB.mkv" % i, "-acodec", "aac", "-strict", "experimental", "DFTV.Ipartment.S03E%02d.720p.HDTV.x264-NGB.mp4" % i])
# 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
@aguegu
aguegu / .editorconfig
Last active August 29, 2015 14:03
BendixCrawler
# EditorConfig is awesome: http://EditorConfig.org
# top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
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: