Skip to content

Instantly share code, notes, and snippets.

View coolpalani's full-sized avatar

coolpalani

View GitHub Profile
@coolpalani
coolpalani / extended-cleanup-rancher2.sh
Last active August 13, 2020 16:33 — forked from superseb/extended-cleanup-rancher2.sh
Extended Rancher 2 cleanup (backup your data, use at your own risk)
#!/bin/sh
# Backup your data
# Use at your own risk
# Usage ./extended-cleanup-rancher2.sh
# Include clearing all iptables: ./extended-cleanup-rancher2.sh flush
docker rm -f $(docker ps -qa)
docker rmi -f $(docker images -q)
docker volume rm $(docker volume ls -q)
for mount in $(mount | grep tmpfs | grep '/var/lib/kubelet' | awk '{ print $3 }') /var/lib/kubelet /var/lib/rancher; do umount $mount; done
cleanupdirs="/etc/ceph /etc/cni /etc/kubernetes /opt/cni /opt/rke /run/secrets/kubernetes.io /run/calico /run/flannel /var/lib/calico /var/lib/etcd /var/lib/cni /var/lib/kubelet /var/lib/rancher/rke/log /var/log/containers /var/log/pods /var/run/calico"
@coolpalani
coolpalani / port_forward_ipv4_ipv6.sh
Created October 7, 2019 22:45 — forked from dmazzer/port_forward_ipv4_ipv6.sh
Forwarding IPv4 Ports to IPv6 Hosts
#!/bin/bash
# UDP:
socat UDP4-LISTEN:5683,fork,su=nobody UDP6:[aaaa::212:4b00:615:a1f7]:5683
# TCP:
socat TCP4-LISTEN:22,fork,su=nobody TCP6:[2a01:198:79d:1::8]:22
# UDP, IPv6
socat UDP6-LISTEN:5683,fork,su=nobody UDP6:[aaaa::212:4b00:615:a1f7]:5683
@coolpalani
coolpalani / Jenkinsfile.groovy
Created September 10, 2019 16:20 — forked from aerobless/Jenkinsfile.groovy
An example Jenkinsfile for a build pipeline using gradle, junit, selenium, checkstyle
pipeline {
agent {
label 'agentId' //The id of the slave/agent where the build should be executed, if it doesn't matter use "agent any" instead.
}
triggers {
cron('H */8 * * *') //regular builds
pollSCM('* * * * *') //polling for changes, here once a minute
}
pipeline {
agent {
node {
label 'master'
}
}
stages {
stage('android') {
steps {
pipeline {
agent {
node {
label 'master'
}
}
stages {
stage('android') {
steps {
#!/bin/sh
#
# This script deploys the given manifest,
# tracks the deployment, and rolls back on failure.
#
# First execute this with "myapp.yaml" and then try it with "myapp.failing.yaml"
#
MANIFEST_PATH=$1
DEPLOYMENT_NAME=myapp
@coolpalani
coolpalani / haproxy-www.tf
Created March 20, 2018 02:36 — forked from mvasilenko/haproxy-www.tf
How To Use Terraform with DigitalOcean
resource "digitalocean_droplet" "haproxy-www" {
image = "ubuntu-14-04-x64"
name = "haproxy-www"
region = "nyc2"
size = "512mb"
private_networking = true
ssh_keys = [
"${var.ssh_fingerprint}"
]
connection {
@coolpalani
coolpalani / docker-destroy-all.sh
Created February 21, 2018 15:53 — forked from JeffBelback/docker-destroy-all.sh
Destroy all Docker Containers and Images
#!/bin/bash
# Stop all containers
docker stop $(docker ps -a -q)
# Delete all containers
docker rm $(docker ps -a -q)
# Delete all images
docker rmi $(docker images -q)
@coolpalani
coolpalani / vagrant-kvm.md
Created January 26, 2018 11:46 — forked from yuanying/vagrant-kvm.md
How to use vagrant-kvm

Install Vagrant

sudo su
apt-get update && apt-get install -y libvirt-dev ruby-all-dev apparmor-utils
curl -O -L https://dl.bintray.com/mitchellh/vagrant/vagrant_1.6.5_x86_64.deb
dpkg -i vagrant_1.6.5_x86_64.deb 
aa-complain /usr/lib/libvirt/virt-aa-helper # workaround
exit

Install vagrant-kvm as user

@coolpalani
coolpalani / setup-ip.yml
Created November 29, 2017 18:37 — forked from glennswest/setup-ip.yml
Ansible automatically create /etc/hosts file for all host - to give nice short names using dnsmasq
---
- hosts: all
tasks: []
- hosts: all
gather_facts: True
tasks:
- name: check connection
ping:
- name: setup
setup: