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
{ | |
"semi": false, | |
"singleQuote": true, | |
"printWidth": 150, | |
"htmlWhitespaceSensitivity": "ignore" | |
} |
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
- --serverstransport.insecureskipverify=true | |
- --entrypoints.websecure.http.tls=true |
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
kubectl get po -A --all-namespaces -o json | jq '.items[] | select(.status.reason!=null) | select(.status.reason | contains("Evicted")) | "kubectl delete po \(.metadata.name) -n \(.metadata.namespace)"' | xargs -n 1 bash -c |
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
# Get the Docker gpg key | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
# Add the Docker repository | |
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ | |
$(lsb_release -cs) \ | |
stable" | |
# Get the Kubernetes gpg key | |
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add - |
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/sh | |
# based on https://gist.github.com/ipedrazas/9c622404fb41f2343a0db85b3821275d | |
# delete all evicted pods from all namespaces | |
kubectl get pods --all-namespaces | grep Evicted | awk '{print $2 " --namespace=" $1}' | xargs kubectl delete pod --namespace $1 | |
# delete all containers in ImagePullBackOff state from all namespaces | |
kubectl get pods --all-namespaces | grep 'ImagePullBackOff' | awk '{print $2 " --namespace=" $1}' | xargs kubectl delete pod | |
# delete all containers in ImagePullBackOff or ErrImagePull or Evicted state from all namespaces |
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 | |
# port, username, password | |
SERVER="localhost:9091 --auth user:pass" | |
# use transmission-remote to get torrent list from transmission-remote list | |
TORRENTLIST=`transmission-remote $SERVER --list | sed -e '1d' -e '$d' | awk '{print $1}' | sed -e 's/[^0-9]*//g'` | |
# for each torrent in the list | |
for TORRENTID in $TORRENTLIST |
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/sh | |
# https://dl.ubnt.com/unifi/5.11.46/unifi_sh_api | |
#username=ubnt | |
#password=ubnt | |
#baseurl=https://unifi:8443 | |
#site=default | |
#[ -f ./unifi_sh_env ] && . ./unifi_sh_env | |
cookie=$(mktemp) |
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
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 | |
$From = "[email protected]" | |
$To = "[email protected]" | |
$Cc = "[email protected]" | |
$Subject = "Here's the Email Subject" | |
$Body = "This is what I want to say" | |
$SMTPServer = "smtp.gmail.com" | |
$SMTPPort = "587" | |
Send-MailMessage -From $From -to $To -Cc $Cc -Subject $Subject -Body $Body -SmtpServer $SMTPServer -port $SMTPPort -UseSsl -Credential (Get-Credential) –DeliveryNotificationOption OnSuccess |
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
# Adam Hancock | |
if(Get-Module MSOnline){ | |
write-host "Module already installed." | |
}else{ | |
Install-Module -Force MSOnline | |
} | |
if(!$Cred){ | |
$Cred = Get-Credential | |
} |
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
## Adam Hancock | |
rm -f output.csv | |
echo "Domain, IP, MX IP, Nameservers" >> output.csv | |
while read d; do | |
p=`echo $d | sed -e 's/www.//g'` | |
website=`dig @8.8.8.8 +short $p | head -n1` | |
mx=`dig @8.8.8.8 +short mx $p | cut -d " " -f 2 | head -n1` | |
nameservers=`dig ns $p +short` | |
nameserver1=`echo $nameservers | head -n1` | |
mx1=`dig +short $p mx | sort -n | awk '{print $2; exit}' | dig +short -f - | head -n1` |
NewerOlder