Skip to content

Instantly share code, notes, and snippets.

View sursir's full-sized avatar
💥
COME BACK

Heisenberg sursir

💥
COME BACK
View GitHub Profile
@sursir
sursir / gist:73a3b3d8d9e22f81b21ac5bfce910b85
Last active October 8, 2018 09:30 — forked from avoine/gist:2912777
Bridge to send rsyslog logs to sentry (http://www.getsentry.com)
#!/usr/bin/env python
#
# Copyright 2012 Patrick Hetu <[email protected]>
#
# 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 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@sursir
sursir / Install wkhtmltopdf on CentOS7
Last active September 30, 2018 06:05 — forked from paulsturgess/Install wkhtmltopdf on CentOS7
wkhtmltopdf wkhtmltoimage wkhtmltox
yum install -y libpng
yum install -y libjpeg
yum install -y openssl
yum install -y icu
yum install -y libX11
yum install -y libXext
yum install -y libXrender
yum install -y xorg-x11-fonts-Type1
yum install -y xorg-x11-fonts-75dpi
@sursir
sursir / getimagesize-from-stream.php
Last active June 6, 2018 07:49
php getimagesize stream file schema getimagesizefromstring
<?php
$imageStream = file_get_content('..') or curl_get_content('..');
if ($info = @getimagesize('data://application/octet-stream;base64,' . base64_encode(imageStream))) {
var_dump($info);
if (isset($info['mime']) && substr($info['mime'], 0, 6) == 'image/') {
$suffix = substr($info['mime'], 6);
}
}
@sursir
sursir / headless.md
Created May 30, 2018 03:46
google chrome headless
sudo apt-get update
sudo apt-get install -y xvfb fluxbox x11vnc dbus libasound2 libqt4-dbus libqt4-network libqtcore4 libqtgui4 libxss1 libpython2.7 libqt4-xml libaudio2 libmng1 fontconfig liblcms1 lib32stdc++6 lib32asound2 ia32-libs libc6-i386 lib32gcc1 nano
sudo apt-get install -y python-gobject-2

// 由
yum whatprovides libstdc++.so.6
// 得出
yum install -y libstdc++-4.4.7-18.el6.i686
@sursir
sursir / contracts.md
Created April 11, 2018 10:47
laravel contracts 契约

#自定义契约服务

// 比如缓存

namespace App\Extensions;

use Illuminate\Contracts\Cache\Store;

class MongoStore implements Store
@sursir
sursir / laravel.artisan.缓存.sh
Created April 11, 2018 10:46
artisan laravel 缓存 cache
#** artisan 缓存 **
# public/storage 链接
php artisan storage:link # storage/app/public -> public/storage
# storage 软链接到固定目录
ln -sf ../../storage storage
@sursir
sursir / php_openssl.md
Created March 21, 2018 08:34
php openssl ext
cd php-5.3.10/ext/openssl

/usr/local/php/bin/phpize

# Cannot find config.m4.
# Make sure that you run '/usr/local/webserver/php/bin/phpize' in the top level source directory of the module

cp config0.m4 config.m4
@sursir
sursir / chcp.md
Created March 13, 2018 05:19
chcp
chcp 告诉终端需要的编码

65001  utf8
936    gbk 简体中文

>

@sursir
sursir / chkconfig.md
Last active March 12, 2018 04:12
chkcofnig daemon
chkconfig version 1.3.49.5 - Copyright (C) 1997-2000 Red Hat, Inc.  
This may be freely redistributed under the terms of the GNU Public License.  

usage:   chkconfig [--list] [--type <type>] [name]  
         chkconfig --add <name>  
         chkconfig --del <name>  
         chkconfig --override <name>  
 chkconfig [--level ] [--type ]   
@sursir
sursir / mysql-proxy.md
Created March 12, 2018 03:27
mysql mysql-proxy

yum install -y mysql-proxy

vi /etc/mysql-proxy.cnf

# 代理服务器监听地址及端口
proxy-address = 0.0.0.0:30002

# 后端服务器地址及端口
proxy-backend-addresses = the.backend.server:3306