Skip to content

Instantly share code, notes, and snippets.

View mehar's full-sized avatar
💭
Hiring software craftsmen

Mehar mehar

💭
Hiring software craftsmen
  • hudku
  • Bangalore
View GitHub Profile
@mehar
mehar / k8s_podentrypoint_bash_while_loop.md
Created October 23, 2020 21:50
k8s_podentrypoint_bash_while_loop.md
apiVersion: v1
kind: Pod
metadata:
  name: ubuntu
spec:
  containers:
  - name: ubuntu
    image: ubuntu:latest
 # Just spin & wait forever
Discover k8s resources
```
kubectl api-resources
```
Fetch resource schemas
```
kubectl explain replicaset --recursive
```
@mehar
mehar / tcpdump.md
Created November 29, 2018 09:56
TCP Dump CheatSheet

Dump http parsed messages

tcpdump -A -vv 'port 8086'
@mehar
mehar / Shell_Scripting_CheatSheet.md
Created October 20, 2018 15:04
Shell Scripting Cheat Sheet
FOO=${VARIABLE:-default}  # If variable not set or null, use default.
FOO=${VARIABLE:=default}  # If variable not set or null, set it to default.
sed 's/,/,\n/g' bigdata2.txt > bigdata2_formatted.txt
cat bigdata2_formatted.txt | grep label | awk -F ":" '{print $2}' | sort | uniq -c
@mehar
mehar / JavaNotes.md
Last active March 22, 2018 11:52
Java Notes

Print JVM defaults

java -XX:+PrintFlagsFinal

Print System Properties

jcmd process_id VM.system_properties

Print JVM tuning flags

@mehar
mehar / git_and_github_cheatsheet.md
Last active June 2, 2018 07:15
Git/GitHub CheatSheet

Useful Default Configurations

# git push by default pushes all matching branches upstream, options simple will just push the current branch
git config --global push.default simple
# git pull by default do a fetch and merge, introduces a merge commit, instead use a 'git pull --rebase' as default
git config --global pull.rebase true
# Configure ReReRe (Reuse Recorded Resolution)
git config --global rerere.enabled true
@mehar
mehar / flinkSummary.js
Created January 16, 2018 14:11
Flink Summary Script
/**
Instructions:
1) Open flink console
2) Open javascript console in the browser
3) Paste this script
4) When required call flinkSummary()
**/
// Import axios javascript
if (!document.getElementById("axios_script_id")) {
@mehar
mehar / CheatSheet.textile
Last active November 22, 2017 16:34
Tmux, Bash, Vi key bindings
Bash – Command Function Description – Bash -- -- Tmux – Command Function Description – TMux
-—— -——- -———————- -—— -——- -———————-
C-Q Clear Line Clears everything on current line C-b Prefix
C-L Clear Screen Clear the Screen Prefix C-h Show Help
C-U Cut Backwards Cut everything backwards to beginning of line Prefix pipe/- Split Pane Vertically/Horizontally
C-K Cut Forwards Cut everything forwards to the end of the line Prefix n/p Next/Prev Window Prefix Arrow – Pane
C-W Cut Word Back Cut one word backwards Prefix C-s Toggle Synchronization
C-Y Paste Paste whatever was cut by the lst cut command Prefix d Detach
C-H Same as backspace Prefix C-c Copy buffer to OSX copy buffer
| C-
# Set the base index for windows to 1 instead of 0
set -g base-index 1
# Set the base index for panesl to 1 instead of 0
setw -g pane-base-index 1
# Reload tmx configuration
bind r source-file ~/.tmux.conf \; display "Reloaded ~/.tmux.conf!"
# Ensure we can send Ctrl+b to other apps