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 / config
Last active October 1, 2023 09:13
vcxsrv + i3 on WSL/WSL2 Debian
# .config/i3/config
# 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)
#
@taoy
taoy / sync-packages.md
Last active January 27, 2020 01:55
Install packages on an old environment to the new environment on Debian GNU/Linux

Install Packages in an old environment to the New Environment on Debian GNU/Linux

Reffered URL

  1. At the Old environment, do this: $ sudo dpkg --get-selections "*" > packages.txt
  2. After copy that packages.txt to the New environment, do these following.
    1. $ apt-cache dumpavail > tmpdump
    2. $ sudo dpkg --merge-avail tmpdump
    3. $ sudo dpkg --set-selections < packages.txt
  3. $ sudo apt dselect-upgrade
@taoy
taoy / Install-Manjaro-hyper-v-Proxy.md
Last active August 8, 2021 11:55
Install Manjaro Linux on Hyper-V under Proxy

Install Manjaro Linux - Hyper-V / Proxied Network

Manjaro Linux's ISOs are booting into Graphical UI (X.org), but unfortunately, LiveMedia of Manjaro doesn't have FBDEV driver for X server.

To run install script for Manjaro needs X server running, so to do that you need to install fbdev driver.

And if you're under proxied network, to install driver, you need to setup proxy configuration.

Proxy configuration to update package manager and package.

@taoy
taoy / class_interactive_sample.py
Created June 14, 2017 09:45
Python class script for import with instant interactive shell
# -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import unicode_literals
import logging
logger = logging.getLogger(__name__)
__author__ = 'TAO Yuichi'
@taoy
taoy / panothumbdown.py
Last active September 1, 2016 10:24
python threading and queue.
#! /usr/bin/env python
import sys
import logging
import json
import threading
import requests
import re
import Queue
from threading import Thread
from io import open as iopen
@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
@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 / .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 / 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 / .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