View pdfformfiller.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package render | |
import ( | |
"bytes" | |
"fmt" | |
"math" | |
"github.com/pdfcpu/pdfcpu/pkg/api" | |
"github.com/pdfcpu/pdfcpu/pkg/pdfcpu" | |
"github.com/pdfcpu/pdfcpu/pkg/pdfcpu/validate" |
View yearning_token_refresh.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Yearning 自动刷新 Token | |
// @description 自动刷新 Yearning Token, 测试于 Yearning 2.1.6 | |
// @author Yaguang Ding | |
// @namespace https://yearning.yourcompany.com/ | |
// @version 0.1 | |
// @include https://yearning.yourcompany.com/* | |
// @content self | |
// @require tampermonkey://vendor/jquery.js | |
// @grant GM_notification |
View gist:c81fc1e0ee7cd28aa843292e4bfbfbca
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
root@xx:~/data# iptables -L | |
Chain INPUT (policy DROP) | |
target prot opt source destination | |
ufw-before-logging-input all -- anywhere anywhere | |
ufw-before-input all -- anywhere anywhere | |
ufw-after-input all -- anywhere anywhere | |
ufw-after-logging-input all -- anywhere anywhere | |
ufw-reject-input all -- anywhere anywhere | |
ufw-track-input all -- anywhere anywhere |
View xpath syntax
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. 获取后面的节点 | |
//div[@class="drop-features"]/following-sibling::p/text() | |
2. lxml 节点tostring | |
from lxml import etree | |
etree.tostring(Element) | |
View gist:74dbe459a2b31e2e5213
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=========== 文件磁盘======== | |
---- init ---- | |
#安装依赖 | |
sudo apt-get install cryptsetup | |
#虚拟磁盘并格式化 | |
sudo fallocate -l 512M /root/home | |
sudo cryptsetup -y luksFormat /root/home |
View gevent-pool-requests.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#coding=utf-8 | |
__author__ = 'ding' | |
from gevent import monkey | |
monkey.patch_all() | |
from gevent.pool import Pool | |
import requests | |
sites = [u'0i4t.com', u'0757dk.com', u'0007ka.com', u'003782.com', u'0735.com', u'04336789.com', u'078078.com', u'0851qy.com', u'008321.com', u'0427d7.se', u'010sf.com', u'0476com.com', u'0470a.com', u'0163.com', u'00992.com', u'0759job.com', u'0437t.com', u'057191.com', u'0932.info', u'0311xinhua.cn', u'041pao.com', u'009997.com', u'018tk.com', u'099cf.com', u'0576qq.com', u'0101010.info', u'001lv.org', u'0771pc.com', u'0734kj.com', u'076665.cn', u'001123.com', u'08kkkk.com', u'0416hlw.com', u'0452e.com', u'001ni.com', u'001dd.com', u'012666.com', u'010tk.com', u'0579h.com', u'0851yifu.com', u'06049.com', u'044944.com', u'0752oa.net', u'003003.net', u'050gg.com', u'02325.org', u'0744y.com', u'0523114.com', u'0449aa.com', u'0597house.com', u'0411house.com', u'099333.com', u'001lv.com', u'050q.com', u'067.cc', u'02kkk.com', u'050ww.com', u'0437.gov.cn', u'073311.com', u'024www.net', u'0 |
View nginx.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 把形如 /article/ 变成 /article/index.php | |
location ~ ^/article[^.]*/$ | |
{ | |
rewrite ^(.*)$ $1index.php last; | |
} | |
# 之所以没有用$fastcgi_script_name是因为,$fastcgi_script_name会带上/article前缀,导致404,所以我自己获取了脚本的路径 | |
# 应该有更正确的方式去掉/article? | |
location ~ ^/article/(.*)$ { | |
alias /usr/local/nginx-1.6.2/html/wordpress/; |
View sqlalchemy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__author__ = 'ding' | |
from sqlalchemy import Column, Sequence, ForeignKey | |
from sqlalchemy.types import CHAR, Integer, String, DateTime | |
from sqlalchemy.ext.declarative import declarative_base | |
from sqlalchemy.orm import relationship | |
from webservice.conf import mysql_engine | |
BaseModel = declarative_base() |
View gist:7110990
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
capify . | |
cap -v |
View gist:7097992
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 2012/12/11 | |
* ding | |
* */ | |
import java.awt.Graphics; | |
import java.awt.image.BufferedImage; | |
import java.io.ByteArrayInputStream; | |
import java.io.ByteArrayOutputStream; | |
import java.io.File; |
NewerOlder