Skip to content

Instantly share code, notes, and snippets.

View foyo23's full-sized avatar

foyo23 foyo23

View GitHub Profile
@foyo23
foyo23 / events.py
Created August 15, 2021 05:40 — forked from alfakini/events.py
Filesystem events monitoring with Python [events.py]
import os
from PIL import Image
from PIL.ImageOps import grayscale
from watchdog.events import RegexMatchingEventHandler
class ImagesEventHandler(RegexMatchingEventHandler):
THUMBNAIL_SIZE = (128, 128)
IMAGES_REGEX = [r".*[^_thumbnail]\.jpg$"]
def __init__(self):
@foyo23
foyo23 / config.json
Created April 6, 2021 08:39 — forked from tanpengsccd/config.json
v2ray服务端 json 配置 文件
{
"log": {
"access": "/var/log/v2ray/access.log",
"error": "/var/log/v2ray/error.log",
"loglevel": "warning"
},
"inbound": { //理论最安全的方式 ws,有条件加上TLS
"port": 20080, //开启的端口,建议实用caddy加上TLS加密
"protocol": "vmess",
@foyo23
foyo23 / client.go
Created June 22, 2020 05:56 — forked from mwhittaker/client.go
Go Echo Server and Client
package main
import (
"fmt"
"net"
"os"
"time"
)
const (
@foyo23
foyo23 / c
Last active May 12, 2020 15:20
rgb565 to bmp file
/**
RGB introduce:
https://baike.baidu.com/item/BMP/35116?fr=aladdin
https://www.cnblogs.com/lzlsky/archive/2012/08/16/2641698.html
WINGDI.h
**/
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@foyo23
foyo23 / gist:aea3fb3ba7f60423c4454ee55cb23487
Created May 12, 2020 07:39 — forked from taylanpince/gist:a30199647af85698b10b
OV7670 Arduino Serial Integration
#include <Wire.h>
#define OV7670_address 0x21
#ifndef cbi
#define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit))
#endif
#define vga 0
import os
from StringIO import StringIO
import json
import sys
import subprocess
import shutil
def getParent(rootid, id):
print "--> ", id
@foyo23
foyo23 / railsapp-nginx.conf
Last active August 29, 2015 14:02
nginx submodule config file ( railsapp-nginx.conf )
upstream railsapp {
server unix:/home/appuser/app/shared/pids/unicorn.socket;
}
server {
listen 80;
server_name localhost;
location / {
root /home/appuser/app/current/public/;
@foyo23
foyo23 / nginx.conf
Last active August 29, 2015 14:02
nginx main config file for ruby/rails apps( nginx.conf )
user nobody http;
worker_processes 8;
error_log /var/log/nginx-error.log;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
@foyo23
foyo23 / Dockerfile
Created March 20, 2014 03:53 — forked from itsderek23/Dockerfile
Dockerfile for rails app
# docker build -t="rails" .
FROM ubuntu:12.04
RUN apt-get update
## MYSQL
RUN apt-get install -y -q mysql-client libmysqlclient-dev
## RUBY
#!/bin/sh
# modified by jfro from http://www.cnysupport.com/index.php/linode-dynamic-dns-ddns-update-script
# Uses curl to be compatible with machines that don't have wget by default
LINODE_API_KEY=licensekey
DOMAIN_ID=domainid
RESOURCE_ID=resourceid
WAN_IP=`curl -s ifconfig.me/ip`
if [ -f $HOME/.wan_ip.txt ]; then