Skip to content

Instantly share code, notes, and snippets.

View pfrayer's full-sized avatar

Pierre pfrayer

  • OVHcloud
  • Lyon, France
View GitHub Profile
@pfrayer
pfrayer / gist:c0ae044bc1e655919fe06cded411b88d
Created October 20, 2022 08:05
Run dockerized Ghost 5 blog using SQLite
docker run -d \
--name ghost-5 \
--restart always \
-p 127.0.0.1:XXX:2368 \
-e url=https://blog.foo.bar/ \
-e database__client=sqlite3 \
-e database__connection__filename="content/data/ghost.db" \
-e database__useNullAsDefault=true \
-e database__debug=false \
-v /my/blog/data:/var/lib/ghost/content \
# With curl you'll have to parse the versions by yourself, and get fucked:
$ curl -s https://download.docker.com/linux/ubuntu/dists/bionic/stable/binary-amd64/Packages | grep -A2 -E "Package: docker-ce" | grep Version | awk -F 'Version:' '{print $2}' | sort -Vr | head -n 10
18.06.3~ce~3-0~ubuntu
18.06.2~ce~3-0~ubuntu
18.06.1~ce~3-0~ubuntu
18.06.0~ce~3-0~ubuntu
18.03.1~ce~3-0~ubuntu
5:20.10.10~3-0~ubuntu-bionic
5:20.10.10~3-0~ubuntu-bionic
5:20.10.10~3-0~ubuntu-bionic
# Docker Machine for Consul
docker-machine \
create \
-d virtualbox \
consul-machine
# Start Consul
docker $(docker-machine config consul-machine) run -d --restart=always \
-p "8500:8500" \
-h "consul" \
version: '2'
services:
web:
build: .
image: java-jersey-image
container_name: app-pierre
ports:
- 8080
links:
- database
@pfrayer
pfrayer / gist:5c35d13e3f5f0fa3936f
Created January 7, 2015 09:29
Get all loaded beans in Seam 2
public void test(){
Context context = Contexts.getApplicationContext();
for (String name: context.getNames()) {
Object object = context.get(name);
if(object instanceof org.jboss.seam.Component) {
Component component = (Component) object;
if(component.isStartup()){
System.out.println(component.getName()+"-"+component.getType()+"-"+component.getScope()+"-"+component.getTimeout()+"-"+component.isStartup()+"-"+component.isSynchronize());
}
}
@pfrayer
pfrayer / gist:10873142
Created April 16, 2014 13:16
J'adore les frites
public class LesFrites {
public LesFrites(){
this.lesFrites = caMeRend.tropHeureux(quandJenMange());
}
}