Skip to content

Instantly share code, notes, and snippets.

@hjhee
hjhee / docker-compose.yml
Created March 24, 2021 08:10
A docker compose configuration for nginx & php-fpm via unix socket
# tutorial: https://www.pascallandau.com/blog/php-php-fpm-and-nginx-on-docker-in-windows-10/
version: '3'
services:
php-fpm:
image: php:7.4-fpm-alpine
container_name: php-fpm
volumes:
- type: bind
source: $HOME/dev/soap
target: /var/www
@hjhee
hjhee / transcode_x265.bat
Last active April 13, 2019 13:20
Transcode all mp4 to x265
@echo off
for /r %%i in (*.mp4) do (
ffmpeg -i "%%i" -c:a copy -c:v hevc_amf "%%~di%%~pix265\%%~ni.mp4"
)
@hjhee
hjhee / steam-crawler.go
Created October 5, 2018 09:32
A Image Crawler for Steam
package main
import (
"bytes"
"fmt"
"io/ioutil"
"net/http"
"net/http/httputil"
"net/url"
"os"
@hjhee
hjhee / dolc.go
Last active November 26, 2017 14:11
monitor discuz! posts and send notify via pushbullet
package main
import (
"bufio"
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"net/url"
@hjhee
hjhee / svcdisablelist.txt
Created October 28, 2017 07:44
Windows 10 2016 LTSB Service Disable List
AJRouter
ALG
AppMgmt
BthHFSrv
bthserv
PeerDistSvc
CertPropSvc
NfsClnt
MapsBroker
lfsvc
@hjhee
hjhee / exercise-web-crawler.go
Created July 27, 2017 07:16
solution with package "sync"
// https://tour.go-zh.org/concurrency/10
func Crawl(url string, depth int, fetcher Fetcher) {
var wg sync.WaitGroup
var mux sync.Mutex
fetched := make(map[string]bool)
var crawl func(url string, depth int, fetcher Fetcher)
crawl = func (url string, depth int, fetcher Fetcher) {
defer wg.Done() // ref - 1
if depth <= 0 {
return
@hjhee
hjhee / rtsp.c
Created July 20, 2017 03:51
an example for rtsp to mp4 remuxing without transcoding
#include <libavutil/timestamp.h>
#include <libavformat/avformat.h>
#include <signal.h>
#include <unistd.h>
#include <pthread.h>
#include <errno.h>
static volatile int keep_running=1;
static AVOutputFormat *ofmt=NULL;
@hjhee
hjhee / dissolve_ragdolls.sp
Last active June 21, 2017 14:53
Dissolve Common Infected Ragdolls
// #pragma newdecls required
#include <sourcemod>
#include <sdktools>
#include <smlib>
#define PLUGIN_VERSION "0.1.3"
public Plugin myinfo={
name="[L4D] Dissolve Ragdolls",
author="hjhee",
description="Dissolve Common Infected Ragdolls.",
@hjhee
hjhee / abm.sp
Created June 14, 2017 04:05
adjusted MaxSpecials, DominatorLimit...
//# vim: set filetype=cpp :
/*
ABM a SourceMod L4D2 Plugin
Copyright (C) 2016 Victor NgBUCKWANGS Gonzalez
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
@hjhee
hjhee / srs.despawninfected.sp
Created June 14, 2017 03:44
prevent server crash by using /use z_spawn_old instead of z_spawn
/* _
* ___ _ __ ___ _ __ ___ ___ __| |
* / __| '__/ __| '_ ` _ \ / _ \ / _` |
* \__ \ | \__ \ | | | | | (_) | (_| |
* |___/_| |___/_| |_| |_|\___/ \__,_|
*
* _| _ _ _ _ _ . _ |` _ __|_ _ _|
* (_|(/__\|_)(_|VV| | || |~|~(/_(_ | (/_(_|
* | _ _ _ _| | _
* | | |(_)(_||_||(/_