Skip to content

Instantly share code, notes, and snippets.

@mazzma12
Last active October 13, 2021 12:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mazzma12/6d21ca8de10e8802e037f629b4cc1d61 to your computer and use it in GitHub Desktop.
Save mazzma12/6d21ca8de10e8802e037f629b4cc1d61 to your computer and use it in GitHub Desktop.
Common oneliners used in Bash and their purpose
# Find IP address from host
nslookup $hostanme
# https://superuser.com/a/1414856
nslookup $hostname | grep -i address | awk -F" " '{print $2}' | awk -F# '{print $1}' | tail -n 1
# DNS issues: better use dig as host will use the local cache of the machine
# @ specifies another resolver than the local cache DNS
dig google.com +short @1.1.1.1
## Docker
# Run notebook forward port and net
docker run -p 8888:8888 --net=host -it scipynb
## Kube
# Remove completed pods
kubectl get pods -n $namespace | grep Completed | cut -d" " -f1 | xargs -n 1 kubectl delete -n $namespace pod
# Generate basic auth https://kubernetes.github.io/ingress-nginx/examples/auth/basic/
# Where file.txt is a file with https:// links
wget -i ~/file.txt --http-user=myName --http-passwd=pwd
# Goofys
export bucket_name=blabla
folder_name=$bucket_name
mkdir $folder_name
goofys --region $region --endpoint $endpoint --profile oio $bucket_name $folder_name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment