Skip to content

Instantly share code, notes, and snippets.

View CermakM's full-sized avatar
🧑‍💻
Engineering Manager @ STRV

Marek Čermák CermakM

🧑‍💻
Engineering Manager @ STRV
View GitHub Profile
@CermakM
CermakM / dev-tools-psql.yaml
Last active October 1, 2020 09:07
Kubernetes PSQL deployment
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
gist.github.com/url: "https://gist.github.com/CermakM/69b0e3f6ccdcdc82c433815d2490246b"
gist.github.com/owner: "https://github.com/CermakM"
name: dev-tools-psql
spec:
replicas: 1
selector:
@CermakM
CermakM / remap-tilde-to-cz-layout.sh
Created September 27, 2020 09:46
Remap Tilde to CZ Layout
hidutil property --set '{"UserKeyMapping":[{"HIDKeyboardModifierMappingSrc":0x700000035,"HIDKeyboardModifierMappingDst":0x700000064},{"HIDKeyboardModifierMappingSrc":0x700000064,"HIDKeyboardModifierMappingDst":0x700000035}]}'
@CermakM
CermakM / remap-tilde-to-us-layout.sh
Created September 27, 2020 09:45
Remap Tilde to US Layout
hidutil property --set '{"UserKeyMapping": []}'
@CermakM
CermakM / etcdctl.sh
Last active August 31, 2020 14:54
etcdctl script to connect to etcd deployed by Kubespray
#!/bin/bash
MEMBERS=$(\
kubectl get nodes -o jsonpath='{.items[*].status.addresses[?(@.type=="InternalIP")].address}' \
| tr " " ","
)
ETCD_PORT=${ETCD_PORT:-2379}
ENDPOINTS=()
@CermakM
CermakM / rbac-lookup.fish
Created October 9, 2019 13:23
Fish script to lookup kubernetes subjects based on RBAC
# Lookup kubernetes subjects based on RBAC
# Usage:
# rbac-lookup # to list all subjects to a rolebinding or clusterrolebinding
# rbac-lookup builder # list all {role,clusterrole}bindings where builder is a subject
function rbac-lookup
if test "$argv"
kubectl get rolebindings,clusterrolebindings \
--all-namespaces \
-o custom-columns=(string join0 'KIND:kind,NAMESPACE:metadata.namespace,NAME:metadata.name,SUBJECT:subjects[?(@.name=="'"$argv"'")].name') | grep -v '<none>'
@CermakM
CermakM / trello-count-story-points.js
Created July 26, 2019 18:02
Simple Trello story point counter
/**
* This is a Trello plugin for counting story points from card names.
*
* Usage:
* 1) Have SP set in card title as such "(<SP>) <title>"
*/
function getSPFromCardName(card) {
const p = /\((\d+)\)/
const m = card.match(p)
@CermakM
CermakM / trello-sort-cards-by-age.js
Last active July 17, 2019 13:32
Sort trello cards by aging class
/**
* This is a Trello "plugin" for sorting cards by their age (using the Card Aging Trello Plugin).
*
* The Card Aging plugin has to be enabled.
* Usage:
* 1) Use with CJS extension
Chrome : https://chrome.google.com/webstore/detail/custom-javascript-for-web/ddbjnfjiigjmcpcpkmhogomapikjbjdk?hl=en
Firefox: https://addons.mozilla.org/en-US/firefox/addon/codeinjector/
* 2) Go to your Trello Board and include the following loading script in the extension.
*
@CermakM
CermakM / datatables-csv-button.py
Created July 1, 2019 19:20
DataTables pandas integration with CSV export button
# ---
# jupyter:
# jupytext:
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.4'
# jupytext_version: 1.1.1
# kernelspec:
# display_name: jupyter-datatables
@CermakM
CermakM / gist:97c94328d809daa450b6225cd738e3a4
Created March 29, 2019 18:08 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@CermakM
CermakM / example_jupyter_d3_integration.py
Created February 21, 2019 16:44
Example of Jupyter d3.js integration
import pandas as pd
from thoth.lab.utils import str_join
from thoth.lab.viz import init_notebook_mode, plot
init_notebook_mode()
df = pd.DataFrame([
{'name': "root",},
{'name': "tensorflow", 'parent': "root", 'package_version': '1.4.0'},