Skip to content

Instantly share code, notes, and snippets.

@nhthai2005
nhthai2005 / install_zsh_all_in_one.md
Last active April 12, 2024 12:42
How to install Zsh, Oh-my-zsh, powerlevel10k and zsh plugins on Ubuntu

Howto install Zsh, Oh-my-zsh, powerlevel10k and zsh plugins on Ubuntu

Install zsh

sudo apt install zsh -y

Install Oh-my-zsh

sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

Download and install necessary fonts

To install Docker on Debian as root:
1) apt-get update
2) apt-get install ca-certificates curl gnupg lsb-release
3) curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
4) echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian \
$(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
5) apt-get update
6) apt-get install docker-ce docker-ce-cli containerd.io
@austinjdean
austinjdean / monitor-vhserver.sh
Created March 24, 2021 01:15
Simple shell script for sending Valheim server alerts to Discord
#/bin/bash
# your webhook here
webhookURL="https://discord.com/api/webhooks/123412341234/ldsakjflsadsdkjfdslfkjdslfkj"
main() {
poll_log
echo "$newLog" > /tmp/currentLog
rm -f /tmp/newLog
@azhang
azhang / pxe_on_opnsense.md
Last active January 1, 2024 11:45
PXE on OPNsense

This is a walkthrough of setting up a PXE server to boot Ubuntu server live install .iso over network, all on an OPNsense device. No need for Dnsmasq or http/nfs server! Should be compatible with vanilla FreeBSD and HardenedBSD devices as well.

Guide made with OPNsense 20.7 and Ubuntu 20.04.2, with the assumption that your OPNsense device is at 192.168.1.1.

Thanks to all the other guides out there. 1 2

Notes:

A couple issues I ran into with other guides is that Ubuntu's servers return 404 for older releases. Make sure to check each link used in this guide to make sure they exist! This guide works with BIOS as we use pxelinux.0 but it can be adapted fairly easily for UEFI boot.

Overview:

@fworks
fworks / install-zsh-windows-git-bash.md
Last active April 19, 2024 19:52
Zsh / Oh-my-zsh on Windows Git Bash
@mrpeardotnet
mrpeardotnet / PVE-host-backup.md
Created December 17, 2019 18:03
Proxmox PVE Host Config Backup Script

Proxmox PVE Host Config Backup Script

This script can be used to backup essential configuration files from the Proxmox Virtual Enivronment (PVE) host.

The script will create backups using tar with specified backup prefix and date and time stamp in the file name. Script will also delete backups that are older then number of days specified.

Create backup script file

To create backup script that will be executed every day we can create backup script in /etc/cron.daily/ folder. We need to make it writeable by root (creator) only, but readable and executable by everyone:

touch /etc/cron.daily/pvehost-backup

This is a work in progress, proceed with caution

Install Proxmox and a Ubuntu VM with Portainer to manage docker containers

Setup Proxmox

  1. Install Proxmox 6.X iso I selected 2 drives in Raid 1 mirror
  2. Console/SSH into Proxmox
  3. nano /etc/apt/sources.list
@inexorabletash
inexorabletash / ansi_colors
Created February 20, 2014 20:30
Bash color utilities
#!/usr/bin/env bash
# Usage:
# echo -e "... $(text-style style ...) ..."
# echo -e "... $(text-reset) ..."
# echo -e "... $(text-color r g b) ..."
# echo -e "... $(background-color r g b) ..."
#
# Where:
# styles: