Skip to content

Instantly share code, notes, and snippets.

View moolex's full-sized avatar
🏠
lazying from home

MOYO moolex

🏠
lazying from home
View GitHub Profile
@moolex
moolex / .editorconfig
Created March 23, 2018 03:47
editor config of carno-php
root = true
[*]
end_of_line = lf
insert_final_newline = true
[*.php]
charset = utf-8
indent_style = space
indent_size = 4
@moolex
moolex / thrift2psr4.php
Created June 13, 2017 08:31
Convert thrift generated files to psr4 standard
<?php
/**
* Convert thrift generated files to psr4 standard
* User: moyo
* Date: 13/06/2017
* Time: 3:25 PM
*/
$argc < 3 && exit('Usage: ./thrift2psr4.php srcFolder dstFolder');
@moolex
moolex / Dockerfile
Last active May 7, 2017 13:37
shadowsocks-libev + simple-obfs
#
# Dockerfile for shadowsocks-libev
#
FROM alpine
MAINTAINER kev <noreply@datageek.info>
ARG OB_VER=0.0.3
ARG SS_VER=3.0.6
ARG SS_URL=https://github.com/shadowsocks/shadowsocks-libev/releases/download/v$SS_VER/shadowsocks-libev-$SS_VER.tar.gz
@moolex
moolex / vpnc-script
Created April 26, 2017 15:03
vpnc-script from openconnect
#!/bin/sh
#
# Originally part of vpnc source code:
# © 2005-2012 Maurice Massar, Jörg Mayer, Antonio Borneo et al.
# © 2009-2012 David Woodhouse <dwmw2@infradead.org>
#
# 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.
@moolex
moolex / Dockerfile
Last active April 25, 2017 04:38
PHP Dockerfile include exts: pdo-mysql,yaml,redis,msgpack,phalcon
FROM php:7-alpine
MAINTAINER Shiyu Han <dock@moyo.im>
# Ext versions
ENV YAML_VER=2.0.0
ENV REDIS_VER=3.1.2
ENV MSGPACK_VER=2.0.2
ENV PHALCON_VER=3.1.2
@moolex
moolex / tail2nsq.sh
Created April 24, 2017 07:36
Tail files and send to nsq via curl (logs with json)
#!/bin/sh
tail -n0 -f $@ |
grep --line-buffered "" |
while read line;
do
echo $line && curl -s -d "{"$(echo $line | cut -d"{" -f2-) "http://127.0.0.1:4151/pub?topic=local_fs_tails" > /dev/null
done;
syntax = "proto3";
message Span {
fixed64 traceID = 1;
string spanID = 2;
int64 time = 3;
map<string, string> properties = 4;
@moolex
moolex / ss-rules
Last active January 18, 2017 08:19
ss-rules from shadowsocks-libev@openwrt
#!/bin/sh
usage() {
cat <<-EOF
Usage: ss-rules [options]
Valid options are:
-s <server_host> hostname or ip of shadowsocks remote server
-l <local_port> port number of shadowsocks local server
@moolex
moolex / php-fpm-cli
Last active December 2, 2016 04:35 — forked from muhqu/php-fpm-cli
#!/bin/bash
#
# The MIT License (MIT)
#
# Copyright (c) 2014 Mathias Leppich <mleppich@muhqu.de>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell

Keybase proof

I hereby claim:

  • I am moolex on github.
  • I am moyo (https://keybase.io/moyo) on keybase.
  • I have a public key ASBps2JWwK3Oc5UXfxTfo9T2Eh6xRjjL3F1RPHsUIG9biwo

To claim this, I am signing this object: