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; |
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 | |
export BORG_RSH='ssh -i ~/.ssh/id_ed25519' | |
export BORG_REPO='ssh://user@storage:22/./mail' | |
export BORG_PASSPHRASE='**********' | |
export ARCHIVE=$(date +'%a-%Y-%m-%d') | |
/usr/bin/borg create \ | |
--verbose \ |
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
function header { | |
echo "" | |
echo "$(tput setaf 6)$1$(tput sgr0)" | |
echo "" | |
} | |
header "Creating MySQL database ..." |
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
#!/usr/bin/awk -f | |
/Host:/ { print "define host {"; | |
print "\tuse\tgeneric_host"; | |
gsub(/[\(\)]/, ""); print "\thost_name\t", $3; | |
print "\taddress\t\t", $2; | |
print "}"; } |
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
from bottle import route, run, template, abort, Response | |
APP_VERSION = '0.1.1' | |
@route('/hello/<name>') | |
def index(name): | |
return template('<b>Hello {{name}}</b>!', name=name) | |
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 NestedNamespace(SimpleNamespace): | |
""" Wrapping dictionaries in namespace to access it with dot notation. """ | |
def __init__(self, dictionary, **kwargs): | |
super().__init__(**kwargs) | |
for key, value in dictionary.items(): | |
if isinstance(value, dict): | |
self.__setattr__(key, NestedNamespace(value)) | |
else: | |
self.__setattr__(key, value) |