Skip to content

Instantly share code, notes, and snippets.

sdkks / userChrome.css
Created Jan 31, 2023
Customize Firefox Toolbar Layout with userChrome.css
View userChrome.css
@namespace url(""); /* only needed once */
/* Placing the config file */
/* Go to about:support address, find Profile folder, open it */
/* Create an empty directory named `chrome` in that */
/* Add this file in that directory with name userChrome.css */
/* Activating the configuration */
/* Go to address about:config, then set => toolkit.legacyUserProfileCustomizations.stylesheets: true */
sdkks / backup_neovim.zsh
Created Jan 24, 2023
Backup Vim Plugin State for "Plug"
View backup_neovim.zsh
# vim:set ft=sh:
/usr/local/bin/nvim -S $DOTFILES/vim/plug_snapshot.vim
/usr/local/bin/nvim -S $DOTFILES/vim/nvim.lock
sdkks /
Last active Feb 23, 2022
Stop AWS instances with matching tags
#!/usr/bin/env python3
# Assumes you have Python 3 and boto3 installed in your [virtual]env
# Assumes we are taking positional parameters (this script could be longer with argparse)
# Assumes you have AWS_PROFILE and AWS_DEFAULT_REGION set and credentials are valid and not expired at ~/.aws/credentials
import boto3
import json
from sys import argv, exit
if len(argv) != 3:
sdkks /
Last active Sep 10, 2022
How to SSH to Kubernetes Pod with SSH ProxyCommand using socat


  1. socat
  2. kubectl with proper ~/.kube/config that can connect to your cluster
  3. Working knowledge of kubectl client
  4. OpenSSH client

How does it work?

  1. kubectl does port forwarding to sshd port of your pod. I'm using pm2 process managed to keep my services alive in my workstation container. If you have only sshd, easiest to use is dropbear
  2. ProxyCommand of OpenSSH client uses socat to redirect two way fd - to forwarded port of kubectl
  3. Voila! You are in
sdkks /
Last active Sep 22, 2018
Windows how to copy paste like Mac OSX terminal using Alt instead of CMD in Linux Terminal Emulators with AHK AutoHotKey



Copy Paste (CTRL+C) command doesn't work for Linux terminals as CTRL+C is used for SIGINT signal to stop/interrupt works on Linux shell.


You are on Windows but need to have Linux shell like bash or zsh and using one of popular terminal emulators


  1. Download and Install AHK (AutoHotKey) //
  2. Put copy-paste.ahk anywhere in your machine and double click after saving it.
  3. Voila, now Alt + C (same position as CMD + C) will work just like Macbook on most of Linux Terminal emulators on Windows (tested with Cmder, MinTTY, Hyper.JS)
sdkks / .profile.ps1
Last active Sep 15, 2018
How to use Hyper.JS with PowerShell to Connect to your Kubernetes (K8S) Workstation Terminal
View .profile.ps1
Set-PSReadlineOption -EditMode Emacs
$env:KUBECONFIG="c:\Users\<your path to special kubeconfig for your gke/eks/aks cluster>\kube-config"
kubectl get pod | Select-String "ws-" | Select-String "Running" | %{ "$_".split(" ")[0]} | %{kubectl exec -ti $_ -- su - said}
sdkks /
Created Jul 14, 2018
Vacuum journalctl of nodes in your inventory
#!/usr/bin/env bash
case $1 in
echo "Completed with success"
echo "Exited with failure: $1"
sdkks /
Created Jun 2, 2018
Get URL Load Speed Using CURL
#!/usr/bin/env bash
case $1 in
echo "Please provide URL as positional parameter. i.e.: ./script <url>"
exit 1
sdkks / iterm_nvim.AppleScript
Last active May 21, 2022
Open File with iTerm2 + nvim on OSX using Automator
View iterm_nvim.AppleScript
on run {input, parameters}
-- If run without input, open random file at $HOME
set filename to POSIX path of input
on error
set filename to "nvim-" & (do shell script "date +%F") & "__" & (random number from 1000 to 9999) & ".txt"
end try
-- Set your editor here
set myEditor to "/usr/local/bin/nvim"
-- Open the file and auto exit after done