Skip to content

Instantly share code, notes, and snippets.

View rm--'s full-sized avatar

René rm--

View GitHub Profile
@rm--
rm-- / url_encode_decode.py
Created March 1, 2018 15:41
url encode and decode in python (alias)
urlencode='python3 -c "import sys, urllib.parse as ul; print(ul.quote_plus(sys.argv[1]))"'
urldecode='python3 -c "import sys, urllib.parse as ul; print(ul.unquote_plus(sys.argv[1]))"'
@rm--
rm-- / tcp-http.md
Created August 10, 2023 08:26
tcp connection, manual http request
> nc google.de 80
GET /search?q=test
@rm--
rm-- / nc_file_send.md
Last active August 9, 2023 12:56
send file via network (e.g. WLAN) and netcat

reveiver

nc -l 8080 > <new file>

sender

cat <existing file> | nc < receiver IP address > 8080

@rm--
rm-- / heredoc.md
Created July 7, 2023 08:37
multiline heredoc
cat << EOF >> ~/.profile
alias k=kubectl
alias kc=kubectl
alias ll='ls -als'
alias pd='kubectl delete -k .'
alias po='kubectl get pods'
alias pw='kubectl get pods -w'
alias svc='kubectl get svc'
alias events='kubectl get events --watch'
@rm--
rm-- / curl post here doc.md
Created July 7, 2023 08:35
curl post here doc
curl -0 -X POST -u $STUDIO_USERNAME:$STUDIO_PASSWORD $SERVICE_URL/studio/api/2/repository/add_remote \
-H 'Content-Type: application/json; charset=utf-8' \
--resolve $CONTAINER_FQDN_AUTHORING:443:$CONTAINER_URL_AUTHORING \
--data-binary @- << EOF
{
        "siteId": "$SITE",
        "remoteName": "$REMOTE_NAME",
        "remoteUrl": "$GIT_REPO",
 "authentication_type": "basic",
@rm--
rm-- / resolve.md
Created July 7, 2023 08:34
curl resolve/ fake dns

curl --resolve example.com:443:127.0.0.1 https://example.com

@rm--
rm-- / git history of moved file.md
Created June 13, 2023 06:49
git history of moved/renamed file
git log --follow --patch -- <path>

Welche Probleme sollen gelöst werden?

1. Man will eine app irgendwo laufen lassen....

  • und vielleicht noch etwas mehr...

Lösung

  • Kubernetes
  • Azure als Cloud-Umgebung
@rm--
rm-- / new ip.md
Created March 6, 2023 13:59
replace all ips with new one in /etc/hosts

oip=&lt;&gt;;nip=&lt;&gt;;sudo gsed -i "s/$oip/$nip/g" /etc/hosts

@rm--
rm-- / disable startup chime.md
Last active September 12, 2022 12:53
How to Disable the Boot Sound (or “Startup Chime”) on a Mac