Skip to content

Instantly share code, notes, and snippets.

View FindHao's full-sized avatar
💭
Don't worry, be happy

Yueming Hao FindHao

💭
Don't worry, be happy
View GitHub Profile
s为字符串
s.isalnum() 所有字符都是数字或者字母
s.isalpha() 所有字符都是字母
s.isdigit() 所有字符都是数字
s.islower() 所有字符都是小写
@FindHao
FindHao / git ignore文件 android studio
Created February 3, 2016 04:11
git ignore文件 android studio
# built application files
*.apk
*.ap_
# files for the dex VM
*.dex
# Java class files
*.class
@FindHao
FindHao / 匹配ls -l结果中的文件或文件夹名
Created February 15, 2016 05:55
匹配linux下ls -l结果中的文件名
linux下ll命令部分结果,以文件名有引号的特殊举例:
```
drwxr-xr-x 2 find find 4096 2月 15 13:10 "hello wo"
-rw-r--r-- 1 find find 0 2月 15 13:10 "list无名 fd"
```
匹配的正则表达式
```
[drwx-]{10}\s+?\d{1,2}\s+?\w+?\s+?\w+?\s+?\d+?\s+?[\d\w\u4e00-\u9fa5]+?\s+?\d+?\s+?[\d:]+?\s+?(.*)
```
同样对于ftp中的dir命令结果也是如此
@FindHao
FindHao / gist:eddd5bf354e44d0eb7df0c838535ba4a
Created May 27, 2016 05:12 — forked from AbeEstrada/gist:11e4511f9915b00f9714
Cloudflare Email Protection Decoder in Go
package main
import (
"bytes"
"strconv"
)
func cf(a string) (s string) {
var e bytes.Buffer
r, _ := strconv.ParseInt(a[0:2], 16, 0)
@FindHao
FindHao / cloudflare_email_decoder_python
Created May 27, 2016 07:49
cloudflare 邮件保护混淆的decoder
```python
def decode(encode_email):
k = int(encode_email[:2], 16)
ans = ''
for i in range(2, len(encode_email)-1, 2):
a = int(encode_email[i:i+2], 16)
a ^= k
ans += chr(a)
print(ans)
@FindHao
FindHao / update_hosts.sh
Last active April 10, 2019 10:29
update hosts bash脚本
```
ipv6=$1
work_path="/home/find/Downloads/"
rm $work_path/hosts*
cp /etc/hosts $work_path/._backhosts
if [ "$ipv6" = "4" ]
then
#wget https://coding.net/u/onekeyhosts/p/text/git/raw/master/hosts -O hosts
wget https://coding.net/u/scaffrey/p/hosts/git/raw/master/hosts-files/hosts -O $work_path/hosts
# wget https://raw.githubusercontent.com/sy618/hosts/master/FQ -O hosts
@FindHao
FindHao / matrixMul.cu
Created July 3, 2017 05:35
cuda的矩阵乘法sample,去掉了helper_function相关
#include <stdio.h>
#include <assert.h>
#include <cuda_runtime.h>
template <int BLOCK_SIZE> __global__ void
matrixMulCUDA(float *C, float *A, float *B, int wA, int wB)
{
// Block index
int bx = blockIdx.x;
int by = blockIdx.y;
// Thread index
@FindHao
FindHao / vectoradd.cu
Created July 4, 2017 05:03
向量加法,cuda版本
__global__ void add_vectors(
const int* a,
const int* b,
int *c,
const int n)
{
const int idx = blockIdx.x * blockDim.x + threadIdx.x;
if (idx >= n) return;
@FindHao
FindHao / x265-arm patch
Created November 25, 2017 06:58
x265的arm补丁
diff -urN a/source/CMakeLists.txt b/source/CMakeLists.txt
--- a/source/CMakeLists.txt 2015-02-10 14:15:13.000000000 -0700
+++ b/source/CMakeLists.txt 2015-02-12 06:25:01.334927114 -0700
@@ -46,10 +46,18 @@
set(X64 1)
add_definitions(-DX86_64=1)
endif()
+elseif(${SYSPROC} MATCHES "armv5.*")
+ message(STATUS "Detected ARMV5 system processor")
+ set(ARMV5 1)
@FindHao
FindHao / xiguashipin.py
Last active January 10, 2018 14:35
西瓜视频百万英雄有奖竞答一类直播节目的ocr工具。实现的功能,通过adb获取截图,然后ocr出文字,并通过浏览器打开搜索结果。
import pytesseract
import time
from PIL import Image
import os
import webbrowser
path = "/home/find/d/filerecv/xigua.png"
import subprocess
def get_screen_shot(path):
# 这里获取截图,目前的方法太慢了