Skip to content

Instantly share code, notes, and snippets.

View ravnoor's full-sized avatar

Ravnoor Singh Gill ravnoor

View GitHub Profile
@ravnoor
ravnoor / extract_email_txt_grep.sh
Created April 10, 2019 18:25
extract email addresses from a text file
grep -E -o "\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6}\b" list-emails.txt | sort | tr '[:upper:]' '[:lower:]' | uniq > emails-extracted.txt
@ravnoor
ravnoor / unraid_proftpd_sftp.sh
Last active January 14, 2023 19:26
unraid_proftpd_sftp.sh
# https://forums.unraid.net/topic/24356-proftpd-plugin-for-unraid-v68x/?do=findComment&comment=559588
# To enable sftp:
# open a shell on your unraid server and issue the following commands
cd /etc/ssh
ssh-keygen
# Enter the name of the keyfile (sftp_rsa_key) and no passphrase.
# You will get two files sftp_rsa_key and sftp_rsa_key.pub. The public
# key needs to be converted to another format to make it usable by
@ravnoor
ravnoor / smb.conf
Created August 11, 2020 14:55
configuring sonos controller with OMV NAS (SMB v1)
# Add the last line either to /etc/samba/smb.conf or
# On the webUI, find Services > SMB/CIFS > Settings > Advanced Settings > Extra Options - add the last line here instead
# Extra options
# https://en.community.sonos.com/advanced-setups-229000/sonos-and-smb-cifs-share-on-openmediavault-6821974
ntlm auth = yes
@ravnoor
ravnoor / pcat-install.sh
Created September 7, 2020 03:40 — forked from BretFisher/pcat-install.sh
On macOS: Install pygmentize and alias pcat for shell code syntax highlighting
# first install pygmentize to the mac OS X or macOS system with the built-in python
sudo easy_install Pygments
# then add alias to your ~/.bash_profile or ~/.bashrc or ~/.zshrc etc.
alias pcat='pygmentize -f terminal256 -O style=native -g'
@ravnoor
ravnoor / zerotier-rpi-bridge.md
Created November 23, 2020 22:17 — forked from laduke/zerotier-rpi-bridge.md
Various Network Configuration Output

Motivation

Use a Raspberry Pi as a bridge into my home LAN. The pi is plugged into a switch, which is plugged into an airport express, which is plugged into a cable modem; Nothing fancy.

This isn't a tutorial. Just some example output from a working setup.

steps

off the top of my head, here's the order I would do it in:

  • make sure plain old device to device zerotier is working with my LAN/Router/Firewall/ISP
@ravnoor
ravnoor / adding-tailscale-to-edgerouter.md
Last active January 13, 2025 12:26 — forked from lg/adding-tailscale-to-edgerouter.md
Add tailscale to an EdgeRouter X and surviving system upgrade

Adding tailscale to an EdgeRouter X (and surviving system upgrades)

I suggest you run sudo bash on all of these so you're the root user.

Installing

  1. Download tailscale and put the files in /config/. Find the latest stable or unstable version for your EdgeRouter's processor (ex. ER4 is mips and ERX is mipsle)
VERSION=1.28.0 # https://pkgs.tailscale.com/stable/#static
@ravnoor
ravnoor / duckdns-ipv6-updater-jq.sh
Created September 5, 2022 17:41
Update dynamic ipv4 and ipv6 address on duckdns.org
DUCKDNS_TOKEN=ffc3496761593d061e9cb57525855266
IPV4=$(ip -json address list eth0 | jq -r '.[0].addr_info[] | select(.family=="inet" and .scope=="global") | .local')
IPV6=$(ip -json address list eth0 | jq -r '.[0].addr_info[] | select(.family=="inet6" and .scope=="global") | .local')
# echo ${IPV4}
# echo ${IPV6}
echo url="https://www.duckdns.org/update?domains=precision&token=${DUCKDNS_TOKEN}&ip=${IPV4}&ipv6=${IPV6}&verbose=true" | curl -k -o /root/infra/duckdns/duck.log -K -
{
"meta": {
"theme": "spartan"
},
"basics": {
"name": "Thomas Davis",
"label": "Web Developer",
"image": "https://avatars0.githubusercontent.com/u/416209?s=460&u=38f220a2c9c658141804f881c334c594eb1642ac&v=4",
"summary": "I’m a full stack web developer who can build apps from the ground up. I've worked mostly at startups so I am use to wearing many hats. I am a very product focussed developer who priotizes user feedback first and foremost. I'm generally very flexible when investigating new roles. ",
"website": "https://lordajax.com",
@ravnoor
ravnoor / 01-netcfg.yaml
Created September 22, 2023 18:55 — forked from nkabir/01-netcfg.yaml
libguestfs examples
# may be templated in the future
network:
version: 2
renderer: networkd
ethernets:
eth0:
dhcp4: true
optional: true
@ravnoor
ravnoor / proxmox.md
Created November 15, 2023 19:12 — forked from scyto/proxmox.md
proxmox cluster proof of concept

ProxMox Cluster - Soup-to-Nutz

aka what i did to get from nothing to done.

note: these are designed to be primarily a re-install guide for myself (writing things down helps me memorize the knowledge), as such don't take any of this on blind faith - some areas are well tested and the docs are very robust, some items, less so). YMMV

Purpose of Proxmox cluster project

Required Outomces of cluster project