Skip to content

Instantly share code, notes, and snippets.

View greenmang0's full-sized avatar
😀

Abhishek Amberkar greenmang0

😀
View GitHub Profile
(defn pronounce-nums
[coll]
(interleave
(vec (map count (partition-by identity coll)))
(distinct coll)))
@greenmang0
greenmang0 / check_open_fd_by_port.sh
Last active May 23, 2018 22:46
Check percentage of number of file descriptors opened by a process out of allocated file descriptors.
#!/bin/bash
############################################################
# Based On
# http://exchange.nagios.org/directory/Plugins/Operating-Systems/Linux/Check-Open-FDs-%28File-Descriptors%29/details
###########################################################
USAGE="$(basename $0) ([-w]<warn %>)([-c]<crit %>)([-p]<port number>)"
THRESHOLD_USAGE="CRITICAL threshold must be greater than WARNING: $(basename $0) $*"
while getopts "hw:c:p:" OPTION; do
@greenmang0
greenmang0 / custom-ubuntu-ami.sh
Last active August 29, 2015 13:57
Create a custom AMI using Canonical provided images
#!/bin/bash
## Refer: http://alestic.com/2010/01/ec2-ebs-boot-ubuntu ##
# create directory structure
mkdir -p $HOME/image
# download, extract and mount image
cd $HOME
wget "http://cloud-images.ubuntu.com/releases/precise/release/ubuntu-12.04-server-cloudimg-amd64.tar.gz"
@greenmang0
greenmang0 / cvimrc
Last active August 29, 2015 14:11
cvim
set noinsertmappings
set typelinkhints
map <C-n> nextTab
map <C-p> previousTab
map d closeTab
map u lastClosedTab
map <C-f> scrollFullPageDown
map <C-b> scrollFullPageUp
map <C-d> scrollPageDown

Keybase proof

I hereby claim:

  • I am greenmang0 on github.
  • I am abhishek_ (https://keybase.io/abhishek_) on keybase.
  • I have a public key whose fingerprint is 4396 60D6 0B42 0C75 DE6D 6AA4 FBDB C40D DFD8 0B1C

To claim this, I am signing this object:

@greenmang0
greenmang0 / zsh-keyboard-shortcuts.md
Last active May 1, 2023 08:52 — forked from mkfares/zsh-keyboard-shortucts.md
Common zsh Keyboard Shortcuts on macOS Catalina

Common zsh Keyboard Shortcuts on macOS

Navigation

CTRL + A : Move the cursor to the beginning of the line
CTRL + E : Move the cursor to the end of the line
OPTION + Left Arrow : Move the cursor one word backward
OPTION + Right arrow : Move the cursor one word forward
Left Arrow : Move the cursor one character backward
Right Arrow : Move the cursor one character forward