This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
#requires image magick | |
dir=$1 | |
target_dir=$PWD | |
for f in $PWD/*.ppm | |
do | |
ppm=$(basename -s .ppm $f) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
dir=$1 | |
target_dir=$PWD | |
for f in $PWD/*.mkv; do | |
mkv=$(basename -s .mkv $f) | |
echo $ppm | |
mpx=$target_dir/$mkv.mp4 | |
if [ ! -in $mpx ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Here are a few methods for getting text from PDF files. Do read through | |
# the instructions carefully! NOte that this code is written for Windows 7, | |
# slight adjustments may be needed for other OSs | |
# Tell R what folder contains your 1000s of PDFs | |
dest <- "G:/somehere/with/many/PDFs" | |
# make a vector of PDF file names | |
myfiles <- list.files(path = dest, pattern = "pdf", full.names = TRUE) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Default Variable Declarations | |
DEFAULT="Default.txt" | |
FILEEXT=".ovpn" | |
CRT=".crt" | |
KEY=".3des.key" | |
CA="ca.crt" | |
TA="ta.key" | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
curl -s http://checkip.dyndns.org | sed 's/[a-zA-Z/<> :]//g' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
[ -f /etc/banner ] && cat /etc/banner | |
export PATH=/usr/bin:/usr/sbin:/bin:/sbin | |
export HOME=$(grep -e "^${USER:-root}:" /etc/passwd | cut -d ":" -f 6) | |
export HOME=${HOME:-/root} | |
export PS1='\u@\h:\w\$ ' | |
[ -x /bin/more ] || alias more=less | |
[ -x /usr/bin/vim ] && alias vi=vim || alias vim=vi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://www.speedtest.net/speedtest-servers.php [Get server id here] | |
./speedtest-cli --server 1993 --secure | |
# id = 1993 for ElectronicBox server in Montreal, QC |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fid = fopen('DemographicNGrouping_for_NLES_Data_CT.csv'); | |
C = textscan(fid, '%s%d%s%s%s%s%d%d%d%d%d%s%d%d%d','Delimiter',',','CollectOutput', 1); | |
% reading laterality as a string instead of binary integers. | |
ID = C{1}; | |
Age = int32(C{2}); | |
Sex = C{3}(:,1); Sex(strcmp(Sex, '1')) = {'F'}; Sex(strcmp(Sex, '0')) = {'M'}; | |
Left = C{3}(:, 2); Right = C{3}(:, 3); Bilateral = C{3}(:, 4); | |
group = Left; | |
group(strcmp(group, '1')) = {'LTLE'}; group(strcmp(group, '0')) = {'RTLE'}; | |
% encode binary numbers '0' and '1' in Laterality as RTLE and LTLE. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fid = fopen('DemographicNGrouping_for_controls_Data_CT.csv'); | |
C = textscan(fid, '%s%s%d%s%s', 'Delimiter', ',', 'CollectOutput', 1); | |
ID = C{1}(:, 1); | |
path = C{1}(:, 2); | |
age = int32(C{2}); | |
sex = C{3}(:,1); sex(strcmp(sex, 'male')) = {'F'}; sex(strcmp(sex, 'female')) = {'M'}; | |
group = C{3}(:, 2); | |
subject_ID_cont = ID; | |
subject_path_cont = path; | |
Age_cont = age; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function struct2csv(s,fn) | |
% STRUCT2CSV(s,fn) | |
% | |
% Output a structure to a comma delimited file with column headers | |
% | |
% s : any structure composed of one or more matrices and cell arrays | |
% fn : file name | |
% | |
% Given s: | |
% |
OlderNewer