Skip to content

Instantly share code, notes, and snippets.

Petr Michalec epcim

Block or report user

Report or block epcim

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
epcim /
Last active Sep 16, 2019
hab habitat hab-sup deployment etcd

Simple deployment script to install habitat container with the app as systemd service.

export ALT=500 # Prefix for all the service names/ports used (apply to habitat/ inner service service)
# cleanup
systemctl stop etcd-$ALT
sleep 3
rm -f /etc/systemd/system/etcd-$ALT.service /etc/default/etcd-$ALT*
rm -rf /srv/etcd-$ALT
epcim /
Created May 13, 2019
debian livecd netboot
# Create a Custom Debian Live Environment (CD or USB)
View update from line
# rewrite part of the file from variable
sed -i "/^write_files:/{
epcim /
Last active Apr 29, 2019
kubectl kubernetes alias bash cli
# you can't live without 'k' and 'p'
# kubectl alias
alias k='kubectl'
# kubectl get pods alias
## store Kubernetes pod name & namespace to env variable
## expect servername has number behind last -
[[ -z $ZSH_NAME ]] || setopt SH_WORD_SPLIT
function get-pods() {
# keep you $SHELL as osx bash
# modify your term/iterm2/kitty to start your preffered shell (I do zsh, you can start "up to date" bash from `brew`)
# gnu cmd links without "g" preffixed
mkdir ~/bin-osxoverride
for i in $(ls /usr/local/bin/g*) ;do N=$(basename ${i/g//}); ln -sf $i ~/bin-osxoverride/$N; done
# update your path
echo "export PATH=~/bin-osxoverride:$PATH" >> ~/.zshrc
epcim /
Created Mar 29, 2019
kubernetes k8s kubectl
# p cmd pritns pods in cluster &&
# store Kubernetes pod name & namespace to env variable
[[ -z $ZSH_NAME ]] || setopt SH_WORD_SPLIT
function p() {
eval $(kubectl get po --all-namespaces -L app -o wide | tee /dev/stderr|awk '{gsub(/.*-/,"",$8);gsub(/-/,"",$10);printf "%s%s=\x27-n %s %s\x27\n", $10,$8, $1, $2}'|grep -v "^=");
k logs $fluentbit1
if [ $# -lt 2 -o $# -gt 3 ]; then
echo 'Please provide 2 or 3 arguments.'
echo 'USAGE: action username directory'
echo 'actions: grant, revoke-app, revoke-all'
echo 'eg: grant joe $HOME/webapps/django'
epcim /
Created Mar 14, 2019
github hub pull-request cli
# hub tool
brew install hub
# push PR without web-browser forking the repo
alias github-pull-request="hub fork;git push -u $GIT_USER HEAD;hub pull-request"
You can’t perform that action at this time.