Skip to content

Instantly share code, notes, and snippets.

@alexlicohen
alexlicohen / cbig_2BP_parallel.sh
Last active August 26, 2021 21:23
[CBIG script for 2BP servers] #bchcohenlab #shell #CBIG #parallel
export study=ABIDE1
export site=SBL
/fileserver/caladan_ssd/repos/BIDS_to_CBIG_fMRI_Preproc2016/BIDS_parallel_list_one_server.sh \
60 \
/fileserver/caladan_ssd/repos/BIDS_to_CBIG_fMRI_Preproc2016/BIDS_2BP_CBIG_fMRI_preprocess_sesAware_phase.sh \
/fileserver/gammu/collections/${study}/${site} \
/fileserver/gammu/projects/${study}/subject_lists/${site}_subject_list.txt \
/fileserver/gammu/projects/${study}/freesurfer_v7.1.0/${site} \
/fileserver/gammu/projects/${study}/CBIG_fMRI_preprocess_ABIDE/${site} \
@alexlicohen
alexlicohen / movedocker.sh
Last active June 23, 2021 16:16
[moving docker home] moving the default docker image location out of the root partition #cohenlab #docker #shell
# as root:
systemctl stop docker
cd /home_local/
mkdir docker
chmod a+w docker/
rsync -avxP /var/lib/docker/ /home_local/docker
nano /lib/systemd/system/docker.service
# change:
@alexlicohen
alexlicohen / git_clone_branch.sh
Created June 23, 2021 13:14
[github shallow branch clone] #cohenlab #github #git
# This creates a shallow clone (good for docker) of a specific branch.
git clone --depth 1 --branch compiled-for-MCR https://github.com/bchcohenlab/CBIG.git CBIG_compiled-for-MCR
@alexlicohen
alexlicohen / bonding.sh
Last active June 23, 2021 13:14
[network bonding notes] #cohenlab #shell #networking
# Show existing connections (/etc/sysconfig/network-scripts)
nmcli -p dev status
# Make new bonding connection
nmcli con add type bond con-name bond0 ifname bond0 mode 6
# Bond existing ports to bond0
nmcli con add type bond-slave ifname p2p1 master bond0
nmcli con add type bond-slave ifname p2p2 master bond0
@alexlicohen
alexlicohen / raid_id.sh
Last active June 23, 2021 13:15
[raid setup on ecaz] step to ID and setup new RAID array #cohenlab #unix #centos
# setup raid in iDRAC
# in OS, switch to root and get a list of attached devices
su -
lsblk
# partition
parted -a optimal /dev/sda
#(in parted):
@alexlicohen
alexlicohen / gsp_prep.sh
Last active April 17, 2021 10:33
[GSP Prep for Dataverse] Steps I did to prep the CBIG output for Dataverse #cohenlab #GSP #shell
mkdir -p derivatives/CBIG_fMRI_Prepoc2016_modified
mv sub* derivatives/CBIG_fMRI_Prepoc2016_modified/
cd derivatives/CBIG_fMRI_Prepoc2016_modified
for i in `ls */*/*gz`; do fslreorient2std $i; done
for i in `ls`; do
mkdir ${i}/anat
mkdir ${i}/func
mv ${i}/vol/norm_MNI152_1mm.nii.gz ${i}/anat/${i}_norm_MNI152_1mm.nii.gz
@alexlicohen
alexlicohen / using_retrieve2.sh
Created February 9, 2021 15:48
[BCH PACS script] Retriving data from the clinical PACS #cohenlab #PACS
/home/ch163210/bin/retrieve2.sh [MRN] [STUDY DATE] [OUTPUT DIRECTORY] [MODALITY]
@alexlicohen
alexlicohen / dcm2niix_loop.sh
Last active February 10, 2021 15:32
[dcm2niix loop] script to process DICOMs with dcm2nixx and ID sequences #cohenlab #shell #dcm2niix
for i in `ls -d 1*/`; do dcm2niix -b y -ba y -z o -f '%i_%n_%3s_%d_%p' -o /Volumes/Drobo/Research/Dhand_2nd_set/dhand_bids /Volumes/Drobo/Research/Dhand_2nd_set/${i}; done
@alexlicohen
alexlicohen / double_rsync.sh
Last active June 22, 2021 00:17
[BCH to BWH transfer] how to double rsync data across firewalls #cohenlab #rsync #E2 #ERISOne
rsync -e ssh -ahvzP /lab-share/Neuro-Cohen-e2/Public/projects/GSP/GSP1000_MF alex@172.18.206.42:/Volumes/Drobo/Research/collections/
rsync -ahzP /lab-share/Neuro-Cohen-e2/Public/connectomes/GSP1000_500M alex@172.18.219.214:/Volumes/Drobo/Research/connectomes/
rsync -avhzP /Volumes/Drobo/Research/collections/GSP1000_MF ayc57@erisonexf.partners.org:/data/nimlab/Data_from_Alex_BCH/
rsync -avhzP /Volumes/Drobo/Research/connectomes/GSP1000_* ayc57@erisonexf.partners.org:/data/nimlab/Data_from_Alex_BCH/
# getting the surface files:
# on E2, in projects/GSP/CBIG_fMRI_preprocess_Legacy_GSP_surfaceBased_standard:
@alexlicohen
alexlicohen / simple_rclone.sh
Created January 12, 2021 15:09
[rclone GDrive to E2] #cohenlab #rclone #gdrive #E2
rclone sync drive_cohenlab_Inbox: /lab-share/Neuro-Cohen-e2/Public/lesions/WKTang_bids/sourcedata/secondbatch --progress