Skip to content

Instantly share code, notes, and snippets.

View makefile's full-sized avatar
🐷
新年新气象

康行天下 makefile

🐷
新年新气象
View GitHub Profile
@makefile
makefile / gpu_selector.py
Created July 31, 2021 05:29
Select Nvidia GPU card index by remain available graphic memory through nvidia-smi in python.
# -*- coding: utf-8 -*-
"""
@src: https://github.com/QuantumLiu/tf_gpu_manager/blob/master/manager_torch.py
Example:
in shell:
gpu_id=$(python gpu_selector.py 3>&2 2>&1 1>&3)
in python:
gm=GPUManager()
with torch.cuda.device(gm.auto_choice()):
# -*- coding: utf-8 -*-
# requirements: requests
# conda/pip install requests
# pip install -i https://pypi.tuna.tsinghua.edu.cn/simple requests==1.2.3 # version for python2.6, but has problem in SSL
import os
from contextlib import closing
import threading
import time
import sys
import requests
@makefile
makefile / CascadeRCNN-demo.py
Last active December 3, 2018 07:53
Cascade R-CNN demo&test script
import os
import sys
import argparse
import numpy as np
from PIL import Image, ImageDraw
import cv2
import time
import json
# Make sure that caffe is on the python path:
@makefile
makefile / how-to-install-latest-gcc-on-ubuntu-lts.txt
Created January 9, 2018 17:51 — forked from application2000/how-to-install-latest-gcc-on-ubuntu-lts.txt
How to install latest gcc on Ubuntu LTS (12.04, 14.04, 16.04)
These commands are based on a askubuntu answer http://askubuntu.com/a/581497
To install gcc-6 (gcc-6.1.1), I had to do more stuff as shown below.
USE THOSE COMMANDS AT YOUR OWN RISK. I SHALL NOT BE RESPONSIBLE FOR ANYTHING.
ABSOLUTELY NO WARRANTY.
If you are still reading let's carry on with the code.
sudo apt-get update && \
sudo apt-get install build-essential software-properties-common -y && \
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
@makefile
makefile / install_nvidia_driver_in_ubuntu1604.md
Created December 15, 2017 17:32 — forked from terrydang/install_nvidia_driver_in_ubuntu1604.md
Ubuntu 16.04 安装英伟达(Nvidia)显卡驱动

Ubuntu 16.04 安装英伟达(Nvidia)显卡驱动

配有英伟达显卡的主机,装完 Ubuntu 16.04 后出现闪屏现象,是由于没有安装显卡驱动。

显卡型号
NVIDIA Corporation GM204 [GeForce GTX 970]

@makefile
makefile / ifcfg-he-ipv6
Created October 24, 2017 15:01 — forked from briancline/ifcfg-he-ipv6
HE.net IPv6 Tunnel Broker - CentOS/RHEL/Fedora NIC config
DEVICE="he-ipv6"
DEVICETYPE=sit
BOOTPROTO=none
ONBOOT=yes
IPV6INIT=yes
IPV6TUNNELIPV4=184.105.253.10
IPV6TUNNELIPV4LOCAL=XXX.XXX.XXX.XXX
IPV6ADDR=2001:470:YYYY:YYYY::2/64
IPV6_DEFAULTGW=2001:470:YYYY:YYYY::1
@makefile
makefile / SimpleHTTPServerWithUpload.py
Last active December 17, 2019 12:01 — forked from UniIsland/SimpleHTTPServerWithUpload.py
Simple Python Http Server with Upload, support ipv6 address, multi threading and utf-8 display
#!/usr/bin/env python
"""Simple HTTP Server With Upload.
This module builds on BaseHTTPServer by implementing the standard GET
and HEAD requests in a fairly straightforward manner.
"""