Skip to content

Instantly share code, notes, and snippets.

@petrkohut
petrkohut / check-ssl.sh
Created Feb 20, 2018
Check remote SSL cert based on domain name
View check-ssl.sh
curl --insecure -v https://google.com 2>&1 | awk 'BEGIN { cert=0 } /^\* SSL connection/ { cert=1 } /^\*/ { if (cert) print }'
@petrkohut
petrkohut / curl-with-times.sh
Created Dec 4, 2017
Curl with transfer time on output
View curl-with-times.sh
curl -o /dev/null -s -w "time_connect: %{time_connect}\ntime_starttransfer: %{time_starttransfer}\ntime_total: %{time_total}\n" https://www.seznam.cz/media/img/logo_v2.png
@petrkohut
petrkohut / get_into_stopped_container.md
Created Aug 28, 2017
How to get into stopped container if we are not able to make it run again
View get_into_stopped_container.md
@petrkohut
petrkohut / check.sh
Created Aug 18, 2017
Check if last commit contains changes in package.json
View check.sh
git log -n 1 --pretty=format:%H -- package.json
View kibana-queries.md

Lucine queries for search in Kibana

AND

field1: "something" AND field2: "something else"

OR

field1: "something" AND (field2: "something else" OR field2: "nothing")

NOT

Filter out all messages where field1 contains string "Petr"

View packer-ansible-local.md

image.json

{
  "builders": [
    {
      "type": "docker",
      "image": "ubuntu",
      "commit": true
    }
  ],
@petrkohut
petrkohut / search-empty-string.md
Created Apr 10, 2017
Elasticsearch query - how to search empy string
View search-empty-string.md

How to search empty string in Elasticsearch

{
  "query": {
    "filtered": {
      "filter": {
        "not": {
          "filter": {
            "range": {
              "yourFieldName": {}
@petrkohut
petrkohut / test_tcp_udp.md
Last active Mar 24, 2017
Test TCP/UDP which port is open
View test_tcp_udp.md

TCP

sudo telnet 10.10.0.195 9300

UDP

sudo nmap -p 9300 -sU -P0 10.10.0.195

Open ports

View keybase.md

Keybase proof

I hereby claim:

  • I am petrkohut on github.
  • I am petrkohut (https://keybase.io/petrkohut) on keybase.
  • I have a public key whose fingerprint is 44CE B549 9C7C D49F 5AFC 0562 7661 C898 200A C505

To claim this, I am signing this object:

@petrkohut
petrkohut / how-to.md
Last active Jun 30, 2017
Debuging in Node.js
View how-to.md

Debuging in Node.js

Install node-inspector

npm i -g node-inspector

Run node-inspector on a background

node-inspector &