Skip to content

Instantly share code, notes, and snippets.

@mrc78
Created November 15, 2017 15:36
Show Gist options
  • Save mrc78/e8bcaa6e703f06463b173cb8da9aa35b to your computer and use it in GitHub Desktop.
Save mrc78/e8bcaa6e703f06463b173cb8da9aa35b to your computer and use it in GitHub Desktop.
useful commands

capture unix socket traffic

sudo socat -t100 -v UNIX-LISTEN:/path/to/sock,mode=777,reuseaddr,fork UNIX-CONNECT:/path/to/sock.original

ssl

ssl cert in text form

openssl x509 -text -noout -in cert.pem 

ssl cert vs key

openssl rsa -noout -modulus -in private.key | openssl md5
openssl x509 -noout -modulus -in cert.pem | openssl md5

elasticsearch

show all documents:

curl 'http://elasticsearch:9200/INDEX/_search?pretty=true&q=*:*'

search document with id ABCDE1234

 curl 'http://elasticsearch:9200/INDEX/_search?pretty=true&q=_id:ABCDE1234'

get document with id ABCDE1234

curl http://elasticsearch-9200.service.consul:9200/INDEX/MAPPING/ABCDE1234

cluster status

curl -XGET 'http://localhost:9200/_cluster/health?pretty=true'

get all mappings

curl -XGET 'http://elasticsearch-9200.service.consul:9200/INDEX/_mapping?pretty'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment