Skip to content

Instantly share code, notes, and snippets.

View epcim's full-sized avatar

Petr Michalec epcim

View GitHub Profile

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
```
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
# 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
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
# 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

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

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
@epcim
epcim / osx_vnc.sh
Last active December 21, 2021 08:12
#!/bin/bash
# /System/Library/CoreServices/Screen Sharing.app
# https://ss64.com/osx/kickstart.html
# https://apple.stackexchange.com/questions/30238/how-to-enable-os-x-screen-sharing-vnc-through-ssh
SWITCH=${1:-on}
[[ "$SWITCH" == "on" ]] && {
echo "Enter VNC PASS"
read -s VNCPASS
@epcim
epcim / gist:25c1f390ae45b5151cda8137ce9f5a22
Created December 16, 2021 11:51 — forked from saetia/gist:1623487
Clean Install – OS X 10.11 El Capitan

OS X Preferences


most of these require logout/restart to take effect

# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false

# Set a shorter Delay until key repeat
@epcim
epcim / dummy.json
Last active November 8, 2021 14:59
dummy
{
"foo": {
"bar": {
"baz": "xyz"
}
}
}