Skip to content

Instantly share code, notes, and snippets.

@plunix
plunix / cleanup.sh
Created October 24, 2018 13:04 — forked from superseb/cleanup.sh
Cleanup host added as custom to Rancher 2.0
#!/bin/sh
docker rm -f $(docker ps -qa)
docker volume rm $(docker volume ls -q)
cleanupdirs="/var/lib/etcd /etc/kubernetes /etc/cni /opt/cni /var/lib/cni /var/run/calico /opt/rke"
for dir in $cleanupdirs; do
echo "Removing $dir"
rm -rf $dir
done
@plunix
plunix / mount.sh
Created May 29, 2019 12:45 — forked from nataz77/mount.sh
GlusterFS Clients mount
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
dpkg -s glusterfs-client &> /dev/null
if [ $? -ne 0 ]
then
echo "GlusterFS is not installed; proceeding to install"
apt update
# Cluster management tools.
# See https://github.com/grampelberg/k8s-clusters for updates and documentation.
export CLUSTER_NAME ?= $(shell cat tmp/current 2>/dev/null || echo $$(whoami)-dev)
export MACHINE_TYPE ?= n1-standard-2
export DISK_SIZE ?= 100
export MAX_NODES ?= 10
export NETWORK ?= dev
export PROJECT ?= foobar
export VERSION ?= latest
@plunix
plunix / nginx_deployment.yaml
Created December 13, 2019 17:07 — forked from petitviolet/nginx_deployment.yaml
sample Nginx configuration on Kubernetes using ConfigMap to configure nginx.
apiVersion: v1
kind: ConfigMap
metadata:
name: nginx-conf
data:
nginx.conf: |
user nginx;
worker_processes 3;
error_log /var/log/nginx/error.log;
events {
@plunix
plunix / mysql-docker.sh
Created December 17, 2019 09:49 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@plunix
plunix / dump-restore
Created December 30, 2019 11:41 — forked from ricjcosme/dump-restore
DUMP / RESTORE PostgreSQL Kubernetes
DUMP
// pod-name name of the postgres pod
// postgres-user database user that is able to access the database
// database-name name of the database
kubectl exec [pod-name] -- bash -c "pg_dump -U [postgres-user] [database-name]" > database.sql
RESTORE
// pod-name name of the postgres pod
// postgres-user database user that is able to access the database
// database-name name of the database
@plunix
plunix / docker.sh
Created January 2, 2020 20:34 — forked from crosbymichael/docker.sh
Docker v2 PoC Run
> docker run --rm -t -i --logger d2-syslog --profile privileged --net d2 --net b2 alpine ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
3: eth0@if28: <BROADCAST,MULTICAST,UP,LOWER_UP,M-DOWN> mtu 1500 qdisc noqueue state UP
link/ether b2:da:6d:61:18:56 brd ff:ff:ff:ff:ff:ff
inet 10.10.0.52/24 brd 10.10.0.255 scope global eth0
@plunix
plunix / world-10m.geojson
Created January 24, 2020 10:07 — forked from davidejmancino/world-10m.geojson
Confini delle nazioni a livello globale. I nomi di alcuni paesi sono stati tradotti in Italiano
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
We can't make this file beautiful and searchable because it's too large.
ID,Comune,Classe di priorità,Fonte,Area di riferimento
1,Acciano,Alto,"Ministero dell'Ambiente, mappatura amianto 2013",Abruzzo
2,Acciano,Basso,"Ministero dell'Ambiente, mappatura amianto 2013",Abruzzo
3,Aielli,Alto,"Ministero dell'Ambiente, mappatura amianto 2013",Abruzzo
4,Aielli,Alto,"Ministero dell'Ambiente, mappatura amianto 2013",Abruzzo
5,Aielli,Alto,"Ministero dell'Ambiente, mappatura amianto 2013",Abruzzo
6,Aielli,Alto,"Ministero dell'Ambiente, mappatura amianto 2013",Abruzzo
7,Alfedena,Alto,"Ministero dell'Ambiente, mappatura amianto 2013",Abruzzo
8,Anversa Degli Abruzzi,Alto,"Ministero dell'Ambiente, mappatura amianto 2013",Abruzzo
@plunix
plunix / province.geojson
Created January 24, 2020 10:08 — forked from davidejmancino/province.geojson
Confini amministrativi delle province italiane
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.