Skip to content

Instantly share code, notes, and snippets.

View pangyuteng's full-sized avatar

pangyuteng

View GitHub Profile
@pangyuteng
pangyuteng / Dockerfile
Last active April 30, 2025 19:06
docker with cron job
FROM python:3.8-slim-buster
RUN apt-get update && apt-get -y install cron
# Copy hello-cron file to the cron.d directory
COPY hello-cron /etc/cron.d/hello-cron
# Give execution rights on the cron job
RUN chmod 0644 /etc/cron.d/hello-cron
@pangyuteng
pangyuteng / lazyload.html
Created March 17, 2022 21:12
demo lazy load with call back using jquery.lazy
<!DOCTYPE html>
<html lang="en">
<head>
<style>
div.lazy {
width: 700px;
height: 467px;
background: #f2dede;
color: #a94442;
@pangyuteng
pangyuteng / .gitignore
Last active November 16, 2022 18:34
3d image patch extraction
**/.ipynb_checkpoints/*
ok.png
ok.nii.gz
workdir/*
@pangyuteng
pangyuteng / README.md
Last active September 11, 2021 22:38
route browser traffic via ssh to server with vpn acccess

router setup (since server is behind router)

  • forward external port (22 or something else) to server port 22.

server setup

  • enable ssh
@pangyuteng
pangyuteng / CMakeLists.txt
Last active June 15, 2021 23:09
QVTKWidget vs QVTKWidget2
cmake_minimum_required(VERSION 3.0.0 FATAL_ERROR)
if(POLICY CMP0020)
cmake_policy(SET CMP0020 NEW)
endif()
PROJECT(foo)
find_package(VTK REQUIRED)
@pangyuteng
pangyuteng / Dockerfile.QT4VTK7
Last active June 3, 2024 17:36
qt+vtk Dockerfile
FROM ubuntu:18.04
RUN apt-get update && apt-get install -y --no-install-recommends \
autotools-dev \
build-essential \
ca-certificates \
cmake \
git \
wget \
unzip \
@pangyuteng
pangyuteng / .gitignore
Last active June 20, 2023 05:53
nifti-origin-orientation
images/*
images.zip
itk.nii.gz
ok/*
@pangyuteng
pangyuteng / README.md
Last active April 15, 2021 00:29
nvidia clara+slicer3

server side:

ref. https://docs.nvidia.com/clara/tlt-mi/

  • get container
export workspace=/tmp/clara-experiments
mkdir -p $workspace
export dockerImage=nvcr.io/nvidia/clara-train-sdk:v3.1.01
docker pull $dockerImage
docker run --gpus=1 --shm-size=1G --ulimit memlock=-1 --ulimit stack=67108864 -it --rm -v $workspace:/workspace/clara-experiments $dockerImage /bin/bash
@pangyuteng
pangyuteng / myprofile.py
Last active April 28, 2021 00:09
profile io with asyncio
import os
import sys
import uuid
import time
import numpy as np
import asyncio
import aiofiles
from aiofiles.os import wrap
# make sure any io operations use the async version
@pangyuteng
pangyuteng / email_utls.py
Created February 19, 2021 06:48
python email utils
import os
import warnings
import traceback
import smtplib
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
from email.mime.application import MIMEApplication
import getpass
# email_server coule be email_server+":"+port