This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# completion script for above awss function | |
# If you change your function name, replace your function name with here awss | |
# the grep I used here is quite important and may be not work with your profile without simple tweak | |
# Simple logic is you have to have a command that returns all of the profile in aws config | |
_awss_completion() | |
{ | |
local cur prev opts | |
COMPREPLY=() | |
cur="${COMP_WORDS[COMP_CWORD]}" | |
prev="${COMP_WORDS[COMP_CWORD-1]}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# DESCRIPTION: | |
# * simple aws function that help you to add aws profile by just passing arguments | |
# | |
# USAGE: | |
# 1. Save this function in your ~/.bashrc or ~/.bash_profile or ~/.profile | |
# 2. Edit the places where required | |
# 2.1 replace <REGION> with your default region. Well region can be parametrised if u wish :D. | |
# e.g. ap-southeast-1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# DESCRIPTION: | |
# | |
# Set the bash prompt according to: (well there is k9s, but this is highly customizable as you wish; like I did :D) | |
# * current AWS profile configured (really helpful if you are switching AWS accounts frequently) | |
# * current context of Kubernetes(K8S) cluster ( also helpful to see which cluster you are working on | |
# * the active virtualenv | |
# * the branch/status of the current git repository | |
# * the return value of the previous command |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"io" | |
"net" | |
) | |
func main() { | |
ln, err := net.Listen("tcp", ":8080") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# update all git repositories in give folder | |
COLOR_NONE="\033[0m" | |
COLOR_1="\033[1;34m" | |
# making changes to shell options, affects regular expressions | |
shopt -s extglob nullglob | |
# check whether 1 arugment passed, if so then use it as base directory, else use current director as base directory |