Thursday, March 25, 2021

Troubleshooting AWS CloudFormation


https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/troubleshooting.html#basic-ts-guide

 https://stackoverflow.com/questions/23818209/user-data-scripts-fails-without-giving-reason


Sunday, March 14, 2021

Kubernetes: kubectl config management.

 Config kubectl

Script to set current contexts:

clear


production="true"


[[ $0 != $BASH_SOURCE ]] && contextName=$BASH_SOURCE || contextName=$0


contextName=${contextName##*/}


export KUBECONFIG=~/.kube/config.${contextName}


kubectl config use-context ${contextName}


#starts 38;5; for the foreground and 48;5; for the background, then the color number


if [ $production == "true" ]; then

  export PS1="\e[38;5;016;0;48;5;166m\u@\H:\w - \e[5m$contextName\e[25m $ "

else

  export PS1="\e[38;5;012;48;5;015m\u@\H:\w - $contextName $ "

fi

  

kubectl config get-contexts

Sunday, March 7, 2021

ElasticSearch CAT apis

 https://www.elastic.co/guide/en/elasticsearch/reference/current/cat.html


curl https://search-goweekend-1-ntahrt3q5ijfa.us-east-1.es.amazonaws.com/_cat/allocation\?v\=\&s\=disk.total:desc,disk.avail

curl https://search-goweekend-1-ntahrt3q5ijfa.us-east-1.es.amazonaws.com/_cat/master?help

curl https://search-goweekend-1-ntahrt3q5ijfa.us-east-1.es.amazonaws.com/_cat/nodes?h=ip,port,heapPercent,name

curl https://search-goweekend-1-ntahrt3q5ijfa.us-east-1.es.amazonaws.com/_cat/indices?bytes=b&s=store.size:desc&v=true

curl 'https://search-goweekend-1-ntahrt3q5ijfa.us-east-1.es.amazonaws.com/_cat/indices?format=json&pretty'

curl 'https://search-goweekend-1-ntahrt3q5ijfa.us-east-1.es.amazonaws.com/_cat/indices?pretty'  -H "Accept: application/json"

curl 'https://search-goweekend-1-ntahrt3q5ijfa.us-east-1.es.amazonaws.com/_cat/templates?v=true&s=order:desc,index_patterns'

curl https://search-goweekend-1-ntahrt3q5ijfa.us-east-1.es.amazonaws.com/_cat/shards

curl https://search-goweekend-1-ntahrt3q5ijfa.us-east-1.es.amazonaws.com/_cat/shards?h=index,shard,prirep,state,unassigned.reason

curl https://search-goweekend-1-ntahrt3q5ijfa.us-east-1.es.amazonaws.com/_cat/health

curl 'https://search-goweekend-1-ntahrt3q5ijfa.us-east-1.es.amazonaws.com/_cat/snapshots/repo1?v=true&s=id'

curl https://search-goweekend-1-ntahrt3q5ijfa.us-east-1.es.amazonaws.com/_cat/repositories

Mikrotik Notes

 [admin@MikroTik] > /ip firewall f enable numbers=64 

[admin@MikroTik] > /ip firewall f enable numbers=65 

/ip firewall filter set time=22h-22h55m,sun,mon,tue,wed,thu,fri,sat number=58 /ip firewall filter set time=19h-19h10m,sun,mon,tue,wed,thu,fri,sat number=57 /ip firewall filter set time=20h28m-21h55m,sun,mon,tue,wed,thu,fri,sat number=20 /ip firewall filter set time=20h28m-21h55m,sun,mon,tue,wed,thu,fri,sat number=22 /ip firewall filter set time=20h28m-21h55m,sun,mon,tue,wed,thu,fri,sat number=24 /ip kid-control set sun="21h-21h55m" number=1

Configure Mikrotik as Transparent Proxy
https://systemzone.net/mikrotik-router-web-proxy-configuration/

https://systemzone.net/mikrotik-webproxy-log-analyzer-configuration/

https://brezular.com/2021/08/01/initial-setup-of-mikrotik-hap-ac%C2%B3-router/

============== Configure Transparent Proxy ==============


Allow ping from WAN

/ip firewall filter add place-before=[find chain=input] chain=input action=accept protocol=icmp icmp-options=8:0-255

Example:
/ip firewall filter add place-before=1 chain=input action=accept protocol=icmp icmp-options=8:0-255

Configure PtP Bridge
https://scoop.co.za/blog/how-to-create-a-mikrotik-ptp-bridge-link