Skip to content

Instantly share code, notes, and snippets.

View stibi's full-sized avatar

Martin Stiborský stibi

  • Ostrava, Czech Republic
  • X @stibi
View GitHub Profile
@stibi
stibi / gimmeDatData.rb
Last active August 29, 2015 14:20
Getting data from Icinga2 with ruby and livestatus
require 'socket'
host = 'icinga_ip_address'
port = 6558
query = "GET hosts\n"
query << "Columns: name alias state services_with_state\n"
query << "OutputFormat: json\n"
query << "ResponseHeader: fixed16"
#!/bin/bash
set -euo pipefail
KUBE_TOKEN="authtoken"
POD_NAME="yourpod"
EXEC_URL="https://your_k8s_cluster/api/v1/namespaces/default/pods/${POD_NAME}/exec"
curl -sSk -N -H "Connection: Upgrade" -H "Upgrade: websocket" \
org.elasticsearch.index.mapper.MapperParsingException: failed to parse [foo.bar]
at org.elasticsearch.index.mapper.core.AbstractFieldMapper.parse(AbstractFieldMapper.java:409)
at org.elasticsearch.index.mapper.object.ObjectMapper.serializeObject(ObjectMapper.java:554)
at org.elasticsearch.index.mapper.object.ObjectMapper.parse(ObjectMapper.java:487)
at org.elasticsearch.index.mapper.object.ObjectMapper.serializeObject(ObjectMapper.java:554)
at org.elasticsearch.index.mapper.object.ObjectMapper.parse(ObjectMapper.java:487)
at org.elasticsearch.index.mapper.DocumentMapper.parse(DocumentMapper.java:544)
at org.elasticsearch.index.mapper.DocumentMapper.parse(DocumentMapper.java:493)
at org.elasticsearch.index.shard.IndexShard.prepareCreate(IndexShard.java:453)
at org.elasticsearch.action.bulk.TransportShardBulkAction.shardIndexOperation(TransportShardBulkAction.java:432)

Keybase proof

I hereby claim:

  • I am stibi on github.
  • I am stibi (https://keybase.io/stibi) on keybase.
  • I have a public key whose fingerprint is DD10 0CEB 520B 2AE3 5559 AF90 AC82 B87C 7146 DA8C

To claim this, I am signing this object:

Archive: staging-deploy-lambda-0c0442e9.zip
Length Date Time Name
--------- ---------- ----- ----
112 2017-08-03 18:07 Makefile
0 2017-08-03 18:07 requests/
453 2017-08-03 18:07 requests/certs.py
18208 2017-08-03 18:07 requests/cookies.py
542 2017-08-03 18:07 requests/packages.py
3323 2017-08-03 18:07 requests/status_codes.py
20836 2017-08-03 18:07 requests/adapters.py
@stibi
stibi / gist:3297c4ad3f773b63690490a7d6b76ec6
Created August 15, 2017 08:32
List pods not in "Running" state
kubectl get pod -o jsonpath='{.items[?(@.status.phase!="Running")].metadata.name}'
spec:
template:
spec:
containers:
volumeMounts:
- mountPath: /var/www/html
name: www
spec:
template:
#/bin/bash
set -euo pipefail
instance_profile=$(curl -s http://169.254.169.254/latest/meta-data/iam/security-credentials/)
aws_access_key_id=$(curl -s http://169.254.169.254/latest/meta-data/iam/security-credentials/${instance_profile} | grep AccessKeyId | cut -d':' -f2 | sed 's/[^0-9A-Z]*//g')
aws_secret_access_key=$(curl -s http://169.254.169.254/latest/meta-data/iam/security-credentials/${instance_profile} | grep SecretAccessKey | cut -d':' -f2 | sed 's/[^0-9A-Za-z/+=]*//g')
token=$(curl -s http://169.254.169.254/latest/meta-data/iam/security-credentials/${instance_profile} | sed -n '/Token/{p;}' | cut -f4 -d'"')
export AWS_ACCESS_KEY_ID=${aws_access_key_id}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@stibi
stibi / test.tf
Last active September 14, 2018 12:30
I'm testing something…
module "test-sg" {
source = "../../modules/terraform-aws-security-group"
name = "${var.name}-test"
vpc_id = "${module.vpc.vpc_id}"
ingress_with_cidr_blocks = [
{
rule = "ssh-tcp"
description = "test01"