Skip to content

Instantly share code, notes, and snippets.

@amircloner
amircloner / k8s-prepare-node.sh
Created August 27, 2024 09:38 — forked from hossainemruz/k8s-prepare-node.sh
Bash script to automatically install and configure container runtime, cni plugins etc
#!/bin/bash
set -eou pipefail
#========== Step 1: Disable Swap ============
echo "Disabling Swap......."
sudo swapoff -a
sudo sed -i '/^[^#]/ s/\(^.*swap.*$\)/#\1/' /etc/fstab
free -h
echo ""
#!/bin/bash
# Function to prompt for MySQL details
prompt_mysql_details() {
read -p "Enter MySQL database name: " DBNAME
read -p "Enter MySQL username: " DBUSER
read -sp "Enter MySQL password: " DBPASS
echo
}
@amircloner
amircloner / install.sh
Last active June 4, 2023 08:51
install golang linux
#!/bin/bash
#curl -sSL https://gist.github.com/amircloner/de8185e49d2789735c346556e7f8d203/raw | bash
wget -c https://go.dev/dl/go1.20.4.linux-amd64.tar.gz
shasum -a 256 go1.7.3.linux-amd64.tar.gz
sudo tar -C /usr/local -xvzf go1.20.4.linux-amd64.tar.gz
echo "export PATH=$PATH:/usr/local/go/bin" >> $HOME/.profile
source $HOME/.profile
go version
#!/usr/bin/env bash
# Download Xray latest
RELEASE_TAG="latest"
if [[ "$1" ]]; then
RELEASE_TAG="$1"
fi
#!/bin/bash
#curl -sSL https://gist.github.com/amircloner/ab822b0105fa3ee5d47ae48019e9af8f/raw | bash
apt-get -y update
sudo apt-get -y remove docker docker-engine docker.io containerd runc
sudo apt-get -y update
sudo apt-get -y install \
apt-transport-https \
ca-certificates \
curl \
# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
version: 2
renderer: networkd
ethernets:
eno1:
accept-ra: true
addresses: [ 185.21.60.70/24, 185.21.60.83/24, 185.21.60.84/24, 185.21.60.85/24, 185.21.60.86/24, 185.21.60.88/24 ]
gateway4: 185.21.60.1
db.orders.aggregate([
{
$group: {
// collect ids of the documents, that have same emrooz_idue
// for a given key ('emrooz_id' prop in this case)
_id: '$emrooz_id',
ids: {
$push: '$_id'
},
// count N of duplications per key
#!/bin/bash
# sudo bash -c "$(wget -qO- https://gist.github.com/amircloner/61b8b37fabf92339929c8430f2314f62/raw)"
# mkdir /captain/
# cp backup.tar
apt-get -y update
sudo apt-get -y remove docker docker-engine docker.io containerd runc
sudo apt-get -y update
sudo apt-get -y install \
#!/bin/bash
#curl -sSL https://gist.github.com/amircloner/7434a538c880cb3a49f0e7ea4a2ec14f/raw | bash
apt-get -y update
sudo apt-get -y remove docker docker-engine docker.io containerd runc
sudo apt-get -y update
sudo apt-get -y install \
apt-transport-https \
ca-certificates \
#!/bin/bash
# sudo bash -c "$(wget -qO- https://gist.github.com/amircloner/586d79c0abc64d7c3fd12f3e619af249/raw)"
apt-get -y update
sudo apt-get -y remove docker docker-engine docker.io containerd runc
sudo apt-get -y update
sudo apt-get -y install \
apt-transport-https \
ca-certificates \
curl \