Skip to content

Instantly share code, notes, and snippets.

View taoy's full-sized avatar
😪
I may be slow to respond.

TAO Yuichi taoy

😪
I may be slow to respond.
  • Tokyo, Japan
View GitHub Profile
@taoy
taoy / i3-config
Last active January 27, 2020 02:35
I3 wm configuration and i3-blocks configuration.
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout somewhen, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
@taoy
taoy / envrc
Created October 27, 2014 10:22
direnv + virtualenv + bpython
if ! [ -d .venv ]; then
virtualenv --system-site-packages .venv
virtualenv --relocatable .venv
fi
source .venv/bin/activate
export PYTHONPATH="$(python -c 'import sys; print ":".join(sys.path)')"
@taoy
taoy / gist:0d4dd0015fdc1700ce4e
Last active August 29, 2015 14:17
How to resolve problems with Link2SD / 'Insufficient Storage' error when installing application on android.
@taoy
taoy / form.html
Created August 3, 2015 07:09
Python Bottle + WTforms + Polymer
%rebase layout title='Register New Slack log Box Backup configuration', parent_url=app.get_url('index')
<h2>Create New Slack Box backup</h2>
<script>
function submitForm(){
document.getElementById('authform').submit();
};
</script>
<!-- python block (bottle + wtforms) will not be appear in html-->
@taoy
taoy / vimrc
Created November 9, 2015 05:32
excerpt of .vimrc
"Window navigation
map <C-h> <C-w>h
map <C-j> <C-w>j
map <C-k> <C-w>k
map <C-l> <C-w>l
nmap <silent> ,/ :nohlsearch<CR>
@taoy
taoy / .vimrc
Last active February 14, 2020 03:45
Sample Simple vimrc
set title
syntax on
set hidden
set nowrap
set textwidth=98
set shiftwidth=4
set tabstop=4
set expandtab
set softtabstop=4
set shiftround
@taoy
taoy / encmount.sh
Last active December 11, 2015 07:17
mount-encrypted file on debian
#!/bin/bash
sudo /sbin/losetup /dev/loop2 ~/Documents/.encrypt/encrypted.img
sudo /sbin/cryptsetup luksOpen /dev/loop2 encrypted
sudo mount -t ext4 /dev/mapper/encrypted ~/Documents/drive/
@taoy
taoy / .bashrc
Last active February 14, 2020 03:42
Debian sid bashrc modified.
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
@taoy
taoy / normalize.py
Created December 16, 2015 01:08
Python (2.7) Normalize Japanese Text File. (Hankaku, Zenkaku)
import unicodedata
filename = 'somefilename.txt'
f = open(file, 'r')
r = f.read()
f.close()
ur = r.decode('utf-8')
n = unicodedata.normalize('NFKC', ur)
outfile = 'outfile.txt'
f = open(outfile, 'wb')
f.write(n.encode('utf-8'))
@taoy
taoy / gist:ee3d9f042fb42c7aec9c08e3e1b74e01
Last active April 11, 2016 02:23
debian resolvconf resolving local dns
in /etc/dhcp/dhclient.conf,
write this
supersede domain-name "";
also, remove avahi-daemon or
edit /etc/avahi/avahi-daemon.conf
[server]
domain-name=.alocal