Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
IP=$1
# Run curl file.sh | sh to find the public ip address
if [ "$IP" = "" ]; then
echo "Your IP is: "
curl https://ipinfo.io/ip
else
# Run curl file.sh | sh -s "0.0.0.0" to find the info of ip address you inputted
// Returns an array of dates between the two dates
var getDates = function(startDate, endDate) {
var dates = [],
currentDate = startDate,
addDays = function(days) {
var date = new Date(this.valueOf());
date.setDate(date.getDate() + days);
return date;
};
while (currentDate <= endDate) {
@hieudang-agilityio
hieudang-agilityio / cleandocker.sh
Last active September 25, 2019 03:43
To clean all Docker containers, images and volumes
#!/bin/bash
# To clean all Docker containers, images and volumes
yes Y | docker rm -f $(docker ps -qa)
echo "docker rm -f $(docker ps -qa) was deleted!"
yes Y | docker rmi -f $(docker images -q)
echo "docker rmi -f $(docker images -q) was deleted!"
@hieudang-agilityio
hieudang-agilityio / cleanuprancher2x.sh
Last active September 25, 2019 03:58
When got this issue: This cluster is currently Provisioning; areas that interact directly with it will not be available until the API is ready. [controlPlane] Failed to bring up Control Plane: Failed to verify healthcheck: Service [kube-apiserver] is not healthy
#!/bin/sh
# When got this issue: This cluster is currently Provisioning; areas that interact directly with it will not be available until the API is ready. [controlPlane] Failed to bring up Control Plane: Failed to verify healthcheck: Service [kube-apiserver] is not healthy
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
#!/bin/sh
set -e
CHANNEL="stable"
docker_version=18.09.2
apt_url="https://apt.dockerproject.org"
yum_url="https://yum.dockerproject.org"
gpg_fingerprint="9DC858229FC7DD38854AE2D88D81803C0EBFCD88"
#!/bin/sh
set -e
#
# This script is meant for quick & easy install via:
# 'curl -sSL https://get.docker.com/ | sh'
# or:
# 'wget -qO- https://get.docker.com/ | sh'
#
# For test builds (ie. release candidates):
# 'curl -fsSL https://test.docker.com/ | sh'