Skip to content

Instantly share code, notes, and snippets.

View GzuPark's full-sized avatar
🍀
just enjoy your playing

Jongmin Park GzuPark

🍀
just enjoy your playing
View GitHub Profile
@GzuPark
GzuPark / pytorch.Dockerfile
Created February 3, 2022 08:20
Sample Dockerfiles for TensorFlow & PyTorch
ARG UBUNTU_VERSION=20.04
ARG CUDA_VERSION=11.3.1
ARG CUDA=11.3
ARG CUDNN_VERSION=8
FROM nvidia/cuda:${CUDA_VERSION}-cudnn${CUDNN_VERSION}-devel-ubuntu${UBUNTU_VERSION}
LABEL maintainer "http://gzupark.dev"
ARG CUDA_VERSION
ARG CUDA
@GzuPark
GzuPark / Dockerfile
Last active January 16, 2020 00:18
FROM nvidia/cuda:10.0-cudnn7-devel-ubuntu16.04
RUN apt-get update && apt-get install -y curl
RUN curl -sSL http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -o /tmp/miniconda.sh && \
bash /tmp/miniconda.sh -bfp /usr/local && \
rm -rf /tmp/miniconda.sh
RUN conda update -y conda
RUN conda install -q -y pyyaml mkl mkl-include setuptools cmake cffi typing ipython
@GzuPark
GzuPark / vim_cheatsheet.md
Created August 28, 2019 01:14 — forked from awidegreen/vim_cheatsheet.md
Vim shortcuts

Introduction

  • C-a == Ctrl-a
  • M-a == Alt-a

General

:q        close
:w        write/saves
:wa[!]    write/save all windows [force]
:wq       write/save and close
docker-machine create -d virtualbox \
--virtualbox-cpu-count=2 \
--virtualbox-memory=2048 \
--virtualbox-disk-size=100000 \
--virtualbox-boot2docker-url https://github.com/Alexoner/boot2docker/releases/download/v17.06.0-ce-usb-rc5/boot2docker.iso \
${DOCKER_MACHINE}
docker-machine create -d virtualbox \
--virtualbox-cpu-count=2 \
--virtualbox-memory=2048 \
--virtualbox-disk-size=100000 \
--virtualbox-boot2docker-url https://github.com/gzupark/boot2docker-webcam-mac/releases/download/18.06.1-ce-usb/boot2docker.iso \
${DOCKER_MACHINE}
# This file is useful for reading the contents of the ops generated by ruby.
# You can read any graph defination in pb/pbtxt format generated by ruby
# or by python and then convert it back and forth from human readable to binary format.
import tensorflow as tf
from google.protobuf import text_format
from tensorflow.python.platform import gfile
def pbtxt_to_graphdef(filename):
with open(filename, 'r') as f:
@GzuPark
GzuPark / docker-clean.md
Created February 25, 2019 07:56
Cleanup docker images and containers after failed builds

Cleanup docker images and containers after failed builds

Sometimes, there are some untagged images left behind after failed builds. In order to get rid of those, this script can be used.

#!/bin/bash
docker rm $(docker ps -aq)
docker rmi $(docker images | grep "^<none>" | awk '{print $3}')
@GzuPark
GzuPark / delete_git_submodule.md
Last active January 31, 2019 05:59 — forked from myusuf3/delete_git_submodule.md
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
from cipher.crypto import Cipher
data = 'Something you want to decrypt'
dec = Cipher(key, iv)
result = dec.decryption(data)
@GzuPark
GzuPark / terminal-git-branch-name.md
Last active September 21, 2018 01:08 — forked from joseluisq/terminal-git-branch-name.md
Add Git Branch Name to Terminal Prompt (Mac)

Add Git Branch Name to Terminal Prompt (Mac)

image

Open ~/.bash_profile in your favorite editor and add the following content to the bottom.

# Git branch in prompt.

parse_git_branch() {