Skip to content

Instantly share code, notes, and snippets.

@yaowenqiang
yaowenqiang / session-life-cycle.md
Created April 27, 2020 10:19 — forked from mindplay-dk/session-life-cycle.md
Complete overview of the PHP SessionHandler life-cycle

This page provides a full overview of PHP's SessionHandler life-cycle - this was generated by a set of test-scripts, in order to provide an exact overview of when and what you can expect will be called in your custom SessionHandler implementation.

Each example is a separate script being run by a client with cookies enabled.

To the left, you can see the function being called in your script, and to the right, you can see the resulting calls being made to a custom session-handler registed using session_set_save_handler().

@yaowenqiang
yaowenqiang / .gdbinit
Created November 25, 2019 18:18 — forked from tetsuok/.gdbinit
Turning off optimization and inlining in Go gc compilers for debugging.
source /usr/local/go/src/pkg/runtime/runtime-gdb.py
b main.main
@yaowenqiang
yaowenqiang / php.ini
Created November 11, 2019 03:20
Optimized php.ini
[PHP]
;;;;;;;;;;;;;;;;;;;
; About php.ini ;
;;;;;;;;;;;;;;;;;;;
; PHP's initialization file, generally called php.ini, is responsible for
; configuring many of the aspects of PHP's behavior.
; http://php.net/engine
engine = On
@yaowenqiang
yaowenqiang / PHP - Install AMQP Extension
Created November 5, 2019 12:33 — forked from hamidreza-s/PHP - Install AMQP Extension
Installing AMQP Extension for PHP in CentOS operation system. This will create an amqp.so shared object that needs to be included in your php.ini file. Find the extensions portal of the ini and add “extension=amqp.so”.
$ git clone git://github.com/alanxz/rabbitmq-c.git
$ cd rabbitmq-c
$ git submodule init
$ git submodule update
$ yum install libtool
$ yum install autoconf
$ yum install automake
$ yum install php-pear
$ yum install php-devel
$ make
@yaowenqiang
yaowenqiang / install.sh
Created October 31, 2019 16:26 — forked from igorepst/install.sh
Install Vim8 with Python3 and GTK3 on CentOS 7.5
sudo yum install epel-release
sudo yum install gcc-c++ ncurses-devel ruby ruby-devel lua lua-devel luajit luajit-devel ctags python python-devel python3 python3-devel tcl-devel perl perl-devel perl-ExtUtils-ParseXS perl-ExtUtils-XSpp perl-ExtUtils-CBuilder perl-ExtUtils-Embed cscope gtk3-devel libSM-devel libXt-devel libXpm-devel libappstream-glib libacl-devel gpm-devel
yum list installed | grep -i vim
# sudo yum erase vim-common.x86_64 vim-enhanced.x86_64 vim-filesystem.x86_64 vim-X11
# sudo depends on vim-minimal
sudo rpm -e --nodeps vim-minimal
sudo ln -s /usr/bin/python3.6 python3
#include <windows.h>
#include <stdio.h>
#include <tchar.h>
#define MAX_BUF 1024
#define pipename "\\\\.\\pipe\\LogPipe"
int main()
{
HANDLE pipe = CreateFile(pipename, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL);
if (pipe == INVALID_HANDLE_VALUE)
local redis_c = require "resty.redis"
local ok, new_tab = pcall(require, "table.new")
if not ok or type(new_tab) ~= "function" then
new_tab = function (narr, nrec) return {} end
end
local _M = new_tab(0, 155)
@yaowenqiang
yaowenqiang / golang.gitlab-ci.yml
Created September 18, 2019 14:45 — forked from npenkov/golang.gitlab-ci.yml
gitlab-ci for Go projects using go dep.
# Replace "projectname" and "username"
image: golang:1.9
variables:
BIN_NAME: projectname
ARTIFACTS_DIR: artifacts
GO_PROJECT: gitlab.com/username/projectname
stages:
- build
@yaowenqiang
yaowenqiang / neovim_install.sh
Created August 31, 2019 11:19 — forked from backroot/neovim_install.sh
neovim install for centos 7
# https://github.com/neovim/neovim/wiki/Installing-Neovim
yum -y install epel-release
curl -o /etc/yum.repos.d/dperson-neovim-epel-7.repo https://copr.fedorainfracloud.org/coprs/dperson/neovim/repo/epel-7/dperson-neovim-epel-7.repo
yum -y install neovim --enablerepo=epel
@yaowenqiang
yaowenqiang / install_nginx_vim.sh
Created January 30, 2019 01:27 — forked from 2called-chaos/install_nginx_vim.sh
enable nginx vim syntax highlighting (on Ubuntu/Debian)
#!/bin/sh
mkdir -p ~/.vim/syntax/
cd ~/.vim/syntax/
wget http://www.vim.org/scripts/download_script.php?src_id=19394
mv download_script.php\?src_id\=19394 nginx.vim
cat > ~/.vim/filetype.vim <<EOF
au BufRead,BufNewFile /etc/nginx/*,/usr/local/nginx/conf/* if &ft == '' | setfiletype nginx | endif
EOF