Skip to content

Instantly share code, notes, and snippets.

View ravnoor's full-sized avatar

Ravnoor Singh Gill ravnoor

View GitHub Profile
@ravnoor
ravnoor / list-sort-unique.sh
Last active November 8, 2017 17:44
list, sort and unique to get directory name from filenames
ls -1 | awk -F'_' '{print $1 $2}' | sort -u
# FLP_001_t2.nii
# FLP_001_t1_nii
# FLP_004_t2.nii
# FLP_004_t1.nii
# ||
# ||
# FLP_001
# FLP_004
@ravnoor
ravnoor / qholder.sh
Created November 11, 2017 21:05
hold and unhold queued jobs
# SGE 8.1.9
qhold 888333 -t 7-12
qalter -h U 888333 -t 7-12
@ravnoor
ravnoor / data_loader.py
Created January 21, 2018 20:59 — forked from kevinzakka/data_loader.py
Train, Validation and Test Split for torchvision Datasets
# This is an example for the CIFAR-10 dataset.
# There's a function for creating a train and validation iterator.
# There's also a function for creating a test iterator.
# Inspired by https://discuss.pytorch.org/t/feedback-on-pytorch-for-kaggle-competitions/2252/4
from utils import plot_images
def get_train_valid_loader(data_dir,
batch_size,
augment,
@ravnoor
ravnoor / Cats_vs_ Dogs_pytorch.py
Created February 19, 2018 16:43 — forked from fsodogandji/Cats_vs_ Dogs_pytorch.py
Unet Deeplearning pytorch
# from https://www.kaggle.com/nothxplz/dogs-vs-cats-redux-kernels-edition/cats-vs-dogs-05-pytorch-example/run/761413
from __future__ import print_function
import argparse
import csv
import os
import os.path
import shutil
import time
#!/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
@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
@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 / 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
# 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 / 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