Skip to content

Instantly share code, notes, and snippets.

View rm--'s full-sized avatar

René rm--

View GitHub Profile
@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-- / 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
@rm--
rm-- / _.js
Last active November 8, 2021 15:17
sha512 digest to int
async function digestMessage(message) {
const encoder = new TextEncoder();
const data = encoder.encode(message);
const hash = await crypto.subtle.digest('SHA-512', data);
return hash;
}
digestMessage('input')
.then(digestBuffer => console.log(new DataView(digestBuffer).getUint32()));
3698158640
@rm--
rm-- / _.py
Last active November 8, 2021 15:15
sha512 digest to int
import hashlib
h = hashlib.sha512()
h.update('input'.encode('utf-8'))
int(h.hexdigest()[0:8], base=16)
3698158640