Skip to content

Instantly share code, notes, and snippets.

@merong
merong / OCR.java
Created May 12, 2017 12:34 — forked from christianroman/OCR.java
Captcha OCR + Tesseract
public class OCR {
private static final String INPUT = "C:/captcha/ex.png";
private static final String OUTPUT = "C:/captcha/captcha-out.png";
private static final String TESSERACT_BIN = "C:/Program Files/Tesseract-OCR/tesseract.exe";
private static final String TESSERACT_OUTPUT = "C:/captcha/out.txt";
private static final int WHITE = 0x00FFFFFF, BLACK = 0x00000000;
public static void main(String... args) throws Exception {
BufferedImage image = ImageIO.read(new FileInputStream(INPUT));
int average = 0;
@merong
merong / gist:3d454597597be1dbf18dab1c080ee8b3
Created September 28, 2017 08:08
메일건 발송 api
<?php
class MailgunMailer {
const CRLF = "\r\n";
const DEFAULT_CHARSET = "utf-8";
private $Charset = "utf-8";
@merong
merong / gist:f92faf9a06d1347c65b09eaa59173abf
Created October 15, 2017 04:05 — forked from moneytoo/gist:8c95cc39fd4fd9a18858eb15e379d2f5
ImageMagick 6.7.8 with WebP (libwebp) support on CentOS 7
yum -y install bzip2-devel libtiff-devel giflib-devel ghostscript-devel libwmf-devel jasper-devel libtool-ltdl-devel libXext-devel libXt-devel librsvg2-devel OpenEXR-devel libwebp-devel
rpm -ivh http://vault.centos.org/centos/7/updates/Source/SPackages/ImageMagick-6.7.8.9-15.el7_2.src.rpm
sed -i '/BuildRequires:\tghostscript-devel/a BuildRequires:\tlibwebp-devel' /root/rpmbuild/SPECS/ImageMagick.spec
sed -i '/Requires: pkgconfig/a Requires: libwebp' /root/rpmbuild/SPECS/ImageMagick.spec
rpmbuild -ba /root/rpmbuild/SPECS/ImageMagick.spec
# actual install
rpm -Uvh --force /root/rpmbuild/RPMS/x86_64/ImageMagick-6.7.8.9-15.el7.centos.x86_64.rpm
@merong
merong / sphinx.conf
Created December 16, 2017 15:40 — forked from dougmorato/sphinx.conf
Sample sphinx.conf file to index Tryton product name and description
#
# Sphinx configuration file sample
#
# Please refer to doc/sphinx.html for details.
#
#############################################################################
## data source definition
#############################################################################
@merong
merong / README.md
Created April 24, 2018 11:45 — forked from oodavid/README.md
Backup MySQL to Amazon S3

Backup MySQL to Amazon S3

This is a simple way to backup your MySQL tables to Amazon S3 for a nightly backup - this is all to be done on your server :-)

Sister Document - Restore MySQL from Amazon S3 - read that next

1 - Install s3cmd

this is for Centos 5.6, see http://s3tools.org/repositories for other systems like ubuntu etc

@merong
merong / HTML: HTML5 Default Template
Created August 31, 2018 04:17 — forked from fakiolinho/HTML: HTML5 Default Template
HTML: HTML5 Default Template
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title></title>
<!-- Favicons Start -->
<!-- In case image.ico -->
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico" />
@merong
merong / gist:87cdfcc7afdb2873029cc9cf00dd4b3d
Created July 26, 2019 14:18
intellj phpstorm editor code replace regex
mysql schema to bean
search regex : `([a-zA-Z0-9_]+)`.*COMMENT '(.*)',$
replace regex : private String $1 = ""; //$2
@merong
merong / nginx.conf
Created January 18, 2020 10:40 — forked from CSRaghunandan/nginx.conf
Nginx configuration for serving mp4 videos
#user nobody;
worker_processes 4;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
@merong
merong / exclude_files.sh
Created May 10, 2020 13:09
bash script build file with exclude files
#!/usr/bash
dir=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
BASE_PATH=${dir}
BUILD_DIR=${BASE_PATH}/build
TEMP_DIR=${BASE_PATH}/temp
mkdir -p ${TEMP_DIR}
@merong
merong / nginx_wss_reverse_proxy.conf
Created June 6, 2020 04:39
nginx 리버스 프록시를 사용하여 ws 를 wss로 전환 처리
# nginx에서 웹소켓 reverse proxy 설정은 아래내용을 참조하세요.
# https://www.joinc.co.kr/w/man/12/nginx/wsproxy
#설정 예제
#아래와 같이 설정한 경우 wss주소는
# ws://호스트도메인:9000/ 으로 채팅서버를 실행하였다면,
# wss://호스트도메인:8080/ 이 됩니다.
# 운용하는 채팅서버 아이피가 다른 경우 proxy_pass에 아이피를 지정하시면 됩니다.