Skip to content

Instantly share code, notes, and snippets.

View a-maumau's full-sized avatar

Masaki Baba a-maumau

View GitHub Profile
"""
for Ubuntu 14.04, CUDA8.0
I checked that this is woking on 10/31/2017 in JST
someday it will not...
"""
# Set repository, suck the official.
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt-get update
# Select latest nvidia driver [ex. nvidia-381], not nvidia-#-dev
@a-maumau
a-maumau / ns.sh
Last active December 12, 2017 07:28
#!/bin/bash
# [ expr ], I'm really mad of "space"["space"expr"space"]"space" thing...
if [ $# -eq 1 ]; then
eval "watch -n ${1} nvidia-smi"
elif [ $# -eq 0 ]; then
eval "watch -n 0.5 nvidia-smi"
else
echo "1 argument please."
@a-maumau
a-maumau / nvme_mount.md
Last active May 29, 2024 01:40
how to mount m.2 ssd/hdd
@a-maumau
a-maumau / sample.sh
Last active February 5, 2018 10:34
for my convenience
#!/bin/bash
# for insurance to avoid catastrophe
set -Ceu
RC_FILE=0
# find default shell rc file of major shells
if [[ $(echo $SHELL | grep bash) ]]; then
RC_FILE=$HOME/.bashrc

解決方法?

Ubuntuを起動すると稀にGUIが立ち上がらなかったりログインループにハマることあがある。
http://may46onez.hatenablog.com/entry/2016/02/26/020208
とかで解決できます。

# ssh経由でも可
# control+Alt+F1でCUIの画面に遷移できる

# Xwindow認証関係の死なら
rm .Xauthority .ICEauthority
@a-maumau
a-maumau / julietta-theme.el
Last active May 14, 2018 05:43
emacs theme
;;; Code:
(deftheme julietta
"julietta theme")
(let ((julietta-fg "#c6a57b")
(julietta-bg-1 "#101010")
(julietta-bg "#151515")
(julietta-bg+1 "#202020")
(julietta-bg+2 "#505050")
@a-maumau
a-maumau / create_spacenet_road_dataset.py
Created July 26, 2018 07:38
parse SpaceNet dataset.
import os
### geopandas must be imported earlier than osgeo ###
import geopandas as gpd
from osgeo import gdal, ogr, osr
import numpy as np
import scipy
from scipy.misc import bytescale
import osmnx
import cv2
for img, mask, original_img in _trainval_loader:
batch_size = img.shape[0]
images = to_var(img, volatile=True)
#outputs = model.inference(images)
outputs = model(images)
outputs = F.softmax(outputs, dim=1)
# CRF ##############################################################################
crf_output = np.zeros(outputs.shape)
@a-maumau
a-maumau / test_markdown.md
Last active April 14, 2022 01:50
I always make a mistake in markdown at github, so here is a playground.

a

使い方

from datetime import datetime