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 / 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 / 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
#!/bin/bash
# CentOS rbenv system wide installation script
# Forked from https://gist.github.com/1237417
# Installs rbenv system wide on CentOS 5/6, also allows single user installs.
# Install pre-requirements
yum install -y gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel openssl-devel \
make bzip2 autoconf automake libtool bison iconv-devel git-core
@foyo23
foyo23 / Makefile
Created October 15, 2012 15:24 — forked from utaal/Makefile
webserver using libuv
webserver: webserver.c libuv/libuv.a http-parser/http_parser.o
gcc -I libuv/include \
-lrt -lm -lpthread -o \
webserver webserver.c \
libuv/libuv.a http-parser/http_parser.o
libuv/libuv.a:
$(MAKE) -C libuv
http-parser/http_parser.o:
@foyo23
foyo23 / unicorn
Created April 11, 2012 15:27 — forked from tomkersten/bash.bashrc
unicorn startup script for rails app
#! /bin/sh
# File: /etc/init.d/unicorn
### BEGIN INIT INFO
# Provides: unicorn
# Required-Start: $local_fs $remote_fs $network $syslog