Skip to content

Instantly share code, notes, and snippets.

View coolpalani's full-sized avatar

coolpalani

View GitHub Profile
@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 {
#!/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
pipeline {
agent {
node {
label 'master'
}
}
stages {
stage('android') {
steps {
pipeline {
agent {
node {
label 'master'
}
}
stages {
stage('android') {
steps {
@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
}
@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 / 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"