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
import string | |
letters = list(string.ascii_lowercase) | |
vowels = ['a', 'e', 'i', 'o', 'u'] | |
consonants = set(letters).difference(set(vowels)) | |
unwanted = {'x','w','z','f','q'} | |
unwanted2 = {'x','w','z','f','q','h'} | |
cons = consonants.difference(unwanted) | |
cons1 = consonants.difference(unwanted2) |
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 | |
sudo ls | |
docker rm -f $(docker ps -qa) | |
docker rmi -f $(docker images -q) | |
docker volume rm $(docker volume ls -q) | |
cleanupdirs="/var/lib/etcd /etc/kubernetes /etc/cni /opt/cni /var/lib/cni /var/run/calico" | |
for dir in $cleanupdirs; do | |
echo "Removing $dir" | |
rm -rf $dir |
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
#Generated by Kickstart Configurator | |
#platform=x86 | |
# Fetch content from here | |
url –url http://nl.archive.ubuntu.com/ubuntu/ | |
#System language | |
lang en_US.UTF-8 | |
#Language modules to install |
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
# find out what is still there in namespace | |
kubectl api-resources --verbs=list --namespaced -o name | xargs -n 1 kubectl get --show-kind --ignore-not-found -n <namespace> | |
# edit those resources and comment out all those under finalizers. | |
# try deleting namespace now |
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
# Pythono3 code to rename multiple | |
# files in a directory or folder | |
# importing os module | |
import os | |
# Function to rename multiple files | |
def main(): | |
for file in os.listdir(): | |
original = file |
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
# clone the repo from your existing git source [gilab, github etc] | |
git clone OLDREPO | |
# cd into the cloned repo | |
cd NEWCLONEDREPO | |
# check in and check out of all clones branches to mirror them locally | |
git branch -r | grep -v '\->' | while read remote; do git branch --track "${remote#origin/}" "$remote"; done | |
# fetch and pull |
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
{"lastUpload":"2020-09-09T11:54:18.985Z","extensionVersion":"v3.4.3"} |
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
def uppercase(data): | |
'''takes a non nested dictionary and converts the values to uppercase''' | |
output = {} | |
for k, v in data.items(): | |
output[k] = v.upper() | |
return output |
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
def uppercase(data): | |
'''takes a non nested dictionary and converts the values to uppercase''' | |
output = {} | |
for k, v in data.items(): | |
output[k] = v.upper() | |
return output |
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
Write-Host "make sure you are connected to a vcenter first" | |
$cluster = Read-Host "cluster name?" | |
$vmhosts = Get-Cluster $cluster | Get-VMHost | sort | |
$stackName = 'vmotion' | |
$ipGateway = Read-Host "default gateway?" | |
$ipDevice = Read-Host "vmk device?" # ex: vmk2 | |
forech $VMHost in $vmhosts { | |
$esx = Get-VMHost -Name $VMHost | |
$netSys = Get-View -Id $esx.ExtensionData.ConfigManager.NetworkSystem |
NewerOlder