Skip to content

Instantly share code, notes, and snippets.

View white-poto's full-sized avatar
🏠
busy

white-poto

🏠
busy
View GitHub Profile
@boypt
boypt / gist:80d9ecaaa7f3c799c525e91f3c0b35d1
Created February 22, 2019 14:27
v2ray-core 流量统计 StatsService 使用要点
StatsService API获得数据统计功能,配置里面必须满足以下条件
1. `"stats":{}`对象的存在
2. `"api"`配置对象里面有`StatsService`
3. `"policy"`中的统计开关为true,除了各个用户的统计,还有全局统计
4. clients里面要有email
5. 有个专用的`dokodemo-door`协议的入口,tag为api
6. routing里面有inboundTag:api -> outboundTag:api的规则
另外:
@lisachenko
lisachenko / FCGIServer.php
Created November 8, 2016 15:02
Swoole FCGI server
<?php
use Protocol\FCGI;
use Protocol\FCGI\FrameParser;
use Protocol\FCGI\Record\BeginRequest;
use Protocol\FCGI\Record\EndRequest;
use Protocol\FCGI\Record\Params;
use Protocol\FCGI\Record\Stdin;
use Protocol\FCGI\Record\Stdout;
@yohhoy
yohhoy / cv2ff.cpp
Created February 17, 2016 15:41
Convert from OpenCV image and write movie with FFmpeg
/*
* Convert from OpenCV image and write movie with FFmpeg
*
* Copyright (c) 2016 yohhoy
*/
#include <iostream>
#include <vector>
// FFmpeg
extern "C" {
#include <libavformat/avformat.h>
@SteveRuben
SteveRuben / client.cpp
Created October 21, 2015 08:30
Multiple streaming in c++ using opencv; OpenCV video streaming over TCP/IP
/**
* OpenCV video streaming over TCP/IP
* Client: Receives video from server and display it
* by Steve Tuenkam
*/
#include "opencv2/opencv.hpp"
#include <sys/socket.h>
#include <arpa/inet.h>
#include <unistd.h>

Logstash+Redis+Elasticsearch+Kibana日志监控报警系统

@(服务监控)[logstash|Elasticsearch|kibana]

工具介绍

Logstash:用于收集、处理、传输日志数据。
Redis:用于实时标识和传输日志数据。
Elasticsearch:用于实时查询和解析数据。
Kibana:用于数据可视化。

工作流程

@wuchong
wuchong / HBaseNewAPI.scala
Created April 6, 2015 15:34
Spark 下 操作 HBase 1.0.0 新版API
import org.apache.hadoop.hbase.util.Bytes
import org.apache.hadoop.hbase.{HColumnDescriptor, HTableDescriptor, TableName, HBaseConfiguration}
import org.apache.hadoop.hbase.client._
import org.apache.spark.SparkContext
import scala.collection.JavaConversions._
/**
* HBase 1.0.0 新版API, CRUD 的基本操作代码示例
**/
object HBaseNewAPI {
@jkbradley
jkbradley / LDA_SparkDocs
Created March 24, 2015 23:56
LDA Example: Modeling topics in the Spark documentation
/*
This example uses Scala. Please see the MLlib documentation for a Java example.
Try running this code in the Spark shell. It may produce different topics each time (since LDA includes some randomization), but it should give topics similar to those listed above.
This example is paired with a blog post on LDA in Spark: http://databricks.com/blog
Spark: http://spark.apache.org/
*/
import scala.collection.mutable
@forthxu
forthxu / STD3Des.java
Last active September 21, 2018 12:58
3des加密java版和php版
// javac test3.java
// java test3
import java.security.Key;
import javax.crypto.Cipher;
import javax.crypto.SecretKeyFactory;
import javax.crypto.spec.DESedeKeySpec;
import javax.crypto.spec.IvParameterSpec;
@v5tech
v5tech / Hive编程指南读书笔记.md
Last active December 17, 2019 12:49
Hive编程指南读书笔记

<<Hive编程指南>>读书笔记

1. 设置hive以本地模式运行(即使当前用户是在分布式模式或伪分布式模式下执行也使用这种模式)

set hive.exec.model.local.auto=true;

若想默认使用这个配置,可以将这个命令添加到$HOME/.hiverc文件中

@dbuenzli
dbuenzli / sdl-install.sh
Created May 18, 2014 23:19
SDL install script
#!/bin/sh -ex
V=2.0.3
curl -OL http://www.libsdl.org/release/SDL2-${V}.tar.gz
tar -zxvf SDL2-${V}.tar.gz
cd SDL2-${V}
sudo apt-get install build-essential mercurial make cmake autoconf automake \
libtool libasound2-dev libpulse-dev libaudio-dev libx11-dev libxext-dev \
libxrandr-dev libxcursor-dev libxi-dev libxinerama-dev libxxf86vm-dev \
libxss-dev libgl1-mesa-dev libesd0-dev libdbus-1-dev libudev-dev \