Skip to content

Instantly share code, notes, and snippets.

View pinebright's full-sized avatar

Kosuke MATSUOKA pinebright

View GitHub Profile
@pinebright
pinebright / elapsed_time.py
Created November 8, 2016 04:41
measuring elapsed time in Python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'Kosuke MATSUOKA <[email protected]>'
def elapsed_time(func):
def wrapper(*args, **kwargs):
import time
@pinebright
pinebright / .editorconfig
Created December 2, 2016 06:03
よく使うEditorConfig
# EditorConfig is awesome: http://EditorConfig.org
# top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true
@pinebright
pinebright / Vagrantfile
Created May 26, 2017 09:58
Simple Vagrantfile for Node.js app
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
# Every Vagrant development environment requires a box. You can search for
# boxes at https://atlas.hashicorp.com/search.
config.vm.box = "ubuntu/trusty64"
# Create a private network, which allows host-only access to the machine
# using a specific IP.
@pinebright
pinebright / Vagrantfile
Last active May 29, 2017 23:43
docker & docker-compose always new version
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
# Every Vagrant development environment requires a box. You can search for
# boxes at https://atlas.hashicorp.com/search.
config.vm.box = "ubuntu/trusty64"
# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine. In the example below,
@pinebright
pinebright / dd-info.sh
Last active November 13, 2017 12:32
定期的にddに進捗を表示させる
# ddとは別ターミナルで
sudo watch -n 60 "pkill -USR1 dd"
@pinebright
pinebright / mkdebian.sh
Last active September 16, 2019 16:43
debian化
#!/bin/sh
device=/dev/$(lsblk -lno NAME | sed '/2/!d')
targetdir=/mnt/sdcard
# mirror=http://ftp.uni-stuttgrat.de/debian
distro=jessie
rootfsdir=/tmp/rootfs
hostname=debian
@pinebright
pinebright / file1.sh
Last active February 16, 2018 12:14
[C]同じ実行ファイルをシンボリックリンク名で使い分けるサンプルコード ref: https://qiita.com/pinebright/items/6eb5254e6d01bdebb46b
$ gcc main.c
$ ln -s a.out test_a
$ ln -s a.out test_b
$ ./test_a
test_a: called
$ ./test_b
test_b: called
@pinebright
pinebright / monokai-ricty-discord-powerline.json
Created November 20, 2018 03:43
concfg用設定 (monokai, ricty diminished discord w/ powerline pathed)
{
"cursor_size": "small",
"font_face": "Ricty Diminished Discord for Po",
"font_size": "0x14",
"popup_colors": "dark_red,dark_blue",
"dark_gray": "#f92672",
"screen_colors": "dark_magenta,black",
"dark_green": "#49483e",
"command_history_no_duplication": false,
"window_size": "80x25",
@pinebright
pinebright / Makefile
Created March 27, 2019 11:35
汎用的なmakefile
CC = $(CROSS_COMPILE)gcc
STRIP = $(CROSS_COMPILE)strip
CFLAGS = -MMD -MP -Wall -Wextra -Winit-self -Wno-missing-field-initializers
INCLUDES = -I$(DEVROOT)/include
LDFLAGS = -L$(DEVROOT)/lib
LIBS =
SRCS = $(foreach srcdir, $(shell find ./src -type d), $(wildcard $(srcdir)/*.c))
OBJS = $(subst ./src/, ./obj/, $(SRCS:.c=.o))
DEPS = $(OBJS:.o=.d)
TARGETS = program_name
@pinebright
pinebright / createWordList.py
Created September 1, 2019 00:55
dele で類推されるパスワードの生成に使っていたPythonスクリプトの再現
import argparse
import itertools
parser = argparse.ArgumentParser()
parser.add_argument('words', nargs='*')
parser.add_argument('--output', '-o')
args = parser.parse_args()