| wait4eth1() { | |
| CNT=0 | |
| until ip a show eth1 | grep -q UP | |
| do | |
| [ $((CNT++)) -gt 60 ] && break || sleep 1 | |
| done | |
| sleep 1 | |
| } | |
| wait4eth1 |
| // the main app file | |
| import express from "express"; | |
| import loadDb from "./loadDb"; // dummy middleware to load db (sets request.db) | |
| import authenticate from "./authentication"; // middleware for doing authentication | |
| import permit from "./authorization"; // middleware for checking if user's role is permitted to make request | |
| const app = express(), | |
| api = express.Router(); | |
| // first middleware will setup db connection |
A curated list of AWS resources to prepare for the AWS Certifications
A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.
| // Navigate to https://github.com/watching and then run: | |
| // Taken from: https://stackoverflow.com/questions/11043374/how-to-unwatch-multiple-repos-easily-on-github | |
| Array.prototype | |
| .slice.apply(document.querySelectorAll('.js-subscription-row')) | |
| .forEach(el => { const org = el.querySelector('a[href^="/YOUR_ORG"]'); if (org) el.querySelector('button').click()}); |
| #!/usr/bin/env bash | |
| # USAGE: drawioxml2html.sh diagram.xml >diagram.html | |
| # html encoding from https://stackoverflow.com/questions/12873682/#answer-12873723 | |
| diag="$(sed 's,.*<\(diagram [^>]*\)>\(.*\)<\(/diagram\)>.*,\1FOO\2BAR\3,g' <"$1"|\ | |
| sed 's/&/\&/g; s/</\</g; s/>/\>/g; s/"/\"/g; s/'"'"'/\'/g'|\ | |
| sed 's/&/\\&/g; s/FOO/\>/; s/BAR/\</')" |
DEPRECATED, use https://github.com/vincepare/docker-backup instead
Finds the readwrite layer (top-most layer) and filesystem root of a docker container.
Accessing the readwrite layer from the docker host can be useful to backup ephemeral container data, while finding the filesystem root allow to browse a container directory structure without having to login into.
Please not that this could only work with union filesystem based storage driver like AUFS and Overlay2. Currently, only AUFS is supported, feel free to contribute to add Overlay2 support.
Kafka 0.11.0.0 (Confluent 3.3.0) added support to manipulate offsets for a consumer group via cli kafka-consumer-groups command.
- List the topics to which the group is subscribed
kafka-consumer-groups --bootstrap-server <kafkahost:port> --group <group_id> --describeNote the values under "CURRENT-OFFSET" and "LOG-END-OFFSET". "CURRENT-OFFSET" is the offset where this consumer group is currently at in each of the partitions.
- Reset the consumer offset for a topic (preview)
| package main | |
| import ( | |
| "context" | |
| "flag" | |
| "fmt" | |
| "log" | |
| "net/http" | |
| "os" | |
| "os/signal" |
