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
# ssh config to use with VS Code Remote SSH | |
# to launch a VS Code remote ssh session inside of | |
# a new SLURM compute job running on the remote HPC | |
# when you start a new ssh session from your LOCAL laptop, | |
# SLURM will spin up a new srun job and connect to the ssh daemon on the compute node | |
# your ssh connection will thus tunnel from your LOCAL laptop | |
# through the head node, to the compute node | |
# the SLURM job on the compute node will remain active until it expires via time limit | |
# the SLURM job will terminate when the ssh session is closed |
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
apt-get install -y singularity-container=4.1.1+ds2-1ubuntu0.2 |
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
package main | |
import ( | |
"fmt" | |
// "compress/gzip" | |
gzip "github.com/klauspost/pgzip" | |
"bufio" | |
"os" | |
"log" | |
) |
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
#!/usr/bin/env python3 | |
# do an action in parallel across multiple threads in Python | |
# example: get the average of lists of numbers | |
# references; | |
# https://stackoverflow.com/questions/8533318/multiprocessing-pool-when-to-use-apply-apply-async-or-map | |
# https://e2eml.school/multiprocessing.html | |
# https://docs.python.org/3.7/library/multiprocessing.html#multiprocessing.pool.Pool.apply_async |
A visual example for interpretting the output of git diff
, along with a helper alias gdiff
to make it easier to git diff
two files or directories.
Example input files:
$ cat example1.txt
Sample1
Sample2
Sample3
Sample4
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
#!/usr/bin/env python | |
""" | |
Module to send email messages | |
https://www.tutorialspoint.com/python/python_sending_email.htm | |
""" | |
import getpass | |
import smtplib | |
# default global configs |
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
parallel -k -N0 -n 0 -j 4 "echo your command here ; sleep 2" ::: {1..10} |
- Application manager for OS X
- some homebrew downloads you might need:
brew tap caskroom/cask
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" | |
Convert SLURM squeue output to JSON format | |
""" | |
import subprocess as sp | |
import json | |
process = sp.Popen(['squeue', '-o', '%all'], stdout = sp.PIPE, stderr = sp.PIPE, shell = False, universal_newlines = True) | |
proc_stdout, proc_stderr = process.communicate() |
NewerOlder