Skip to content

Instantly share code, notes, and snippets.

@febri4n
febri4n / i3-gaps.sh
Created July 26, 2019 06:39 — forked from dabroder/i3-gaps.sh
Install i3-gaps on ubuntu 18.04
#!/bin/bash
sudo apt install -y libxcb1-dev libxcb-keysyms1-dev libpango1.0-dev libxcb-util0-dev libxcb-icccm4-dev libyajl-dev libstartup-notification0-dev libxcb-randr0-dev libev-dev libxcb-cursor-dev libxcb-xinerama0-dev libxcb-xkb-dev libxkbcommon-dev libxkbcommon-x11-dev autoconf libxcb-xrm0 libxcb-xrm-dev automake
cd /tmp
# clone the repository
git clone https://www.github.com/Airblader/i3 i3-gaps
cd i3-gaps
# compile & install

Hello, World

I am Linux Enthusiast & DevOps WannaBe

@febri4n
febri4n / exgrenex.md
Last active June 7, 2020 07:23
Buat CRUD Node.js langkah demi langkah dengan Express.js, PostgreSQL, Knex.js & deploy ke Heroku

Node.js Express JSON API - CRUD Stickers

We'll be using:

  • Postgres for our database

  • knex.js for our database migrations, seeds and queries.

  • express.js for our JSON routes

  • Mocha, Chai and SuperTest to test our routes

  • Prerequisites (Mac OS Commands)

  • Latest version of Node.js

@febri4n
febri4n / Knex-Migrations-Seeding.md
Created June 7, 2020 15:51 — forked from NigelEarle/Knex-Migrations-Seeding.md
Migration and seeding instructions using Knex.js!

Migrations & Seeding

What are migrations??

Migrations are a way to make database changes or updates, like creating or dropping tables, as well as updating a table with new columns with constraints via generated scripts. We can build these scripts via the command line using knex command line tool.

To learn more about migrations, check out this article on the different types of database migrations!

Creating/Dropping Tables

We couldn’t find that file to show.
#!/bin/bash
# Step 1
sudo apt install -y apt-transport-https ca-certificates curl software-properties-common
# Step 2
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
# Step 3
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
@febri4n
febri4n / gist:776ddab3ef05f5f2df391e2d92aafcc9
Last active March 27, 2024 04:31
install-kube-repo-baru
#!/bin/bash
cat <<EOF | sudo tee /etc/modules-load.d/k8s.conf
overlay
br_netfilter
EOF
sudo modprobe overlay
sudo modprobe br_netfilter
#!/bin/bash
# Step 1
curl -LO https://dl.k8s.io/release/`curl -LS https://dl.k8s.io/release/stable.txt`/bin/linux/amd64/kubectl
# Step 2
chmod +x ./kubectl
# Step 3
sudo mv ./kubectl /usr/local/bin/kubectl
@febri4n
febri4n / gist:372587274fbd2a8d9b83b2d46e311594
Created April 1, 2024 16:25
clean up rancher in instance
#!/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"
@febri4n
febri4n / certbot-systemd-ubuntu.md
Created May 15, 2024 06:51 — forked from dbirks/certbot-systemd-ubuntu.md
Certbot renew with a systemd timer on Ubuntu

Ubuntu 16.04

/etc/systemd/system/certbot.service

[Unit]
Description=Let's Encrypt renewal

[Service]
Type=oneshot
ExecStart=/usr/bin/certbot renew --quiet --agree-tos