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
View gist:858a7a67eacae1f2228c81cf60b3de65
import org.eclipse.jetty.http.HttpHeader;
import org.springframework.stereotype.Component;
public class XForwardedHeadersPreFilter extends ZuulFilter
jebeaudet / gist:6c3934bad750fde4d13572af56ee9618
Created May 30, 2017 12:35
Colored grep that highlight pattern
jebeaudet / gist:325fdb7ebe5bce621bde8da112f340e8
Created May 30, 2017 12:38
Live docker logs by attaching to the container
View gist:325fdb7ebe5bce621bde8da112f340e8
# 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 / gist:f433ccd80fdc235b0931d998dab2e08b
Created May 31, 2017 01:23
Rename directory and folders recursive windows powershell
View gist:f433ccd80fdc235b0931d998dab2e08b
Get-ChildItem -Recurse | Rename-Item -NewName { $ -replace "ô","o" -replace "é","e" -replace "è","e" -replace "à","a" -replace "À"."A" -replace "È","E" -replace "Î","I" -replace "î","i" }
View gist:60e158756eca7e0edb87a58562d73f7f
ffmpeg -i rtsp://192.168.XXX.XXX:554/unicast -b 900k -vcodec copy -r 60 -y MyVdeoFFmpeg.avi
jebeaudet / gist:d764cbb1df7e966120d10b20270b0981
Created August 17, 2017 17:06
Clean docker containers, images and volumes
View gist:d764cbb1df7e966120d10b20270b0981
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 / gist:b05c8b096e3fc28170e06fa1f5dbf60a
Created August 30, 2017 18:25
Change docker environment variables on an existing container
View gist:b05c8b096e3fc28170e06fa1f5dbf60a
stop docker service (`sudo service docker stop`)
edit the file located at `/var/lib/docker/containers/:containerId/config.v2.json`
restart docker service
jebeaudet / gist:15b874372d8d7b70be9a8a4ce7fd3a98
Created October 31, 2017 18:49
How to trace live requests coming to a server using ngrep
View gist:15b874372d8d7b70be9a8a4ce7fd3a98
ngrep -l -q -d eth0 -W byline -i "^GET|^POST|^HEAD|^DELETE|^PUT" tcp
jebeaudet / gist:25bddb4e36653cbba3f0c83b34eff414
Last active February 1, 2019 20:29
Dump java docker heap
View gist:25bddb4e36653cbba3f0c83b34eff414
# 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 /
Created January 14, 2020 19:00
Form resubmission bug in chrome
import http.server
import socketserver
PORT = 8000
auto_submit_html = """
<html xmlns="" xml:lang="en">
<body onload="document.forms[0].submit()">