Skip to content

Instantly share code, notes, and snippets.

@rockybean
rockybean / bulk_rejections.md
Created October 23, 2019 08:58 — forked from cdahlqvist/bulk_rejections.md
rally-bulk-rejections-track

Bulk Rejections Test

This Rally track is used to test the relationship between bulk indexing rejections and the following parameters:

  • Number of concurrent clients indexing into Elasticsearch
  • Number of shards actively being indexed into
  • Number of data nodes in the cluster
  • Size of bulk requests

The track contains a number of challenges, each indexing into an index with a set number of shards using a increasing number of concurrent client connections and two different bulk sizes.

@rockybean
rockybean / ingest_pipeline_delay
Created February 27, 2018 22:56 — forked from cdahlqvist/ingest_pipeline_delay
Ingest pipeline definition for measuring ingest delay based on @timestamp field
# Ingest pipeline that records the timestamp the event was processed (`@received`)
# by the ingest pipeline and calculates the difference in milliseconds compared to
# the event timestamp (`@timestamp`).
POST _scripts/calculate_ingest_delay
{
"script": {
"lang": "painless",
"source": "SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'\"); ctx.ingest_delay = (sdf.parse(ctx['received']).getTime() - sdf.parse(ctx['@timestamp']).getTime()) / 1000.0"
}
@rockybean
rockybean / removelogo.sh
Created July 2, 2017 11:40 — forked from macfanr/removelogo.sh
remove logo with ffmpeg
#!/bin/sh
if [ $# != 2 ]; then
echo "usage: videoshot.sh /Users/danny/MyVideoDir /Users/danny/MyOutputDir"
exit -1
fi
inputDir=$1
outputDir=$2
binaryEXE=./ffmpeg
@rockybean
rockybean / markdownhere.css
Last active January 2, 2017 09:35 — forked from xiaolai/markdownhere.css
markdown-here-css
.markdown-here-wrapper {
font-size: 16px;
line-height: 1.8em;
letter-spacing: 0.1em;
}
pre, code {
font-size: 14px;
font-family: Roboto, 'Courier New', Consolas, Inconsolata, Courier, monospace;
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.2//EN" "http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
<!-- Generated by RHY @will_awoke -->
<module name="Checker">
<property name="charset" value="UTF-8"/>
<property name="severity" value="warning"/>
// PhantomJS Cheatsheet
$ brew update && brew install phantomjs // install PhantomJS with brew
phantom.exit();
var page = require('webpage').create();
page.open('http://example.com', function() {});
page.evaluate(function() { return document.title; });
@rockybean
rockybean / address.js
Created August 15, 2016 09:09 — forked from 52cik/address.js
提取淘宝地址库
/**
* 提取淘宝地址库
*
* 用法:
* 1. 打开淘宝 https://www.taobao.com/
* 2. 将下面代码复制到控制台
* 3. 按回车
* 4. 复制输出的 json 数据保存到你的文件
*
* 仅支持: chrome 48+
@rockybean
rockybean / timestamp.go
Created October 6, 2015 11:39 — forked from bsphere/timestamp.go
UNIX timestamps in Golang
package timestamp
import (
"fmt"
"labix.org/v2/mgo/bson"
"strconv"
"time"
)
type Timestamp time.Time
@rockybean
rockybean / surge.conf
Created October 5, 2015 02:26 — forked from netputer/surge-multi-proxy.url
Surge config for SSLedge (Sample)
[Proxy]
# 为了方便将来修改,将可用服务器写成 Proxy 形式
US = protocol, us.server.com, port1, username, password
JP = protocol, jp.server.com, port2, username, password
# 要用美服,就把美服那行复制到下面,然后改叫 SSLEDGE
SSLEDGE = protocol, us.server.com, port1, username, password
# 要换日服,就把日服那行复制到下面,然后改叫 SSLEDGE
# 同名 Proxy,Surge 只保留最后一个
@rockybean
rockybean / logback.xml
Last active August 29, 2015 14:13 — forked from jcraane/logback.xml
<?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true">
<appender name="consoleAppender" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<charset>UTF-8</charset>
<Pattern>%d %-4relative [%thread] %-5level %logger{35} - %msg%n</Pattern>
</encoder>
</appender>
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">