Skip to content

Instantly share code, notes, and snippets.

View pangyuteng's full-sized avatar

pangyuteng

View GitHub Profile
@coltonbh
coltonbh / docker-swarm-gpu.md
Last active July 1, 2024 20:47
Docker Swarm GPU Support

GPU Support For Docker Swarm

Docker compose has nice support for GPUs, K8s has moved their cluster-wide GPU scheduler from experimental to stable status. Docker swarm has yet to support the device option used in docker compose so the mechanisms for supporting GPUs on swarm are a bit more open-ended.

Basic documentation

@aewhite
aewhite / example.py
Created January 8, 2022 14:03
Inverse of extract Image Patches for TF 2.x
# Solution based on https://stackoverflow.com/a/51785735/278836
import tensorflow as tf
def extract_patches(images):
return tf.image.extract_patches(
images,
(1, 3, 3, 1),
(1, 1, 1, 1),
(1, 1, 1, 1),
padding="VALID")
@gjreasoner
gjreasoner / README.md
Last active April 25, 2024 01:42
Expand Ubuntu 20 Proxmox Disk
# Resize the file system in UI, under VM -> Hardware -> Click on the disk to resize, click "Resize disk" button

# Confirm increase in disk space (1TB in my case)
$ lsblk
NAME                      MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda                         8:0    0    1T  0 disk
├─sda1                      8:1    0    1M  0 part
├─sda2                      8:2    0    1G  0 part /boot
└─sda3                      8:3    0    1T  0 part
@RafaelWO
RafaelWO / docker-swarm-gpu.md
Last active January 11, 2024 21:19 — forked from tomlankhorst/docker-swarm-gpu.md
Instructions for Docker swarm with GPUs
@jsoma
jsoma / CORS.json
Last active May 11, 2023 09:21
CORS public access (new JSON version)
{
"Version":"2012-10-17",
"Statement":[
{
"Sid":"PublicRead",
"Effect":"Allow",
"Principal": "*",
"Action":["s3:GetObject","s3:GetObjectVersion"],
"Resource":["arn:aws:s3:::YOUR_BUCKET_NAME_GOES_HERE/*"]
}
@ih2502mk
ih2502mk / list.md
Last active July 4, 2024 04:11
Quantopian Lectures Saved
@kissgyorgy
kissgyorgy / listen.py
Created September 4, 2020 16:37
How to use PostgreSQL's LISTEN/NOTIFY as a simple message queue with psycopg2 and asyncio
import asyncio
import psycopg2
# dbname should be the same for the notifying process
conn = psycopg2.connect(host="localhost", dbname="example", user="example", password="example")
conn.set_isolation_level(psycopg2.extensions.ISOLATION_LEVEL_AUTOCOMMIT)
cursor = conn.cursor()
cursor.execute(f"LISTEN match_updates;")
@alexlib
alexlib / README.md
Created August 27, 2020 13:58 — forked from amroamroamro/README.md
[Python] Fitting plane/surface to a set of data points

Python version of the MATLAB code in this Stack Overflow post: http://stackoverflow.com/a/18648210/97160

The example shows how to determine the best-fit plane/surface (1st or higher order polynomial) over a set of three-dimensional points.

Implemented in Python + NumPy + SciPy + matplotlib.

quadratic_surface

@hungyiwu
hungyiwu / install_SimpleElastix.sh
Last active February 25, 2021 20:49
Install SimpleElastix with Python3 on the O2 server at Harvard Medical School
#!/bin/bash
#SBATCH --job-name=installSE
#SBATCH -c 4 # Number of cores
#SBATCH -t 0-03 # Runtime in D-HH:MM, minimum of 10 minutes
#SBATCH -p short # Partition to submit to, whichever is faster
#SBATCH --mem-per-cpu=4G # Memory (see also --mem)
#SBATCH -o joboutput.out # job output
#SBATCH -e joberrors.err # job error log
# load modules