Skip to content

Instantly share code, notes, and snippets.

View jebeaudet's full-sized avatar

Jacques-Etienne Beaudet jebeaudet

  • Coveo
  • Quebec, Canada
View GitHub Profile
import org.eclipse.jetty.http.HttpHeader;
import org.springframework.cloud.netflix.zuul.filters.ProxyRequestHelper;
import org.springframework.stereotype.Component;
import com.netflix.zuul.ZuulFilter;
import com.netflix.zuul.context.RequestContext;
@Component
public class XForwardedHeadersPreFilter extends ZuulFilter
{
@jebeaudet
jebeaudet / gist:6c3934bad750fde4d13572af56ee9618
Created May 30, 2017 12:35
Colored grep that highlight pattern
grep --color -E "pattern|$"
@jebeaudet
jebeaudet / gist:325fdb7ebe5bce621bde8da112f340e8
Created May 30, 2017 12:38
Live docker logs by attaching to the container
# Don't forget the sig-proxy option otherwise your ctrl-c will be passed to the running container!
docker attach --sig-proxy=false authorization_server
@jebeaudet
jebeaudet / gist:f433ccd80fdc235b0931d998dab2e08b
Created May 31, 2017 01:23
Rename directory and folders recursive windows powershell
Get-ChildItem -Recurse | Rename-Item -NewName { $_.name -replace "ô","o" -replace "é","e" -replace "è","e" -replace "à","a" -replace "À"."A" -replace "È","E" -replace "Î","I" -replace "î","i" }
ffmpeg -i rtsp://192.168.XXX.XXX:554/unicast -b 900k -vcodec copy -r 60 -y MyVdeoFFmpeg.avi
@jebeaudet
jebeaudet / gist:d764cbb1df7e966120d10b20270b0981
Created August 17, 2017 17:06
Clean docker containers, images and volumes
docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)
docker rmi $(docker images -a -q)
docker volume rm $(docker volume ls -f dangling=true -q)
@jebeaudet
jebeaudet / gist:b05c8b096e3fc28170e06fa1f5dbf60a
Created August 30, 2017 18:25
Change docker environment variables on an existing container
stop docker service (`sudo service docker stop`)
edit the file located at `/var/lib/docker/containers/:containerId/config.v2.json`
restart docker service
profit!
@jebeaudet
jebeaudet / gist:15b874372d8d7b70be9a8a4ce7fd3a98
Created October 31, 2017 18:49
How to trace live requests coming to a server using ngrep
ngrep -l -q -d eth0 -W byline -i "^GET|^POST|^HEAD|^DELETE|^PUT" tcp
@jebeaudet
jebeaudet / gist:25bddb4e36653cbba3f0c83b34eff414
Last active February 1, 2019 20:29
Dump java docker heap
# install openjdk in the container
docker exec -it --user=root container_name sh
apk add openjdk8
docker exec -it <container_name> jmap -dump:format=b,file=/tmp/cheap.bin 1
# Also works
docker exec <container_name> jcmd 1 GC.heap_dump /tmp/docker.hprof
@jebeaudet
jebeaudet / gist:03d4c33acadb7b89ad9b119fe6db6ab9
Last active July 6, 2021 15:22
Decrypt jenkins encrypted value
Go to https://jenkinsurl.com/script and run :
println(hudson.util.Secret.decrypt("{encrypted_value}"))
To get the encrypted_value, go to the credential page, click on update and after do inspect element on the password field. Take the "value" property of the field. It should be between curly braces.
To get ALL the credentials :
def creds = com.cloudbees.plugins.credentials.CredentialsProvider.lookupCredentials(
com.cloudbees.plugins.credentials.common.StandardUsernameCredentials.class,
Jenkins.instance,
null,