Skip to content

Instantly share code, notes, and snippets.

View rm--'s full-sized avatar

René rm--

View GitHub Profile
@rm--
rm-- / gist:9451f82cd25e715a6640244ac71404e7
Last active October 10, 2024 08:58
create test file with specific size
yes 'This is a test file.' | head -c 10000000 > testfile.txt
@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