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
curl -s https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py | python - |
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
# require `python3 -m pip install jq` | |
virsh list --name | \ | |
xargs -I '{}' virsh dumpxml '{}' | \ | |
xq '//domain/memory/text()' | \ | |
sed -rn 's@.*<result>(.*)</result>@\1@p' | \ | |
paste -sd+ | \ | |
bc |
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 random | |
def randomMAC(): | |
mac = [ 0x52, 0x54, 0x00, | |
random.randint(0x00, 0x7f), | |
random.randint(0x00, 0xff), | |
random.randint(0x00, 0xff) ] | |
return ':'.join(map(lambda x: "%02x" % x, mac)) | |
print randomMAC() |
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
# https://pykickstart.readthedocs.io/en/latest/ | |
# https://rhinstaller.github.io/anaconda | |
# virt-install --name teste --memory 2048 --disk size=10 --cpu host-passthrough --accelerate --hvm --location http://mirror.centos.org/centos/7/os/x86_64/ --os-variant centos7.0 --network bridge=virbr0,model=virtio --initrd-inject ks.cfg --extra-args "inst.ks=file:/ks.cfg inst-nosave=all console=tty0 console=ttyS0,115200" --nographics | |
#version=DEVEL | |
# System authorization information | |
auth --passalgo=sha512 --enableshadow | |
# Install OS instead of upgrade | |
install | |
cmdline |
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
$include /etc/inputrc | |
# Search history with key UP/DOWN | |
"\e[A": history-search-backward | |
"\e[B": history-search-forward | |
# Display all matching commands on TAB | |
set show-all-if-ambiguous on | |
# Display matching commands ignoring case | |
set completion-ignore-case on |
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
echo <<EOT > curl-format.txt | |
time_namelookup: %{time_namelookup}\n | |
time_connect: %{time_connect}\n | |
time_appconnect: %{time_appconnect}\n | |
time_pretransfer: %{time_pretransfer}\n | |
time_redirect: %{time_redirect}\n | |
time_starttransfer: %{time_starttransfer}\n | |
----------\n | |
time_total: %{time_total}\n | |
EOT |
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 -n kube-system describe secrets \ | |
`kubectl -n kube-system get secrets | awk '/clusterrole-aggregation-controller/ {print $1}'` \ | |
| awk '/token:/ {print $2}' |
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
openssl req -x509 -out localhost.crt -keyout localhost.key \ | |
-newkey rsa:2048 -nodes -sha256 \ | |
-subj '/CN=localhost' -extensions EXT -config <( \ | |
printf "[dn]\nCN=localhost\n[req]\ndistinguished_name = dn\n[EXT]\nsubjectAltName=DNS:localhost\nkeyUsage=digitalSignature\nextendedKeyUsage=serverAuth") |
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
gpg --gen-key | |
git config --global user.signingkey <KEY> | |
git config --global commit.gpgsign 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
pem2openpgp "Name Surname <email@something>" < mykey.pem | gpg --import |