Skip to content

Instantly share code, notes, and snippets.

@v-thomp4
v-thomp4 / gist:866055d0d5e825e087bcc869c18d00ad
Last active November 28, 2018 03:51
rancher-k8s: Path /var/lib/docker is mounted on / but it is not a shared or slave mount
Fix: mount --make-rshared /
ufw default deny incoming
ufw default allow outgoing
ufw allow ssh
ufw enable
@v-thomp4
v-thomp4 / keep-alive.md
Created October 30, 2018 09:55
enable keep-alive haproxy
defaults  
	...
	option httpclose  

became

defaults  
	...
	timeout client 5000 
@v-thomp4
v-thomp4 / gist:28d1e6e547b8e6dfd1ea2e09bc8fab65
Created October 22, 2018 14:23
grafana: Migration from a previous version of the docker container to 5.1 or later
chown -R 472:472 /var/lib/grafana
@v-thomp4
v-thomp4 / gist:7f1784a04435d09a300164986ec49b16
Created October 15, 2018 09:31
Docker: Error initializing network controller: list bridge addresses failed: no available network
ip link add name docker0 type bridge
ip addr add dev docker0 172.17.0.1/16
@v-thomp4
v-thomp4 / clean-up-boot-partition-ubuntu.md
Created October 2, 2018 17:17 — forked from ipbastola/clean-up-boot-partition-ubuntu.md
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64

Reference

Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r 
@v-thomp4
v-thomp4 / gist:62772d70ae4702deebd8253fe1eeb6fd
Created September 12, 2018 07:26
CLEAN UP WHISPER DATABASE
1. Delete old metrics of ours that haven't been written to for over 90 days
# just to satisfy my curiosity: how much disk space I will gain
find /data/db/whisper/ -name "*wsp" -mtime +90 -exec echo -n -e {}"\0" \; | du -hc --files0-from=-
# delete the files!
find /data/db/whisper/ -type f -mtime +90 -name "*wsp" -exec rm '{}' \;
2. Delete empty directories
# how many do we have?
find /data/db/whisper/ -type d -empty | wc -l
# remove them!
find /data/db/whisper/ -type d -empty -delete
@v-thomp4
v-thomp4 / docker-cleanup-resources.md
Created September 6, 2018 04:38 — 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

@v-thomp4
v-thomp4 / gist:c8d58f531ac021f4dee721488ad41bed
Created August 15, 2018 16:37
configmap file kubernetes
containers:
- volumeMounts:
- name: demo-config
mountPath: /app/settings.json
subPath: settings.json
volumes:
- name: demo-config
configMap:
name: demo
@v-thomp4
v-thomp4 / gist:4f90fe0ec906d9607f605da4c3bd05f7
Created July 4, 2018 10:58
Fix Rocketchat Your database migration failed
ERROR! SERVER STOPPED
our database migration failed:
Database locked at version: 124
Fix:
use rocketchat
db.migrations.update({_id: 'control'},{$set:{locked:false,version:125}})