This is a sample script for transposing slice from (n x m) to (m x n) for golang.
package main
import "fmt"
func transpose(slice [][]string) [][]string {| klogs() { | |
| pod="$(kubectl get po -o wide|tail -n+2|fzf -n1 --reverse --tac --preview='kubectl logs --tail=20 --all-containers=true {1}' --preview-window=down:50%:hidden --bind=ctrl-p:toggle-preview --header="^P: Preview Logs"|awk '{print $1}')" | |
| if [[ -n $pod ]]; then | |
| kubectl logs --all-containers=true $pod | |
| fi | |
| } |
A curated list of AWS resources to prepare for the AWS Certifications
A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.
| function killport { | |
| if [ $1 == '-h' ] || [ -z $1 ]; then | |
| echo '`killport <PORT>` finds the process listening to the specified port and kills it.' | |
| else | |
| process_line=`sudo lsof -i :$1 | tail -1` | |
| if [ "$process_line" == "" ]; then | |
| echo "no processes listening on $1" | |
| else | |
| process_name=`echo "$process_line" | awk '{print $1}'` | |
| echo "killing $process_name" |