This file contains hidden or 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
| # Example to use Podman instead of containerd & nerdctl | |
| # $ limactl start ./podman.yaml | |
| # $ limactl shell podman podman run -it -v $HOME:$HOME --rm docker.io/library/alpine | |
| # To run `podman` on the host (assumes podman-remote is installed): | |
| # $ export CONTAINER_HOST=$(limactl list podman --format 'unix://{{.Dir}}/sock/podman.sock') | |
| # $ podman --remote ... | |
| # To run `docker` on the host (assumes docker-cli is installed): | |
| # $ export DOCKER_HOST=$(limactl list podman --format 'unix://{{.Dir}}/sock/podman.sock') |
This file contains hidden or 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 | |
| NAMESPACE=default | |
| SERVICE_ACCOUNT=mysa | |
| # kubectl -n $NAMESPACE create sa $SERVICE_ACCOUNT | |
| kubectl -n $NAMESPACE get secret `kubectl -n $NAMESPACE get serviceaccount $SERVICE_ACCOUNT -ojsonpath="{.secrets[0].name}"` -ojsonpath="{.data.token}" | base64 -d | |
| # BONUS: use kubectl with the service account token: | |
| kubectl --token="${TOKEN}" -s https://api.<cluster-domain>:6443 --insecure-skip-tls-verify=true get pod |
This file contains hidden or 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
| --- | |
| - name: Wait for OpenShift Cluster to be installed | |
| hosts: localhost | |
| tasks: | |
| - name: Wait for Cluster to be installed | |
| k8s_info: | |
| api_version: config.openshift.io/v1 | |
| kind: ClusterVersion | |
| name: version | |
| register: ocp_clusterversion_result |
This file contains hidden or 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
| export GPG_TTY=$(tty) | |
| pgrep -U $UID gpg-agent > /dev/null || gpg-connect-agent /bye > /dev/null 2>&1 |
This file contains hidden or 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 | |
| while true; do >&2 printf '\x00'; sleep 20; done & |
This file contains hidden or 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 | |
| if [ ! "$#" -eq "2" ]; then | |
| echo "Usage: $0 <path> <search_text>" | |
| exit 1 | |
| fi | |
| find "$1" -name '*.pdf' -exec sh -c "pdftotext -q '{}' - | grep --with-filename --label='{}' --color -i '$2'" \; |
This file contains hidden or 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 | |
| # start ansible container with working directory mounted as /ansible | |
| # then run ping on targets from inventory file | |
| docker run --rm -v $(pwd):/ansible -it webdevops/ansible:alpine ansible -m ping -i /ansible/inventory all |
This file contains hidden or 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
| // manipulate octets of IP address with Javascript regular expressions | |
| var regex = /^(\d{1,3}\.\d{1,3}\.\d{1,3}\.)(\d{1,3})(\/[1-3]?\d)$/; | |
| var ip = '169.254.0.17/30'; | |
| var octet4 = ip.match(regex)[2] - 1; // match and manipulate octet | |
| var ip2 = ip.replace(regex, '$1' + octet4 + '$3'); // reassemble IP | |
| console.log(ip2); //169.254.0.16/30 |
This file contains hidden or 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
| @namespace url(http://www.w3.org/1999/xhtml); | |
| @-moz-document domain("online.tipp10.com") { | |
| #training, .lightsel0 { | |
| background-color: #002b36; | |
| } | |
| #ticker, #status { | |
| background-color: #073642; | |
| } | |
| #fingers { |