This file contains hidden or 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 | |
| # | |
| ## CURL the kibana endpoint | |
| ## Use the kibana dev console to validate query json | |
| curl -i --insecure --user User:Password -XPOST \ | |
| --header "kbn-version: 5.6.0" \ | |
| 'https://kibana.yourdomain/api/console/proxy?path=_search&method=POST' \ | |
| --data '{"query":{"match_all":{}}}' |
This file contains hidden or 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
| # -*- mode: ruby -*- | |
| # vi: set ft=ruby : | |
| Vagrant.configure("2") do |config| | |
| config.vm.define "controlplane", primary: true do |controlplane| | |
| config.vm.box = "centos/7" | |
| config.vm.hostname = "haithabu" | |
| end |
This file contains hidden or 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
| """ Underscores in number literals are ignored: """ | |
| >>> ten_billion = 10_000_000_000 | |
| >>> ten_billion | |
| 10000000000 | |
| """ In output formatting, you can insert thousands separators: """ | |
| >>> f"{ten_billion:,}" | |
| '10,000,000,000' |
This file contains hidden or 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
| class Singleton(type): | |
| _instances = {} | |
| def __call__(cls, *args, **kwargs): | |
| if cls not in cls._instances: | |
| cls._instances[cls] = super(Singleton, cls).__call__(*args, **kwargs) | |
| return cls._instances[cls] | |
| class Registry(metaclass=Singleton): | |
| """Management for plugins as a singleton. |
This file contains hidden or 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
| import sys, logging | |
| from unittest import TestCase | |
| from tracer import trace, profile, log, slow_down, timer, debug | |
| class TestTrace(TestCase): | |
| def setUp(self): | |
| root = logging.getLogger() | |
| root.setLevel(logging.DEBUG) |
This file contains hidden or 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
| let results; | |
| const DEBUG = true; | |
| const load_data = async () => { | |
| try { | |
| const url = "https://httpbin.org/json" | |
| const response = await fetch(url) | |
| results = await response.json() | |
| if (DEBUG) console.log(response.ok) | |
| if (DEBUG) console.log(results.slideshow) |
This file contains hidden or 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
| # -*- mode: ruby -*- | |
| # vi: set ft=ruby : | |
| # Vagrantfile to have an Ansible and Docker toolkit at hand on Windows machines. | |
| Vagrant.configure("2") do |config| | |
| # Jeff Geerling must have Ansible on his box ;-) | |
| config.vm.box = "geerlingguy/debian10" |
This file contains hidden or 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
| curl -sL https://rdap.db.ripe.net/ip/85.0.0.116 | jq ". | .handle, .name, .country" | tr -d '"' |
This file contains hidden or 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
| echo -e "A LOGIN login(at)domain *********" | openssl s_client -crlf -ign_eof -connect imap.company.net:993 |
This file contains hidden or 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
| #define KB *(1 << 10) | |
| #define MB *(1 << 20) | |
| #define GB *(1U << 30) | |
| int buffer = 64 KB; |