Skip to content

Instantly share code, notes, and snippets.

@iambryancs
iambryancs / krsync.sh
Created June 5, 2023 01:42
Kubernetes rsync wrapper
#!/bin/bash
# Source: https://serverfault.com/a/887402/169782
# Usage:
# krsync -av --progress --stats src-dir/ pod<@namespace>:/dest-dir
if [ -z "$KRSYNC_STARTED" ]; then
export KRSYNC_STARTED=true
exec rsync --blocking-io --rsh "$0" $@
@iambryancs
iambryancs / pyenv-wsl-ubuntu_22.04.md
Created May 31, 2023 10:31
Using Pyenv in WSL Ubuntu 22.04 LTS to install Python 3.8

Using Pyenv in WSL Ubuntu 22.04 LTS to install Python 3.8

Env

  • Windows 10
  • Ubuntu 22.04 WSL
  • zsh

Requirements

  • git
@iambryancs
iambryancs / fix-corrupt-zsh-history-file.md
Created May 17, 2023 00:35
Fix corrupt ZSH history file

Fix corrupt ZSH history file

Problem

zsh: corrupt history file /home/bryancs/.zsh_history

Solution:

mv ~/.zsh_history ~/.zsh_history_bad
@iambryancs
iambryancs / linux-process-elapse-time.md
Created May 12, 2023 00:30
Get Linux process elapse time

Get Linux process elapse time

Get process id

$ pidof tar
1388

Use ps with elapse time

$ ps -p 1388 -o etime

Add the repo

$ sudo add-apt-repository ppa:neovim-ppa/unstable

Update & install

$ sudo apt-get update
$ sudo apt-get install neovim
@iambryancs
iambryancs / alt_tab_current_ws_gnome.md
Created October 5, 2022 03:32
Alt+Tab on current workspace only GNOME

In order to cycle through windows with alt+tab on the current workspace, run:

gsettings set org.gnome.shell.app-switcher current-workspace-only true
@iambryancs
iambryancs / curl-bypass-lb.md
Created September 20, 2022 11:21
Using cURL to bypass a load balancer

Using cURL to bypass a load balancer

curl -v -H "Host: www.example.com" \
  http://172.16.60.4:8080/some/pah
@iambryancs
iambryancs / enable-thumbnail-preview-pop-os.md
Last active September 8, 2022 01:05
Enable MP4 thumbnail preview in Ubuntu/Pop OS

Install the packages

sudo apt install libdvdnav4 libdvd-pkg gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly libdvd-pkg

Then follow the on-screen instructions such as

sudo dpkg-reconfigure libdvd-pkg

Install restricted extras such as extra codecs and MS Fonts

sudo apt update
sudo apt install -y apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"
sudo apt update
sudo apt install -y docker-ce
sudo usermod -aG docker ${USER}
@iambryancs
iambryancs / deploy.sh
Created December 9, 2016 17:16
Sample jenkins shell command
chmod +x deploy.sh
./deploy.sh