Skip to content

Instantly share code, notes, and snippets.

@duypm
duypm / RequestMappingLogger.java
Created April 23, 2019 09:59
Spring - Logging all request mappings
@Component
public class RequestMappingLogger implements ApplicationListener<ContextRefreshedEvent> {
public static final Logger logger = LoggerFactory.getLogger(RequestMappingLogger.class);
@Override
public void onApplicationEvent(ContextRefreshedEvent event) {
RequestMappingHandlerMapping requestMappingHandlerMapping = event.getApplicationContext().getBean(RequestMappingHandlerMapping.class);
for (Map.Entry<RequestMappingInfo, HandlerMethod> entry: requestMappingHandlerMapping.getHandlerMethods().entrySet()) {
Method handler = entry.getValue().getMethod();
for (String pattern : entry.getKey().getPatternsCondition().getPatterns()) {
@duypm
duypm / f5_xfp.txt
Last active May 31, 2018 14:32 — forked from dwallraff/f5_xfp.txt
F5 config - X-Forward-Proto (XFP)
Recommended solution would be:
- Use Insert header, in the custom HTTP profile that you applied to the virtual servers.
For HTTPS Virtuals, insert: X-Forwarded-Proto, with a value of https
For HTTP Virtuals, insert: X-Forwarded-Proto, with a value of http
Of course you could also use apply an iRule to the Virtual Server, something like this should work:
when HTTP_REQUEST {
if { [SSL::mode] == 1 } {
#!/bin/bash
set -ex
google-chrome --version
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
sudo apt-get update
sudo apt-get --only-upgrade install google-chrome-stable
google-chrome --version
@duypm
duypm / mongoDB.md
Created October 3, 2017 16:59 — forked from federico-garcia/mongoDB.md
MongoDB guide

Running mongodb

docker run -d -v $(pwd)/data/single:/data/db -v $(pwd)/config/single/mongod.conf:/etc/mongod.conf -p 27017:27017 --name mongo-server mongo:3.4 mongod -f /etc/mongod.conf

mongod - the server itself
mongo - mongodb cli (you can run js scripts)

default data directory: /data/db default DB: test default port: 27017 (config parameter net:port anf net:bindIp)

@duypm
duypm / docker-cleanup-resources.md
Created May 5, 2017 04:04 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm