Skip to content

Instantly share code, notes, and snippets.

Avatar

Petr Michalec epcim

View GitHub Profile
@epcim
epcim / pass-getting-started.md
Created March 17, 2023 13:39 — forked from layoaster/pass-getting-started.md
Cheat sheet/ getting-started guide to pass
View pass-getting-started.md

pass cheat sheet/guide

Getting started guide to the unix password manager pass. Manage gpg encripted passwords (files) in a standar directory-like hierarchy. Such files can be copied or stored in a git repository.

Requirements

  1. Install [pass][pass-homepage] (standard unix password manager):

Ubuntu/Debian:

$ sudo apt-get install pass
View gist:224bd5507719b9bd253f1a43a7ff7488
tar cvJ /etc/vpm/ | age -r $(curl -qsSL https://f.apealive.net/pub/$USER.age.pub) | croc send
Receiving side
# cat croc-stdin-2310548854 | age -d -i <(pass show age-$USER-public) | tar xvJ
View query: show metrics & alerts per source
```
{__name__=~".+",site=~"gc1-iad-01",pod=~"(keycloak-s1-).*"}
```
View vim-go-cheatsheet.md

VIM-GO

Plugin https://github.com/fatih/vim-go
Tutorial https://github.com/fatih/vim-go-tutorial
Vimrc https://github.com/fatih/dotfiles/blob/master/vimrc

Run

Commands

  • File :GoRun %
  • Package :GoRun
  • Debug :GoDebugStart
@epcim
epcim / gist:8434d2f7cae31ab77c620f1f321286bd
Created January 21, 2023 14:19
network debug api siege performance
View gist:8434d2f7cae31ab77c620f1f321286bd
```
apt install siege -y
siege -c 255 -t 5m https://my.tls.host/api/status
```
@epcim
epcim / cshell
Created August 5, 2022 08:46
k8s container docker exec
View cshell
# enter any kubernetes pod/container directly just by "part" of it's cotnainer name
cshell ()
{
d=$1;
docker exec -it $(docker ps |grep "k8s_$d" | awk '{print $1}' | head -1) /bin/bash
}
@epcim
epcim / Makefile
Created June 29, 2022 11:59
sops seal/unseal functions
View Makefile
seal-sops: ## SOPS Encrypt all secrets path matching [_sec|secret|config|*.secret*]
@find $(PTH) -path "*/_sec/*" -type f -o -path "*/secret/*" -type f -o -path "*/config/*" -name "*.secret*" -type f |\
egrep -v '(\.enc|\.asc|\.sealed|\.matrix)' |\
while read file; do \
./scripts/seal-sops $$file;\
done;
unseal-sops: ## SOPS Decrypt all secrets (suffix: .enc and .enc.yaml)
@find $(PTH) -name "*.enc" -type f -o -name "*.enc.*" -type f |\
while read file; do \
@epcim
epcim / QR-Code-Example
Created June 15, 2022 14:12 — forked from BPScott/QR-Code-Example
QR Code generation and instant preview from the command line
View QR-Code-Example
# Generating throwaway QR codes from the command line for shunting URLS to mobile devices
brew install qrencode
qrencode -o - http://www.google.com | open -f -a preview
@epcim
epcim / octoprint.md
Created May 18, 2022 17:48 — forked from bakman2/octoprint.md
Octoprint IP Camera
View octoprint.md

How to use Octoprint with an IP camera that has an RTSP stream available

Optional: For Wyze cam only

Install Dafang Hacks on the Wyze Cam.

Once running and all is functional, continue. Set video bitrate to 1500, VBR, 30fps.

Installation

View byobu_cheatsheet
Byobu is a suite of enhancements to tmux, as a command line
tool providing live system status, dynamic window management,
and some convenient keybindings:
F1 * Used by X11 *
Shift-F1 Display this help
F2 Create a new window
Shift-F2 Create a horizontal split
Ctrl-F2 Create a vertical split
Ctrl-Shift-F2 Create a new session