Skip to content

Instantly share code, notes, and snippets.

View Hsuing's full-sized avatar
😀

Hsuing

😀
  • China
View GitHub Profile
[[ -s /home/trustone/.autojump/etc/profile.d/autojump.sh ]] && source /home/trustone/.autojump/etc/profile.d/autojump.sh
1,下载
wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.8-linux-i686.tar.bz2
2,解压后,直接使用,不用安装
3,测试
vi snap.js
var page = require('webpage').create();
var args = require('system').args;
@Hsuing
Hsuing / ssl
Created January 29, 2016 09:26
测试https 时间
curl -w "TCP handshake: %{time_connect}, SSL handshake: %{time_appconnect}\n" -so /dev/null https://api.weixin.qq.com
由服务器
For the client, edit your ~/.ssh/config (or /etc/ssh/ssh_config) file as follow:
Host *
TCPKeepAlive yes
ServerAliveInterval 120
TCPKeepAlive - Specifies whether the system should send TCP keepalive messages to the other side. If they are sent, death of the connection or crash of one of the machines will be properly noticed. However, this means that connections will die if the route is down temporarily, and some people find it annoying (The default is 'yes').
@Hsuing
Hsuing / error_agent.config
Created January 29, 2016 09:09
logstash-1.4.2 获取nginx log
input {
file {
path => "/var/log/nginx/error.log"
type => "php-error"
}
}
filter {
mutate {
gsub => [
#官方文档:http://www.logstash.net/docs/1.4.2/
input {
...#读取数据,logstash已提供非常多的插件,比如可以从file、redis、syslog等读取数据
}
filter {
...#想要从不规则的日志中提取关注的数据,就需要在这里处理。常用的有grok、mutate等
}
{
"message" => "[14-May-2014 16:46:41 America/Mexico_City] PHP Fatal error: Uncaught exception 'DOMPDF_Exception' with message 'Requested HTML document contains no data.' in clickbalance/lib/dompdf/include/frame_tree.cls.php:146\nStack trace:\n#0 clickbalance/lib/dompdf/include/dompdf.cls.php(451): Frame_Tree->build_tree()\n#1 clickbalance/lib/dompdf/include/dompdf.cls.php(591): DOMPDF->_process_html()\n#2 clickbalance/core/Dispatcher.php(608): DOMPDF->render()\n#3 clickbalance/index.php(21): Dispatcher->go('/clickbalance/i...')\n#4 {main}\n thrown in clickbalance/lib/dompdf/include/frame_tree.cls.php on line 146",
"@version" => "1",
"@timestamp" => "2014-05-14T21:46:41.000Z",
"type" => "php-error",
"host" => "clickbalance.vm",
"path" => "/public_html/staging/clickbalance/error_log",
"tags" => [
Single line
{
"message" => "[31-May-2014 20:44:29 America/Mexico_City] PHP Fatal error: Call to a member function detach() on a non-object in clickbalance/lib/phpexcel/PHPExcel/CachedObjectStorage/MemorySerialized.php on line 47",
"@version" => "1",
"@timestamp" => "2014-06-01T01:44:29.000Z",
"type" => "php-error",
"host" => "clickbalance.vm",
"path" => "/clickbalance/error_log",
"tags" => [
@Hsuing
Hsuing / php_error_logstash.conf
Created January 29, 2016 08:50 — forked from gerardorochin/php_error_logstash.conf
php error logging into logstash + elasticsearch and trace errors on single line and root path hidden
input {
file {
type => "php-error"
path => "/var/www/error_log"
sincedb_path => "/opt/logstash/sincedb-access"
}
}