Skip to content

Instantly share code, notes, and snippets.

@rming
rming / purge.lua
Created April 10, 2019 06:08 — forked from titpetric/purge.lua
Delete NGINX cached items from a PURGE request
-- Tit Petric, Monotek d.o.o., Thu 27 Oct 2016 10:43:38 AM CEST
--
-- Delete nginx cached assets with a PURGE request against an endpoint
--
local md5 = require 'md5'
function file_exists(name)
local f = io.open(name, "r")
if f~=nil then io.close(f) return true else return false end
package main
import (
"fmt"
"reflect"
)
func StructToMap(s interface{}) map[string]interface{} {
m := make(map[string]interface{})
elem := reflect.ValueOf(s).Elem()
[unix_http_server]
file=/tmp/supervisor.sock ; socket文件的路径,supervisorctl用XML_RPC和supervisord通信就是通过它进行
的。如果不设置的话,supervisorctl也就不能用了
不设置的话,默认为none。 非必须设置
;chmod=0700 ; 这个简单,就是修改上面的那个socket文件的权限为0700
不设置的话,默认为0700。 非必须设置
;chown=nobody:nogroup ; 这个一样,修改上面的那个socket文件的属组为user.group
不设置的话,默认为启动supervisord进程的用户及属组。非必须设置
;username=user ; 使用supervisorctl连接的时候,认证的用户
不设置的话,默认为不需要用户。 非必须设置
package main
import (
"bytes"
"fmt"
"regexp"
)
func main() {
@rming
rming / removeJobsRedisDriver.php
Created March 22, 2019 06:06 — forked from derhansen/removeJobsRedisDriver.php
Laravel 5 - remove all jobs from a queue (redis driver)
Redis::connection()->del('queues:myqueue');
@rming
rming / gist:73c5b7e516099a575b949241d08af691
Created March 4, 2019 02:03
Differences between reread, reload, restart, update?
Would the following definitions work for the documentation ?
reread - Reread supervisor configuration. Do not update or restart the running services.
update - Restart service(s) whose configuration has changed. Usually run after 'reread'.
reload - Reread supervisor configuration, reload supervisord and supervisorctl, restart services that were started.
restart - Restart service(s)
https://github.com/Supervisor/supervisor/issues/720#issuecomment-359222022
@rming
rming / makefile
Created March 1, 2019 06:32 — forked from sohlich/makefile
# Go parameters
GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get
BINARY_NAME=mybinary
BINARY_UNIX=$(BINARY_NAME)_unix
package main
import (
"fmt"
"reflect"
)
type AppInterface interface {
run() *App
}
@rming
rming / generate_package_json.js
Created November 23, 2018 01:48
collect the dependencies in ./node_modules.
var fs = require("fs");
function main() {
fs.readdir("./node_modules", function (err, dirs) {
if (err) {
console.log(err);
return;
}
dirs.forEach(function(dir){
if (dir.indexOf(".") !== 0) {
@rming
rming / gist:19b2a0042e6e98157b103a97c0434e89
Last active August 31, 2018 01:53
laravel-optimize-cache
php artisan optimize --force
php artisan route:cache
php artisan config:cache
php artisan clear-compiled
php artisan route:clear
php artisan config:clear