Skip to content

Instantly share code, notes, and snippets.

View karlmutch's full-sized avatar
🇳🇿
( ಠ ͜ʖಠ)

Karl Mutch karlmutch

🇳🇿
( ಠ ͜ʖಠ)
View GitHub Profile
@karlmutch
karlmutch / get_available_gpus.py
Created November 9, 2017 00:05 — forked from jovianlin/get_available_gpus.py
Get List of Devices in TensorFlow
from tensorflow.python.client import device_lib
def get_available_gpus():
local_device_protos = device_lib.list_local_devices()
return [x.name for x in local_device_protos if x.device_type == 'GPU']
get_available_gpus()
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/cuda-repo-ubuntu1604_8.0.61-1_amd64.deb
dpkg -i cuda-repo-ubuntu1604_8.0.61-1_amd64.deb
apt-get update
apt-get install cuda-nvrtc-8-0 cuda-nvgraph-8-0 cuda-cusolver-8-0 cuda-cublas-8-0 cuda-cufft-8-0 cuda-curand-8-0 cuda-cusparse-8-0 cuda-npp-8-0 cuda-cudart-8-0 cuda-drivers
nvidia-smi
sudo rmmod nvidia_drm
sudo rmmod nvidia_modeset
sudo rmmod nvidia_uvm
sudo rmmod nvidia
nvidia-smi
@karlmutch
karlmutch / waya-dl-setup.sh
Created November 21, 2017 21:57 — forked from mjdietzx/waya-dl-setup.sh
Install CUDA Toolkit v8.0 and cuDNN v6.0 on Ubuntu 16.04
#!/bin/bash
# install CUDA Toolkit v8.0
# instructions from https://developer.nvidia.com/cuda-downloads (linux -> x86_64 -> Ubuntu -> 16.04 -> deb (network))
CUDA_REPO_PKG="cuda-repo-ubuntu1604_8.0.61-1_amd64.deb"
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/${CUDA_REPO_PKG}
sudo dpkg -i ${CUDA_REPO_PKG}
sudo apt-get update
sudo apt-get -y install cuda
##################################################################################################
# experiments service
##################################################################################################
apiVersion: v1
kind: Service
metadata:
labels:
service: ambassador
name: ambassador
annotations:
https://www.dataquest.io/blog/basic-statistics-with-python-descriptive-statistics/
https://blogs.oracle.com/ai/types-of-machine-learning-and-top-10-algorithms-everyone-should-know
https://www.kdnuggets.com/2018/05/5-reasons-logistic-regression-first-data-scientist.html
https://www.kdnuggets.com/2018/02/logistic-regression-concise-technical-overview.html
https://towardsdatascience.com/types-of-machine-learning-algorithms-you-should-know-953a08248861
https://machinelearningmastery.com/a-gentle-introduction-to-the-central-limit-theorem-for-machine-learning/
@karlmutch
karlmutch / ansible-bootstrap-ubuntu-16.04.yml
Created August 13, 2018 16:16 — forked from gwillem/ansible-bootstrap-ubuntu-16.04.yml
Get Ansible to work on bare Ubuntu 16.04 without python 2.7
# Add this snippet to the top of your playbook.
# It will install python2 if missing (but checks first so no expensive repeated apt updates)
# gwillem@gmail.com
- hosts: all
gather_facts: False
tasks:
- name: install python 2
raw: test -e /usr/bin/python || (apt -y update && apt install -y python-minimal)
@karlmutch
karlmutch / Install NVIDIA Driver and CUDA.md
Created August 16, 2018 01:12 — forked from zhanwenchen/Install NVIDIA Driver and CUDA.md
Install NVIDIA CUDA 9.0 on Ubuntu 16.04.4 LTS
@karlmutch
karlmutch / cgo.md
Created August 16, 2018 18:04 — forked from zchee/cgo.md
cgo convert list

See also, http://libraryofalexandria.io/cgo/

Using Go cgo

cgo has a lot of trap.
but Not "C" pkg also directory in $GOROOT/src. IDE's(vim) Goto command not works.

So, Here collect materials.

// Found at https://play.golang.org/p/pQn_doizkn_L
package main
import (
"fmt"
"reflect"
)
var strs = make(map[reflect.Type]map[int]string)
sudo vi /etc/sysctl.conf
# Add the following to sysctl.conf:
# Decrease TIME_WAIT seconds
net.ipv4.tcp_fin_timeout = 30
# Recycle and Reuse TIME_WAIT sockets faster
net.ipv4.tcp_tw_recycle = 1