Skip to content

Instantly share code, notes, and snippets.

@petrkohut
petrkohut / check-ssl.sh
Created February 20, 2018 09:20
Check remote SSL cert based on domain name
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 December 4, 2017 16:31
Curl with transfer time on output
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 August 28, 2017 12:25
How to get into stopped container if we are not able to make it run again
@petrkohut
petrkohut / check.sh
Created August 18, 2017 14:46
Check if last commit contains changes in package.json
git log -n 1 --pretty=format:%H -- package.json
@petrkohut
petrkohut / kibana-queries.md
Last active July 24, 2017 12:32
Lucine queries

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"

image.json

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

How to search empty string in Elasticsearch

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

TCP

sudo telnet 10.10.0.195 9300

UDP

sudo nmap -p 9300 -sU -P0 10.10.0.195

Open ports

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 June 30, 2017 21:55
Debuging in Node.js

Debuging in Node.js

Install node-inspector

npm i -g node-inspector

Run node-inspector on a background

node-inspector &