Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View gonzalesraul's full-sized avatar

Raul Gonzales gonzalesraul

View GitHub Profile

Introduction

  • C-a == Ctrl-a
  • M-a == Alt-a

General

:q        close
:w        write/saves
:wa[!]    write/save all windows [force]
:wq       write/save and close

Bash Cheatsheet

Editing Shortcuts

Input Description
Ctrl + a go to the start of the command line
Ctrl + e go to the end of the command line
Ctrl + k delete from cursor to the end of the command line
Ctrl + u delete from cursor to the start of the command line
@gonzalesraul
gonzalesraul / delete-pods-by-status.sh
Created November 30, 2018 17:59
Delete pods on Kubernetes with failed status
#!/usr/bin/env sh
#Delete in all namespaces (Evicted pods)
kubectl get po --field-selector=status.phase==Failed --all-namespaces --no-headers -o=custom-columns=k:kind,n:.metadata.name,ns:.metadata.namespace|while read k n ns;do kubectl delete $k/$n -n $ns; done
#Delete specific namespace
kubectl get po --field-selector=status.phase==Failed -n ${NAMESPACE} --no-headers -o=custom-columns=k:kind,n:.metadata.name,ns:.metadata.namespace|while read k n ns;do kubectl delete $k/$n -n $ns; done

Set up Keybase.io, GPG & Git to sign commits on GitHub

This is a step-by-step guide on how to create a GPG key on keybase.io, adding it to a local GPG setup and use it with Git and GitHub.

Although this guide was written for macOS, most commands should work in other operating systems as well.

There's a video published by Timothy Miller explaining some parts of this guide. Discussion on Hacker News.

Note: If you don't want to use Keybase.io, follow [this guide][1] instead. For manually transferring keys to different hosts, check out this [answer on Stack Overflow][2].

Keybase proof

I hereby claim:

  • I am gonzalesraul on github.
  • I am gonzalesraul (https://keybase.io/gonzalesraul) on keybase.
  • I have a public key ASB65wSLgzABQdYI5J5_15merYHqmG1WThWoh0ektjMYIAo

To claim this, I am signing this object:

@gonzalesraul
gonzalesraul / minikube_profile.sh
Created June 4, 2018 13:12
Change default behavior for minikube CLI on `profile` command
function minikube() {
if [[ $1 == "profile" ]]; then
case $2 in
list )
current=`grep -oP '(?<="profile": ")[^"]*' $HOME/.minikube/config/config.json`
profiles=`ls -1 $HOME/.minikube/profiles`
echo -n "* $current"
if [[ '' == `echo $profiles|grep $current` ]]; then
echo -n " (not created)"
fi
@gonzalesraul
gonzalesraul / introrx.md
Created June 1, 2018 10:57 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@gonzalesraul
gonzalesraul / Makefile
Created May 14, 2018 10:06 — forked from mpneuried/Makefile
Simple Makefile to build, run, tag and publish a docker containier to AWS-ECR
# import config.
# You can change the default config with `make cnf="config_special.env" build`
cnf ?= config.env
include $(cnf)
export $(shell sed 's/=.*//' $(cnf))
# import deploy config
# You can change the default deploy config with `make cnf="deploy_special.env" release`
dpl ?= deploy.env
include $(dpl)