Skip to content

Instantly share code, notes, and snippets.

@arcaduf
arcaduf / Putty saved session does not start with double click
Created September 10, 2019 20:05
Putty saved session does not start with double click
Delete the saved session by clicking on the 'Delete' button in PuTTY configuration
Re-enter the hostname/IP address in both 'Host Name (or IP address)' field and 'Saved Session' field.
Save the session by clicking 'Save' Button
Double-click on the newly saved session
@arcaduf
arcaduf / Order folders in directory with respect to size
Created September 10, 2019 06:33
Order folders in directory with respect to size
du -H --max-depth=1 ./ | sort -n -r
@arcaduf
arcaduf / Prepare Kaggle Ultrasound Nerve Segmentation dataset for DL
Created April 3, 2019 07:24
Prepare Kaggle Ultrasound Nerve Segmentation dataset for DL
'''
Link image data to ground truth
'''
from __future__ import print_function
import glob , os
import pandas as pd
import numpy as np
# User input
@arcaduf
arcaduf / Prepare KaggleDR dataset for DL
Created April 3, 2019 07:19
Prepare KaggleDR dataset for DL
'''
Link image data to ground truth
'''
from __future__ import print_function
import glob , os
import pandas as pd
import numpy as np
# User input
@arcaduf
arcaduf / HPC --> Python-3.6 & Tensorflow-1.12
Last active March 7, 2019 17:34
HPC --> Python-3.6 & Tensorflow-1.12
ml use /pstore/apps/.testing/modules/all
ml python/python3.6-2018.05
ml virtualenv
ml CUDA cuDNN
ml TensorFlow/1.12.0-foss-2018b-CUDA-10.0.130-Python-3.6.5-2018.05
source /pstore/data/pio/ShellTools/VENVS/GPU/venv-3.6-gpu/bin/activate
@arcaduf
arcaduf / Expand Slurm column with job name
Created March 7, 2019 16:57
Expand Slurm column with job name
sacct --format="JobID,JobName%30"
@arcaduf
arcaduf / Replace slash with backslash in Bash
Created November 5, 2018 11:31
Replace slash with backslash in Bash
string="/pstore/data/pio/Trials/Ride-Rise/RISE/IMG/S16720/72004/CF/"
echo ${string//\//\\}
\pstore\data\pio\Trials\Ride-Rise\RISE\IMG\S16720\72004\CF
@arcaduf
arcaduf / Replace tabs with 4 spaces in script
Created October 4, 2018 14:17
Replace tabs with 4 spaces in script
sed -i $'s/\t/ /g' script_filename.py
@arcaduf
arcaduf / Work with CSVKIT
Created August 31, 2018 13:31
Work with CSVKIT
Find unique values within a specified column of a CSV with semicolor delimiter: csvcut -c SCATPC -d ";" /pstore/data/pio/Tasks/PIO-382/original_tables/table_scatpc.csv | sed 1d | sort | uniq
@arcaduf
arcaduf / Pandas: difference between dataframes
Created July 17, 2018 15:03
Pandas: difference between dataframes
merged = df1.merge(df2, indicator=True, how='outer')
merged[merged['_merge'] == 'left_only']