This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################################################################### | |
# Protected links | |
# | |
# Protects against creating or following links under certain conditions | |
# Debian kernels have both set to 1 (restricted) | |
# See https://www.kernel.org/doc/Documentation/sysctl/fs.txt | |
#fs.protected_hardlinks=0 | |
#fs.protected_symlinks=0 | |
net.ipv4.ip_forward=1 | |
#net.ipv4.ip_local_reserved_ports=30000-32767 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global | |
localpeer haproxy-1 | |
defaults | |
timeout connect 5s | |
timeout client 1m | |
timeout server 1m | |
peers haproxy-peers |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
############################################################################## | |
# SHORTCUTS and HISTORY | |
############################################################################## | |
CTRL+A # move to beginning of line | |
CTRL+B # moves backward one character | |
CTRL+C # halts the current command | |
CTRL+D # deletes one character backward or logs out of current session, similar to exit | |
CTRL+E # moves to end of line |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
#Check the Drive Space Used by Cached Files | |
du -sh /var/cache/apt/archives | |
#Clean all the log file | |
#for logs in `find /var/log -type f`; do > $logs; done | |
logs=`find /var/log -type f` | |
for i in $logs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Ask for the user password | |
# Script only works if sudo caches the password for a few minutes | |
sudo true | |
# Install kernel extra's to enable docker aufs support | |
# sudo apt-get -y install linux-image-extra-$(uname -r) | |
# Add Docker PPA and install latest version | |
# sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9 | |
# sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
JDC_ORG_UNIT="" | |
JDC_ORG_ENV="" | |
JDC_DOMAIN_NAME=mydomain.com | |
JDC_AD_DC1_IP=192.168.240.11 | |
JDC_AD_DC2_IP=192.168.240.12 | |
JDC_AD_DC1_NAME=dc1-inf-ad-ds1.mydomain.com | |
JDC_AD_DC2_NAME=dc1-inf-ad-ds2.mydomain.com | |
JDC_HOST_NAME=$(hostname | awk -F'.' '{print $1}').$JDC_DOMAIN_NAME | |
JDC_GROUP_PREFIX="os" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo snap install yq | |
sudo cp /etc/netplan/00-installer-config.yaml /etc/netplan/00-installer-config.yaml.bk_`date +%Y%m%d%H%M` | |
cat /etc/netplan/00-installer-config.yaml | yq -e '.network.ethernets.ens160.nameservers.addresses[0]="192.168.10.11" | .network.ethernets.ens160.nameservers.addresses[1]="192.168.10.12"' | sudo tee /etc/netplan/00-installer-config.yaml | |
sudo netplan apply |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# vi /etc/systemd/system/docker_limit.slice | |
[Unit] | |
Description=Slice that limits docker resources | |
Before=slices.target | |
[Slice] | |
CPUAccounting=true | |
CPUQuota=700% | |
# Memory Management |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
============================ | |
Create XFS Volume | |
============================ | |
sudo apt-get install xfsprogs xfsdump | |
sudo wipefs -a /dev/sdb | |
sudo fdisk /dev/sdb # g -> n -> p -> 1 -> w | |
sudo pvcreate /dev/sdb1 | |
sudo vgcreate data-vg /dev/sdb1 | |
sudo lvcreate -l 100%FREE -n data-lv data-vg |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Dump all secrets from all namespaces and store them in seprate yaml file: | |
kubectl get secret -A -o custom-columns=:.metadata.name,:.metadata.namespace --no-headers | \ | |
xargs -n 2 sh -c '(kubectl get secret -n $3 -o yaml $2; echo "---") >> $3-$2.yaml' -- {} | |
. |