Skip to content

Instantly share code, notes, and snippets.

ficapy ficapy

Block or report user

Report or block ficapy

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ficapy
ficapy / rsa_aes.py
Last active Oct 22, 2019
pycrypto使用AES/RSA加解密
View rsa_aes.py
# !/usr/bin/env python
# -*- coding: utf-8 -*-
from Crypto.Cipher import PKCS1_v1_5
from Crypto.PublicKey import RSA
from Crypto.Hash import SHA
from Crypto import Random
from Crypto.Cipher import AES
aes_obj_enc = AES.new('This is a key123', AES.MODE_CBC, 'This is an IV456')
@ficapy
ficapy / pdfaddtext.py
Created Mar 30, 2018
网页版本使用(20页使用限制) https://ocr.ficapy.com
View pdfaddtext.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author: ficapy
import io
from urllib.parse import urlencode
from base64 import b64encode
from pdf2image import convert_from_bytes
from PyPDF2 import PdfFileWriter, PdfFileReader
@ficapy
ficapy / hshy_checkin.py
Last active Aug 12, 2019
练手python脚本,登陆Discuz论坛打卡签到
View hshy_checkin.py
# -*- coding: utf-8 -*-
import requests
import hashlib
import re
username = '' ###账号###
password = ''###密码###
UA = "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) \
Chrome/27.0.1453.116 Safari/537.36"
headers = {
View create_shapefile.py
from shapely.geometry import mapping, Polygon
import fiona
import csv
# Carrefour GZ
gz = Polygon([])
# chengdu 1
cd1 = Polygon([])
# chengdu 2
cd2 = Polygon([])
View shpefile_add_field.py
from shapely.geometry import mapping, shape
import fiona
import csv
record_index = 'grid filed1 filed2'
record_index = record_index.split()
View insert_csv_to_db.go
package main
import (
"database/sql"
"encoding/csv"
"fmt"
_ "github.com/mattn/go-sqlite3"
"io"
"log"
"os"
View gitlab_403_forbidden.md
  1. docker exec -it gitlab /bin/sh
  2. /opt/gitlab/embedded/bin/redis-cli -s /var/opt/gitlab/redis/redis.socket
  3. keys cache:gitlab:rack::attack*
  4. del cache:gitlab:rack::attack:allow2ban:ban:172.17.0.1
@ficapy
ficapy / install_nginx_http2.md
Created May 21, 2019
install nginx with http2 support on ubuntu 14.04
View install_nginx_http2.md
sudo service nginx stop
sudo apt-get remove nginx nginx-common

sudo add-apt-repository ppa:fxr/nginx-alpn
sudo apt-get update

sudo apt-get install nginx
sudo service nginx restart
@ficapy
ficapy / phash.py
Last active May 12, 2019
将phash得到的64位数据转换成bigint方便存储到数据库
View phash.py
from PIL import Image
import imagehash
def get_phash(file_path):
img = Image.open(file_path)
phash = imagehash.phash(img).hash.flatten()
phash_list = list(map(bool, phash))
if phash_list[0] is True:
View show_polygon.py
from shapely.geometry import Polygon
from matplotlib import pyplot as plt
from shapely.ops import cascaded_union
import geopandas as gpd
m = cascaded_union([Polygon(i if i[0] == i[-1] else i[:-2].append(i[0])) for i in [
[
[81.300003051757812, 37.588695526123047],
[75.599998474121094, 37.588695526123047],
[75.599998474121094, 39.888694763183594],
You can’t perform that action at this time.