Skip to content

Instantly share code, notes, and snippets.

View ravnoor's full-sized avatar

Ravnoor Singh Gill ravnoor

View GitHub Profile
@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 / 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 / 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 / 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 / colourbars.sh
Created March 26, 2019 17:05
create colourbars from fslview lookup tables
# https://www.jiscmail.ac.uk/cgi-bin/webadmin?A2=FSL%3Bd7372159.0810
FSLDIR=/usr/share/fsl/5.0/etc/luts
LUT=render3
slicer ${FSLDIR}/colourbar.nii.gz -l ${LUT} -s 2 -i 0 100 -u -z 0 colourbar.png
# https://myfabrix.com/community/tech-notes/photonos-expanding-disk-partition/
echo 1 > /sys/class/block/sda/device/rescan
tdnf install parted
parted /dev/sda
resizepart 2 100%
quit
@ravnoor
ravnoor / plexDatabaseRestoreScript.sh
Created December 25, 2018 23:05 — forked from ssmereka/plexDatabaseRestoreScript.sh
Plex Media Server database backup restore script.
#!/bin/bash
# Restore a Plex database.
# Author Scott Smereka
# Version 1.0
# Script Tested on:
# Ubuntu 12.04 on 2/2/2014 [ OK ]
# Plex Database Location. The trailing slash is
@ravnoor
ravnoor / plexDatabaseBackupScript.sh
Created December 25, 2018 23:05 — forked from ssmereka/plexDatabaseBackupScript.sh
Plex Media Server database backup script.
#!/bin/bash
# Backup a Plex database.
# Author Scott Smereka
# Version 1.0
# Script Tested on:
# Ubuntu 12.04 on 2/2/2014 [ OK ]
# Plex Database Location. The trailing slash is
@ravnoor
ravnoor / dumb-ap-wired-link.sh
Last active August 26, 2018 23:52 — forked from braian87b/dumb-ap-wired-link.sh
How to setup a Dumb AP, Wired backbone for OpenWRT / LEDE
#!/bin/bash
mkdir -p /tmp/certbot/public_html/
cd /tmp/certbot/public_html
# forward external port 80 to internal port [unifi-controller-ip]:9000
python -m SimpleHTTPServer 9000
sudo cp -r /etc/letsencrypt/live/unifi.domain.com/ ~/Desktop/certbot/
# renew certificate