Skip to content

Instantly share code, notes, and snippets.

View laszlomiklosik's full-sized avatar

Laszlo Miklosik laszlomiklosik

View GitHub Profile
@laszlomiklosik
laszlomiklosik / curl send multi-line JSON payload example
Created July 24, 2019 08:28
curl request with inline multiline JSON payload
curl -X PATCH http://localhost:8080/Users/7234e4cd-eb7f-4a96-953e-3bd11439efcf -H 'Content-Type: application/json' -d @- <<BODY
{
"emails": [
"a@b.com",
"b@c.com"
]
}
BODY
@laszlomiklosik
laszlomiklosik / Docker registry see digest for Docker image tag.sh
Created January 18, 2019 10:40
Docker registry see digest for Docker image tag
curl -k -H "Accept: application/vnd.docker.distribution.manifest.v2+json" https://registry-devel.a.mgt:5000/v2/<image_name>/manifests/<image_tag>
@laszlomiklosik
laszlomiklosik / Docker exec with root (how to jump in a docker container directly with root)
Created June 28, 2018 09:15
Docker exec with root (how to jump in a docker container directly with root)
$ docker exec -u 0 -it openam bash
root@192:/usr/local/tomcat# whoami
root
(user 0 is root, but it works with any other userid from /etc/passwd of the container)
@laszlomiklosik
laszlomiklosik / How to get into the Docker host on Docker for Mac e.g. to see var-lib-docker.md
Last active July 7, 2017 07:59
How to get into the Docker host on Docker for Mac e.g. to see var-lib-docker
docker exec [CONTAINER_NAME] rabbitmq-plugins enable rabbitmq_management
# inspiration was: https://github.com/docker-library/rabbitmq/issues/45
@laszlomiklosik
laszlomiklosik / SSH key forwarding on Mac OS
Created August 3, 2015 10:03
SSH key forwarding on Mac OS
Steps:
1. run: ssh-add
2. when connecting use: ssh -A DEST_SERVER_NAME
inspiration:
http://apple.stackexchange.com/questions/37184/ssh-a-doesnt-properly-enable-forwarding-of-authentication-agent-connection
Note: no changes in ssh_config are necessary (as described in https://developer.github.com/guides/using-ssh-agent-forwarding/#setting-up-ssh-agent-forwarding)
@laszlomiklosik
laszlomiklosik / Linux find file by content
Created July 13, 2015 14:47
Linux find file recursively by content
# for example
find . -type f -name '*.java' -print0 | xargs -0 grep -l 'implements MyInterface'
@laszlomiklosik
laszlomiklosik / LDAP JXplorer trust self signed certificate
Created June 30, 2015 16:42
LDAP JXplorer trust self signed certificate workaround
2 easy steps:
1) echo -n | openssl s_client -connect AD_SERVER:AD_SERVER_PORT | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > ldapserver.pem
2) keytool -import -trustcacerts -file ldapserver.pem -alias ALIAS_GOES_HERE -keystore /Users/.../Apps/jxplorer-3.3.1-osx/jxplorer-3.3.1.app/Contents/Resources/security/cacerts
@laszlomiklosik
laszlomiklosik / Java remote debug JVM args
Created June 30, 2015 14:22
Java remote debug JVM args
Example:
java -Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=4000,suspend=n My.class
@laszlomiklosik
laszlomiklosik / Gerrit review gitconfig alias
Created June 11, 2015 14:49
Gerrit review gitconfig alias
# Usage: `git review branchName` (tested on Linux and Git bash)
review = !sh -c 'git push origin HEAD:refs/for/$1%r=a@b.com,c@d.com' -