This file contains hidden or 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 -*- | |
| """ | |
| 给定一个pdf路径,以及一个列表,可修改pdf内容,删除所有符合条件的文字。 | |
| """ | |
| from PyPDF2 import PdfFileReader, PdfFileWriter | |
| from PyPDF2.generic import TextStringObject, NameObject | |
| from PyPDF2.pdf import ContentStream | |
| from PyPDF2.utils import b_ |
This file contains hidden or 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
| -- Load Vue library | |
| package.loadlib("https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.js", "*") | |
| -- Get Object helper | |
| local Object = dofile("https://gist.githubusercontent.com/daurnimator/5a7fa933e96e14333962093322e0ff95/raw/8c6968be0111c7becc485a692162ad100e87d9c7/Object.lua").Object | |
| local myapp = js.new(js.global.Vue, Object{ | |
| el = "#foo"; | |
| template = [[ | |
| <div id="foo">{{message}}</div> | |
| ]]; |
This file contains hidden or 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
| /// 使用 syslog 作为日志后端,可替代默认的 logger. | |
| // | |
| // 配置 | |
| // | |
| // logservice = "sx_syslog" | |
| // logger = "skynet.server.20170924-a577f12.ci.1" | |
| // | |
| // logger 配置 ident 和 syslog 选项。Ident 必须是有效的文件名,不能包含 /[] 等特殊字符。 | |
| // | |
| // 比如可以按照下面方案 |
This file contains hidden or 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
| local DIRSEP = package.config:sub(1, 1) | |
| local function is_readable(filename) | |
| local fd = io.open(filename, "r") | |
| if fd then | |
| fd:close() | |
| return true | |
| else | |
| return false | |
| end |
This file contains hidden or 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
| #!/usr/bin/env python3 | |
| """ | |
| License: MIT License | |
| Copyright (c) 2023 Miel Donkers | |
| Very simple HTTP server in python for logging requests | |
| Usage:: | |
| ./server.py [<port>] | |
| """ | |
| from http.server import BaseHTTPRequestHandler, HTTPServer |
This file contains hidden or 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
| #! /bin/sh | |
| # update glibc to 2.17 for CentOS 6 | |
| wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-2.17-55.el6.x86_64.rpm | |
| wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-common-2.17-55.el6.x86_64.rpm | |
| wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-devel-2.17-55.el6.x86_64.rpm | |
| wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-headers-2.17-55.el6.x86_64.rpm | |
| sudo rpm -Uvh glibc-2.17-55.el6.x86_64.rpm \ |
This file contains hidden or 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
| #!/usr/bin/env python | |
| #encoding: utf-8 | |
| import urllib2 | |
| import re | |
| from base64 import b64decode | |
| LIST_URL = 'https://raw.githubusercontent.com/gfwlist/gfwlist/master/gfwlist.txt' | |
| DECODE_FILE = 'decode.txt' | |
| BLACK_FILE = 'gfw.url_regex.lst' |
This file contains hidden or 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
| local redis_c = require "resty.redis" | |
| local ok, new_tab = pcall(require, "table.new") | |
| if not ok or type(new_tab) ~= "function" then | |
| new_tab = function (narr, nrec) return {} end | |
| end | |
| local _M = new_tab(0, 155) |
This file contains hidden or 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
| adb kill-server | |
| adb connect 127.0.0.1:53001 |
This file contains hidden or 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
| import xlrd | |
| import sys | |
| if __name__ == '__main__': | |
| if len(sys.argv) != 2: | |
| print "Usage: git-xlsx-textconv file.xslx" | |
| excelFileName = sys.argv[1] | |
| xlFile = xlrd.open_workbook(excelFileName) |