Skip to content

Instantly share code, notes, and snippets.

View Eminlin's full-sized avatar
🎯
Focusing

Emin Eminlin

🎯
Focusing
View GitHub Profile
@Eminlin
Eminlin / test.php
Created August 24, 2022 09:26
PHP Des加解密文件
<?php
$originFile = file_get_contents('./20211026111907.png'); //等待加密文件
$key = substr(openssl_digest(openssl_digest('password', 'sha1', true), 'sha1', true), 0, 16);// password 为密钥
$enData = openssl_encrypt($originFile, 'DES-ECB', $key, OPENSSL_RAW_DATA); //需要 openssl 支持
$deData = openssl_decrypt($enData, 'DES-ECB', $key, OPENSSL_RAW_DATA);
@Eminlin
Eminlin / aesecb.go
Created August 3, 2022 07:36 — forked from SoulSu/aesecb.go
golang aes ecb pKCS5Padding like java 3DES_ECB_PKCS5Padding
package idcardocr
import (
"bytes"
"crypto/cipher"
"crypto/des"
)
// 3DES加密
@Eminlin
Eminlin / DFA.php
Last active February 13, 2022 03:20
DFA算法构建敏感词匹配
<?php
class SensitiveController extends Controller
{
private $dict;
public function __construct($words) {
$this->dict = array();
// 构建敏感词树
foreach ($words as $_word) {
$uWord = $this->unicodeSplit($_word);
@Eminlin
Eminlin / readme.md
Last active August 5, 2021 09:28
OpenVpn

yum -y install easy-rsa

mkdir /etc/openvpn  
mkdir /etc/openvpn/easy-rsa 

拷贝easy-rsa的文件到/etc/openvpn下
cp -r /usr/share/easy-rsa/3.0.6 /etc/openvpn/easy-rsa

@Eminlin
Eminlin / README.md
Created March 11, 2021 12:19 — forked from chuyik/README.md
macOS 给 Git(Github) 设置代理(HTTP/SSH)
@Eminlin
Eminlin / .zshrc
Created January 5, 2021 09:35
ename zshrc
export GOPROXY=https://goproxy.cn,https://mirrors.aliyun.com/goproxy,direct
export PATH=/usr/local/opt/openssl/bin:$PATH
export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles
export PATH=/usr/local/opt/mysql@5.6/bin:$PATH
export GOPATH=/usr/local/var/go
alias ll='ls -alF'
export PATH=/usr/local/sbin:/usr/local/bin:$PATH
export PATH="/usr/local/opt/php@7.2/bin:$PATH"
export PATH="/usr/local/opt/php@7.2/sbin:$PATH"
export PATH="/usr/local/var/go/bin:$PATH"
@Eminlin
Eminlin / .zshrc
Last active March 29, 2023 14:34
zsh开启代理配置
function off(){
unset http_proxy
unset https_proxy
echo -e "*** off ***"
}
function on(){
export http_proxy="http://127.0.0.1:1087"
export https_proxy=$http_proxy
echo -e "*** on ***"
@Eminlin
Eminlin / fan.py
Created November 21, 2020 10:33
树莓派风扇散热
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import datetime
import os
import time
import RPi.GPIO as GPIO
# GPIO14 08号引脚
GPIO_OUT = 14
# 日志位置
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Hello
Nice to meet you.