Skip to content

Instantly share code, notes, and snippets.

View rhee-elten's full-sized avatar

rhee-elten

  • Linkgenesis
  • Seoul, South Korea
  • 03:55 (UTC +09:00)
View GitHub Profile
@rhee-elten
rhee-elten / cuda_select_best_memfree.py
Last active April 1, 2024 23:55
cuda_select_best_memfree.py
#!/usr/bin/env python
# coding: utf-8
## cuda_select_best_memfree.py 는 python2 에서도 실행되면 좋겠다. (시스템 파이썬 사용)
## gist https://gist.github.com/rhee-elten/223124ba106e7b9927078a4a1a8c320e
from __future__ import print_function
import sys
import os
import subprocess
:
if ! -z "$DEVPI_FORWARD"
then
docker run -dit --restart unless-stopped \
-p 3141:3141 \
--name devpi alpine/socat:1.7.4.4 \
tcp-listen:3141,fork,reuseaddr tcp-connect:$DEVPI_FORWARD:3141
else
docker run -dit --restart unless-stopped \
-p 3141:3141 \
:
<<EEE >/dev/null
https://github.com/EpicWink/proxpi
Environment variables
PROXPI_INDEX_URL: index URL, default: https://pypi.org/simple/
PROXPI_INDEX_TTL: index cache time-to-live in seconds, default: 30 minutes. Disable index-cache by setting this to 0
PROXPI_EXTRA_INDEX_URLS: extra index URLs (comma-separated)
@rhee-elten
rhee-elten / keras-cv--fasterrcnn--patch.txt
Created August 9, 2023 04:12
fasterrcnn 에서 동작하도록 하기 위해서는 keras_cv 에 다음 패치 필요: keras_cv/layers/object_detection/anchor_generator.py
"""
fasterrcnn 에서 동작하도록 하기 위해서는 keras_cv 에 다음 패치 필요:
keras_cv/layers/object_detection/anchor_generator.py
line 258:
stride = self.stride
# make sure range of `cx` is within limit of `image_width` with
# `stride`, also for sizes where `image_width % stride != 0`.
#!/bin/bash
set -e; set -u
COMMON_SUBDOMAINS="www mail mx a.mx smtp pop imap blog en ftp ssh login"
EXTENDED=""
while :; do case "$1" in
--) shift; break ;;
-x) EXTENDED=y; shift ;;
-s) NS="$2"; shift 2 ;;
*) break ;;
@rhee-elten
rhee-elten / render-notebook.bash
Last active August 4, 2023 01:46
[WIP] gitea renderer - jupyter notebook using nb.js (TBD frame security check workaround) /////////////////////////////
#!/bin/bash
mkdir -p "${GITEA_CUSTOM}/tmp/render-notebook"
exec 2>> "${GITEA_CUSTOM}/tmp/render-notebook/trace.txt"
## DEBUG: echo params & envs
## PARAMS:
echo "=== Script: $(dirname $0)" 1>&2
echo "=== Date: $(date +'%Y-%m-%d %H:%M:%S')" 1>&2
echo "=== Args:" "$@" 1>&2
@rhee-elten
rhee-elten / fix-env_vars-scripts.bash
Last active March 19, 2024 04:37
fix LD_LIBRARY_PATH for conda and WSL
:
set -x
CONDA_PREFIX=${CONDA_PREFIX-$1}
save_LD_LIBRARY_PATH="$(echo LD_LIBRARY_PATH__$(echo $CONDA_DEFAULT_ENV | tr .- __))"
## find libdevice for XLA_FLAGS ## workaround for error: "libdevice not found at ./libdevice.10.bc"
if test -f $CONDA_PREFIX/lib/libdevice.*.bc
then
# mpl_korfont.py
# coding: utf-8
import sys
from os.path import isfile, basename
"""
font size comparison (kB):
1300 NanumBarunGothicSubset.ttf
1328 d2coding-subset.ttf
@rem netsh interface portproxy example
@echo off
setlocal
@rem C:\Windows\System32\bash.exe -c "sudo /usr/sbin/service ssh start"
wsl sudo /usr/sbin/service ssh start
for /f %%i in ('wsl hostname -I') do set IP=%%i
netsh.exe interface portproxy delete v4tov4 listenport=2222 listenaddress=127.0.0.1 protocol=tcp
# -*- coding: utf-8 -*-
# %%
# # !jupytext exp-hough-circle.ipynb --to py:percent -o- | tee exp-hough-circle_.py
# # !jupyter nbconvert exp-hough-circle.ipynb --to html
# %% [markdown]
# ## utility 함수 로딩
# %%
# %run ../ml-workspace-common/ml-workspace-common.py