Instantly share code, notes, and snippets.

View generate.sh
#!/bin/bash
git clone https://github.com/octo-technology/kubernetes-icons.git
cd kubernetes-icons/png
rm -rf tmp
rm *iuml
rm *uml
mkdir tmp
View clock.sh
#!/bin/bash
function clock() {
clear
TZ=US/Pacific date "+LA : %Y/%m/%d %a — %I:%M %p"
TZ=US/Eastern date "+New York : %Y/%m/%d %a — %I:%M %p"
TZ=Europe/Amsterdam date "+Amsterdam : %Y/%m/%d %a — %I:%M %p"
TZ=Asia/Bangkok date "+Bangkok : %Y/%m/%d %a — %I:%M %p"
TZ=Japan date "+Tokyo : %Y/%m/%d %a — %I:%M %p"
TZ=Australia/Melbourne date "+Melbourne : %Y/%m/%d %a — %I:%M %p"
View fluent-bit-modify-test-gen.js
function genId(len) {
var text = "";
var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
for (var i = 0; i < len + 1; i++)
text += possible.charAt(Math.floor(Math.random() * possible.length));
return text;
View fluent-bit-nest.md

Nest/Lift

Nest 1

[INPUT]
    Name mem
    Tag  mem.local

[OUTPUT]
    Name  stdout
View pagination_example.sql
-- Reasonably efficient pagination without OFFSET
-- SQLite version (Adapted from MS SQL syntax)
-- Source: http://www.phpbuilder.com/board/showpost.php?p=10376515&postcount=6
SELECT foo, bar, baz, quux FROM table
WHERE oid NOT IN ( SELECT oid FROM table
ORDER BY title ASC LIMIT 50 )
ORDER BY title ASC LIMIT 10
View schema-introspection.graphql
query IntrospectionQuery {
__schema {
queryType { name }
mutationType { name }
types {
...FullType
}
directives {
name
description
View commands-fluent-bit-dev.md

Manage and update remote branches

git remote add upstream https://github.com/fluent/fluent-bit.git
git checkout -b ffscl-master
git remote add ffscl https://github.com/ffscl/fluent-bit.git
git fetch -v ffscl master
git branch --set-upstream-to=ffscl/master
git remote -v

Dev

View .block
license: gpl-3.0
View rust-update-docs-hook
#!/bin/bash
set -e
[[ "$(git symbolic-ref --short HEAD)" == "master" ]] || exit 0
msg() {
echo "> $@"
}
dir="$(pwd)"
tmp="$(mktemp -d)"
View collect.sh
#!/bin/bash
PASSWORD="password"
USERNAME="username"
SSHPORT=22