Skip to content

Instantly share code, notes, and snippets.

MikimotoH MikimotoH

View GitHub Profile
@MikimotoH
MikimotoH / ssh_tar_download_exclude_directory.sh
Created Aug 16, 2019
ssh tar download exclude directory
View ssh_tar_download_exclude_directory.sh
ssh johndoe@192.168.99.99 "cd ~/project; tar --exclude='./downloads' -zcvf - ." | tar zxvf -
@MikimotoH
MikimotoH / Ubuntu_16.04_NVIDA_cuDNN_CNTK.md
Last active Nov 2, 2017
Build Deep Learning Environment on Ubuntu 16.04 (NVIDIA cuDNN and Microsoft CNTK)
View Ubuntu_16.04_NVIDA_cuDNN_CNTK.md

Download Proprietary NVIDIA driver for "GeForce GTX 970"

wget NVIDIA-Linux-x86_64-384.90.run

disable nouveau driver

How to disable nouveau kernel driver on Ubuntu 16.04 [ https://askubuntu.com/a/868209/497162 ]

sudo vim /etc/modprobe.d/nvidia-graphics-drivers.conf
sudo vim  /etc/modprobe.d/nvidia-installer-disable-nouveau.conf
sudo apt-get remove nvidia\*
sudo apt-get install dkms build-essential linux-headers-generic
@MikimotoH
MikimotoH / regex_quoted_string_with_backslash_escaped.py
Created Aug 8, 2016
use regex to search double quoted string with backslash escaped double quote
View regex_quoted_string_with_backslash_escaped.py
In [40]: re.search(r'"(.*?)(?<!\\)"', r'"abc\" \"def" "ghi"')
Out[40]: <_sre.SRE_Match object; span=(0, 13), match='"abc\\" \\"def"'>
In [41]: print(_40.group(1))
abc\" \"def
@MikimotoH
MikimotoH / gist:6b1ed323ea29b87ad60d88be3084ef35
Created Jun 6, 2016
recover Ubuntu after unmount system disk
View gist:6b1ed323ea29b87ad60d88be3084ef35
我的Ubuntu 14.04.3 LTS Desktop,我把左測的Files -> Devices 中的Ubuntu System disk給 unmount之後,從公司ssh連回家後發現做什麼都
disk i/o write error。
我強迫重開機後,進入黑白的GRUB command line,用了 set prefix=(hda2,2)/boot/grub ; insmod normal ; normal
也沒有效果。
使用 USB Boot Disk也沒有辦法修復。
我以為這裡面的data都毀了corrupted,救不回來了。
後來,我把ubuntu的SSD OCZ 240GB SSD 拆開到另一台電腦,用外接硬碟連接,另一台電腦用也用Ubuntu USB boot,沒想到發現外接SSD
裡面的資料完好如初。
後來,我把那/boot/grub/grub.cfg 中的ro都改成rw,再接回原來的電腦,沒想到就可以用了。
@MikimotoH
MikimotoH / build_vim_with_python2_python3.sh
Last active May 4, 2019
build vim with python2 python3 YouCompleteMe on Ubuntu 14.04
View build_vim_with_python2_python3.sh
./configure --with-features=huge \
--enable-multibyte \
--enable-rubyinterp=yes \
--enable-python3interp=yes \
--with-python3-config-dir=$(python3-config --configdir) \
--enable-perlinterp=yes \
--enable-luainterp=yes \
--enable-gui=gtk2 \
--enable-cscope \
--prefix=/usr/local
@MikimotoH
MikimotoH / caffe_pb2.py
Created Apr 17, 2016
CAFFE caffe_pb2.py for Python3, modified unicode("...","utf-8") to str("...")
View caffe_pb2.py
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: caffe.proto
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import descriptor_pb2
# @@protoc_insertion_point(imports)
@MikimotoH
MikimotoH / geoip.py
Created Mar 25, 2016
MaxMind "python-geoip" and "python-geoip-geolite2" in Python3.5 version, originally in "~/anaconda3/lib/python3.5/site-packages/geoip.py"
View geoip.py
import sys
import mmap
import socket
import urllib.request, urllib.parse, urllib.error
from threading import Lock
from datetime import datetime
from struct import Struct
@MikimotoH
MikimotoH / Ubuntu_14.04_tty_is_black
Created Jan 25, 2016
Ubuntu 14.04.3 switching from desktop to tty (Ctrl-Alt-F1) the screen is black
View Ubuntu_14.04_tty_is_black
Resolution:
http://askubuntu.com/questions/508635/how-can-i-get-ttys-to-work-with-nvidia-drivers?lq=1
fix grub resolution:
sudo nano /etc/default/grub
Now, locate the line
#GRUB_GFXMODE=640x480
@MikimotoH
MikimotoH / CUDA_driver_version_is_insufficient_for_CUDA_runtime_version.txt
Created Jan 24, 2016
CUDA driver version is insufficient for CUDA runtime version Ubuntu 14.04.3 GTX 970 CUDA 7.5
View CUDA_driver_version_is_insufficient_for_CUDA_runtime_version.txt
Symptom:
Error message "CUDA driver version is insufficient for CUDA runtime version" shown when running
/usr/local/cuda-7.5/samples/1_Utilities/deviceQuery/deviceQuery
My Equipment:
Ubunt 14.04.3 Trusty
EVGA GTX 970
CUDA 7.5
Cause:
@MikimotoH
MikimotoH / vim_python3.sh
Created Sep 21, 2015
vim support python3
View vim_python3.sh
# python3-config --configdir
./configure --with-features=huge --enable-multibyte --enable-python3interp --with-python3-config-dir=/usr/lib/python3.4/config-3.4m-x86_64-linux-gnu --enable-rubyinterp --enable-perlinterp --enable-luainterp --enable-cscope --enable-gui=gtk2 --prefix=/usr
make -j4 VIMRUNTIMEDIR=/usr/share/vim/vim74
make clean
You can’t perform that action at this time.