Show the current logged-in user.
whoami
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "PublicReadGetObject", | |
"Effect": "Allow", | |
"Principal": "*", | |
"Action": "*", | |
"Resource": [ | |
"arn:aws:s3:::bucketname", |
#! /usr/bin/bash | |
read -p "Give size of swap you wants to create:" usr_input | |
echo "Your swap memory will be create of size : $usr_input" | |
sudo fallocate -l $usr_input /swapfile | |
sudo chmod 600 /swapfile | |
sudo mkswap /swapfile | |
sudo swapon /swapfile | |
sudo swapon --show |
[ | |
{ | |
"AllowedHeaders": [ | |
"*" | |
], | |
"AllowedMethods": [ | |
"PUT", | |
"POST", | |
"GET" | |
], |
server { | |
server_name domain.com; | |
location / { | |
proxy_pass http://localhost:1111; | |
proxy_http_version 1.1; | |
proxy_set_header Upgrade $http_upgrade; | |
proxy_set_header Connection 'upgrade'; | |
proxy_set_header Host $host; |
check git remove by this command
git remote -v
Add second github remote
git remote add github https://github.com/organization/repo.git
check remote again
apiVersion: karpenter.sh/v1beta1 | |
kind: NodePool | |
metadata: | |
name: default | |
spec: | |
template: | |
metadata: | |
labels: | |
lifecycle: on-demand | |
spec: |
Aliases to Automate and Fast the Daily CLI Life
alias kgp='kubectl get pods'
alias kgd='kubectl get depoyments'
alias kaf='kubectl apply -f'
alias gst='git status'
alias gad='git add'
alias gl='git pull'
Scale All the deployments of the single namespace to Specific Number. Useful when wants to Scale diffrent environments.
kubectl scale deploy -n dev --replicas=3 --all
Edit HPA For the Whole Namespace with Single liner:
for deployment in $(kubectl get deployments -o jsonpath='{.items[*].metadata.name}' -n <namespace>); do
kubectl autoscale deployment $deployment --min=<min-replicas> --max=<max-replicas> --cpu-percent=<cpu-percent>
done