Skip to content

Instantly share code, notes, and snippets.

View TheBoroer's full-sized avatar

Boro Vukovic TheBoroer

View GitHub Profile
#!/bin/sh
#/ Usage: btsync-secret [option]...
#/ A Bittorrent Sync Secret Generator
set -e
h_flag=false
v_flag=false
e_flag=false
n_flag=false
c_flag=false
@TheBoroer
TheBoroer / dnsbl.sh
Created June 25, 2018 14:29 — forked from agarzon/dnsbl.sh
DNS Black List - Linux shell script (improved from: http://www.daemonforums.org/showthread.php?t=302)
#!/bin/sh
# Check if an IP address is listed on one of the following blacklists
# The format is chosen to make it easy to add or delete
# The shell will strip multiple whitespace
BLISTS="
bl.score.senderscore.com
bl.mailspike.net
bl.spameatingmonkey.net
b.barracudacentral.org
@TheBoroer
TheBoroer / ubuntu-vmware-template-prep.sh
Created November 24, 2021 04:06
script to prep a Ubuntu 18.04 or 20.04 fresh install to create a VMware template
# Update your OS packages:
sudo apt-get update
sudo apt-get upgrade -y
# Prevent cloudconfig from preserving the original hostname and reset the hostname:
sudo sed -i 's/preserve_hostname: false/preserve_hostname: true/g' /etc/cloud/cloud.cfg
sudo truncate -s0 /etc/hostname
sudo hostnamectl set-hostname localhost
# Remove the current network configuration:
@TheBoroer
TheBoroer / mac-dev-env-setup.sh
Last active January 10, 2024 18:48
Script to setup a general dev environment on a new mac
# WORK IN PROGRESS
brew update
# Install NVM
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash
# To setup auto 'nvm use' follow instructions for zsh or bash here:
# https://github.com/nvm-sh/nvm#deeper-shell-integration
# Install yarn
npm install --global yarn
@TheBoroer
TheBoroer / README.md
Last active November 17, 2024 16:31
FusionIO / Fusion-IO devices on TrueNAS SCALE 22.02.1

FusionIO / Fusion-IO devices on TrueNAS SCALE 22.02.1

There's a bug with v22.02.2 where it doesnt show fusionio disks at all under Storage > Disks. So I had to downgrade to 22.02.1 and it works fine.

This gist is basically a note-to-self so future me can remember what I did to get this working on my truenas server haha, but I hope it helps someone else out too :)

I wanted to use my iodrive duo (2 fusion devices on 1 card) as a mirrored SLOG on an existing raid2z pool.

Links to repos used:

@TheBoroer
TheBoroer / commands.sh
Created July 1, 2022 04:33
rsync commands to sync sparse files (vmware thin provisioned vmdk) via SSH
# Update existing sparse files inplace (edit file instead of creating a new file).
rsync -v -z -r --existing --inplace --progress -e ssh /source/path user@host:/destination/path/
# Then sync new sparse files (ignoring existing files we previously updated)
rsync -v -z -r --ignore-existing --sparse --progress -e ssh /source/path user@host:/destination/path/
@TheBoroer
TheBoroer / README.md
Created March 25, 2023 05:22
Workaround for docker container issues on Ubuntu 22.04

This started happening with docker v20.10 on ubuntu 22.04. Specifically I had errors like these pop up when trying to run the rancher/agent (for rancher/server v1.6.30):

time="2021-06-29T09:13:28Z" level=fatal msg="Failed to find container id:\n0::/\n" 

Seems to be caused by cgroups v2

To make it work again run: echo 'GRUB_CMDLINE_LINUX=systemd.unified_cgroup_hierarchy=false' > /etc/default/grub.d/cgroup.cfg

@TheBoroer
TheBoroer / README.md
Last active November 26, 2023 05:07
TrueNas SCALE 22.xx: make drive bay LEDs light up when perc is in IT mode (raid disabled and disks managed by OS) on Dell r720XD storage server

UPDATE: doesn't seem like it's possible... truenas/sg_ses doesn't see the enclosure at all when the card is in IT mode. :(

install the sg3-utils package

I installed it via the deb file so that I don't have to mess with restricted apt permissions truenas comes with.

To download: wget http://ftp.de.debian.org/debian/pool/main/s/sg3-utils/sg3-utils_1.45-1_amd64.deb

To install: dpkg -i sg3-utils_1.45-1_amd64.deb

@TheBoroer
TheBoroer / postgres user management.sql
Last active June 23, 2024 04:51
Postgres: create db, create user, add user to db
CREATE database database_name_here;
CREATE user username_here with encrypted password 'password_here';
GRANT ALL privileges on database database_name_here to username_here;