Skip to content

Instantly share code, notes, and snippets.

@yehosef
yehosef / query.json
Last active November 22, 2016 21:03
elasticsearch avg problem
{
"size": 0,
"query": {
"filtered": {
"query": {
"query_string": {
"query": "*",
"analyze_wildcard": true
}
},
@epixoip
epixoip / 8xTitanX.md
Last active October 10, 2019 23:10
World's First 8x Nvidia GTX Titan X cudaHashcat Benchmarks
- ARCHIVE cluster (m1.xlarge)
- 4x HDD
- 8 ECU
- 15GiB mem
- 10 shards per node
- concurrency 1
┌────────────────────────────┬───────┬─────┬───────┬────────┬─────────┬─────────┐
│ index hit │ calls │ min │ max │ median │ mean │ 95 perc │
├────────────────────────────┼───────┼─────┼───────┼────────┼─────────┼─────────┤
@misablaha
misablaha / and_bool.txt
Last active August 29, 2015 14:21
Elasticsearch prformance test - random queries, random profile_ids and random sorting
filter AND vs BOOL
shards: 1 * 2 | docs: 59,925,838 | size: 23.51GB
=== and filter ===
filter cache: 4.8 GiB
┌────────────────────────────────┬───────┬─────┬─────┬────────┬───────┬─────────┐
│ type │ calls │ min │ max │ median │ mean │ 95 perc │
├────────────────────────────────┼───────┼─────┼─────┼────────┼───────┼─────────┤
│ total │ 1500 │ 1 │ 113 │ 4 │ 8.51 │ 26 │
├────────────────────────────────┼───────┼─────┼─────┼────────┼───────┼─────────┤
@joewalnes
joewalnes / go-getter
Last active March 9, 2016 12:58
go-getter: Alternative to "go get" that fixes packages to a version for consistent and repeatable builds.
#!/bin/bash
# Alternative to "go get" that grabs Go packages based on a fixed version.
# Use this to ensure consistent and repeatable builds.
#
# While there are other tools out there that do this, this is really just
# a very small shell script so painless to work into your existing workflow.
#
# Usage:
#
@pauldix
pauldix / influx_test.sh
Created February 25, 2015 02:44
InfluxDB test script
printf "creating database\n"
curl -G http://localhost:8086/query --data-urlencode "q=CREATE DATABASE mydb"
printf "creating retention policy\n"
curl -G http://localhost:8086/query --data-urlencode "q=CREATE RETENTION POLICY myrp ON mydb DURATION 365d REPLICATION 1 DEFAULT"
printf "inserting data\n"
curl -d '{"database" : "mydb", "retentionPolicy" : "myrp", "points": [{"name":"cpu","tags":{"region":"useast","host":"server_1","service":"redis"},"fields":{"value":61}},{"name":"cpu","tags":{"region":"useast","host":"server_2","service":"mysql"},"fields":{"value":53}},{"name":"cpu","tags":{"region":"useast","host":"server_3","service":"apache"},"fields":{"value":80}},{"name":"cpu","tags":{"region":"useast","host":"server_4","service":"nginx"},"fields":{"value":86}},{"name":"cpu","tags":{"region":"useast","host":"server_5","service":"paulapp"},"fields":{"value":87}},{"name":"cpu","tags":{"region":"japan","host":"server_6","service":"redis"},"fields":{"value":10}},{"name":"cpu","tags":{"region":"japan","host":"s
@benjie
benjie / README.md
Last active January 17, 2023 15:16
Long Live CoffeeScript and Long Live ES6

Long Live CoffeeScript and Long Live ES6

Clearly ES6 is a huge improvement over ES5, and tools like [6to5][] allow us to use these cool features now. I was reading [Replace CoffeeScript with ES6][replace coffeescript] by [Blake Williams][] and thought it was a great summary of how ES6 solves many of the same problems that CoffeeScript solves; however I'd like to comment on a few of Blake's points and talk about why I'll be sticking with CoffeeScript.

Classes

Classes in ES6 (like many of the syntax changes in ES6) are very similar to the CoffeeScript equivalent. To support browsers that are not fully ES5 compliant (e.g. IE8-), however, we still can't really use getters/setters, so ignoring these the comparison is:

@midwire
midwire / reset_routing_table.sh
Last active August 25, 2025 11:01
[Reset routing table on OSX] #osx #devops #networking
#!/usr/bin/env bash
# Reset routing table on OSX
# display current routing table
echo "********** BEFORE ****************************************"
netstat -r
echo "**********************************************************"
for i in {0..4}; do
sudo route -n flush # several times
var smalloc = require('smalloc');
var uid = 0;
function MemStruct() {
this._id = 0; // 4 bytes (uint32)
this._address = 1; // 4 bytes (uint32)
this._data = 2; // 8 bytes (uint64)
var size = 4;
smalloc.alloc(size, this, smalloc.Types.Uint32);
@mikepenz
mikepenz / multitail.md
Last active November 28, 2024 12:59
Install & Configure multitail, Configure multitail, Setup alias

#ABOUT

#INSTALLATION Run following commands:

curl https://gist.githubusercontent.com/mikepenz/a8a4a52f67a391895a4c/raw/0e142a381ddce88e7489d0753388bd9778cb246d/multitail.sh | sh;
source ~/.bashrc

This will start the script multitail.sh and call source ~/.bashrc afterwards