Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
# install needed curl package
sudo apt install --no-install-recommends curl -y
# install kubectl
# https://github.com/kubernetes/minikube/issues/3437#issuecomment-449408316, maybe use https://storage.googleapis.com/minikube/releases/v0.30.0/docker-machine-driver-kvm2
curl -Lo /tmp/kubectl https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl && \
chmod +x /tmp/kubectl && \
sudo mv /tmp/kubectl /usr/local/bin/kubectl
# kubectl tab completion
sudo sh -c 'echo "source <(kubectl completion bash)" > /etc/bash_completion.d/kubectl'
@7castle
7castle / mysql_dump.sh
Created February 12, 2020 02:19
mysqldump for replica
sudo mysqldump \
--databases <database_name> \
--master-data=2 \
--single-transaction \
--order-by-primary \
-r backup.sql \
-u <local_user> \
-p <password>
@7castle
7castle / sudo.md
Created September 12, 2019 02:16
sudo

Add user to wheel group usermod -aG wheel username

Add to sudoers groups:

## Uncomment to allow members of group wheel to execute any command
# %wheel ALL=(ALL) ALL

## Same thing without a password
%wheel ALL=(ALL) NOPASSWD: ALL
@7castle
7castle / swap.md
Created September 12, 2019 01:47
Swap on linux

Swap on Linux

Swap File

sudo fallocate -l 4G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
@7castle
7castle / Awesome k8s.md
Last active September 12, 2019 01:46
Awesome k8s

Kontena Pharos https://pharos.sh/docs/getting-started.html - The simple, solid, certified Kubernetes distribution that just works. Deploy and run containers at any scale on any infrastructure. All batteries included.

<pre>/etc/logrotate.conf</pre>
<p>And the configuration folder can be found:</p>
<pre>/etc/logrotate.d/</pre>
<p>The configuration folder is usually where you would add new log file configurations which are unique for a particular log file, or set of log files. For example, if you were to add a new log rotation action for the Ubuntu package manager <strong>apt</strong>, you may use something like below:</p>
<pre>vi /etc/logrotate.d/apt</pre>
<pre>/var/log/apt/term.log {
rotate 12
monthly
compress
missingok
@7castle
7castle / gist:a6dc3e40bc6302be7aa9d0ca6922c871
Created September 12, 2019 01:29
rclone install and mount
https://www.jamescoyle.net/how-to/3116-rclone-systemd-startup-mount-script
@7castle
7castle / update-aws-cli.sh
Created September 12, 2019 00:16
Update AWS cli
pip install --upgrade --user awscli
@7castle
7castle / Dockerfile
Created May 20, 2019 08:46 — forked from brendan-rius/Dockerfile
DeamonSet for setting inotify config in each nodein k8s
FROM alpine
COPY configure-node.sh configure-node.sh
CMD ["/bin/sh", "configure-node.sh"]