<details>
<summary>see this long example - click to expand </summary>
You can use regular markdown formatting inside your collapsed section.
### Heading
1. Foo
2. Bar
Here are several different ways to test a TCP port without telnet.
BASH (man page)
$ cat < /dev/tcp/127.0.0.1/22
SSH-2.0-OpenSSH_5.3
^C
$ cat < /dev/tcp/127.0.0.1/23
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am geekpete on github. | |
* I am elasticpete (https://keybase.io/elasticpete) on keybase. | |
* I have a public key ASCr8O5h-mFrsjr7Crb14OyPzjFqrV8XXsrx_OaAkVlY2wo | |
To claim this, I am signing this object: |
NB, the shard numbers that the batches hash to are different in 6.8, but each batch still goes to separate shards. 6.8 results in the same result as 7.x attempts.
DELETE /test-term-agg
PUT /test-term-agg
{
"settings": {
"number_of_shards": 3
},
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### this is how file .restic.env is | |
export RESTIC_REPOSITORY="b2:XXXXXXX:YYYYYY" | |
export B2_ACCOUNT_ID="<a/c id>" | |
export B2_ACCOUNT_KEY="<a/c key" | |
export RESTIC_PASSWORD_FILE="$HOME/<a dropbox folder>/restic.pwd" | |
export RESTIC_INCLUDE_FILE="$HOME/<a dropbox folder>/restic.include" | |
export RESTIC_EXCLUDE_FILE="$HOME/<a dropbox folder>/restic.exclude" | |
export RESTIC_LOG_DIR="$HOME/.restic/log/" | |
### file: restic.pwd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
exec > >(tee -a "/tmp/display-switcher.log") 2>&1 | |
# NOTE: This requires GNU getopt. On Mac OS X and FreeBSD, you have to install this | |
# separately; see below. | |
usage() { | |
cat << HELP >&2 | |
Usage: $0 [option ...] {profile} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def unicodetoascii(text): | |
TEXT = (text. | |
replace('\\xe2\\x80\\x99', "'"). | |
replace('\\xc3\\xa9', 'e'). | |
replace('\\xe2\\x80\\x90', '-'). | |
replace('\\xe2\\x80\\x91', '-'). | |
replace('\\xe2\\x80\\x92', '-'). | |
replace('\\xe2\\x80\\x93', '-'). | |
replace('\\xe2\\x80\\x94', '-'). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# BM25F Model | |
def bm25(idf, tf, fl, avgfl, B, K1): | |
# idf - inverse document frequency | |
# tf - term frequency in the current document | |
# fl - field length in the current document | |
# avgfl - average field length across documents in collection | |
# B, K1 - free paramters | |
return idf * ((tf * (K1 + 1)) / (tf + K1 * (1 - B + B * (fl / avgfl)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DELETE /index1,index2/ | |
POST /index1/doc | |
{ | |
"field1": "dog" | |
} | |
POST /index2/doc | |
{ | |
"field2": "cat" | |
} |
NewerOlder