Skip to content

Instantly share code, notes, and snippets.

View kotashiratsuka's full-sized avatar

Kota Shiratsuka kotashiratsuka

View GitHub Profile
#!/bin/sh
# PROVIDE: sidekiq
# REQUIRE: LOGIN DAEMON NETWORKING redis
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to enable sidekiq:
# sidekiq_enable (bool): Set to "NO" by default.
# Set it to "YES" to enable sidekiq
# vim: set ff=unix tabstop=4 shiftwidth=0 softtabstop=-1 noexpandtab fileencoding=utf-8 fileformat=unix filetype=zsh :#
# https://gist.github.com/kotashiratsuka/89fad9fd3edd2bec96a78dbc71c8d99b
#/usr/local/binを優先
PATH=/usr/local/bin:$PATH
#${HOME}/binをパスに追加
PATH=${PATH}:~/bin
#MacPorsのvimを優先
# vim: set ff=unix tabstop=4 shiftwidth=0 softtabstop=-1 noexpandtab fileencoding=utf-8 fileformat=unix filetype=zsh :
# https://gist.github.com/kotashiratsuka/8b345e37fac98b71cbd6464c027bfe2c
#coredumpファイルを作らせないようにする
ulimit -c 0
#日本語を使う
export LANG="ja_JP.UTF-8"
if [ ! -f ~/.zshrc.zwc -o ~/.zshrc -nt ~/.zshrc.zwc ]; then
# vim: set ff=unix tabstop=4 shiftwidth=0 softtabstop=-1 noexpandtab fileencoding=utf-8 fileformat=unix filetype=zsh foldmethod=marker :
# https://gist.github.com/kotashiratsuka/e1480b2dba48c1a85f9b60a3c1850bb5
#$PATH の重複をなくす
typeset -U path cdpath fpath manpath
#補完機能を使用する
autoload -U compinit
compinit
zstyle ':completion::complete:*' use-cache true
@kotashiratsuka
kotashiratsuka / setup.sh
Last active June 21, 2022 07:09
setup.sh
#!/bin/sh -x
# curl -L https://gist.github.com/kotashiratsuka/7bee5455b80b573a2b471ca608eccbd4/raw | sh
cd
test .ssh || mkdir -m 700 .ssh
( umask 077; touch .ssh/authorized_keys )
curl -L https://github.com/kotashiratsuka.keys | grep ed25519 >> .ssh/authorized_keys
# vim: set ff=unix tabstop=4 shiftwidth=0 softtabstop=-1 noexpandtab fileencoding=utf-8 fileformat=unix filetype=sh :
# https://gist.github.com/kotashiratsuka/9bc60430fb46d586a86806626f0793cc
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
@kotashiratsuka
kotashiratsuka / .tmux.conf
Last active June 2, 2021 16:59
.tmux.conf
# vim: set ff=unix tabstop=4 shiftwidth=0 softtabstop=-1 noexpandtab fileencoding=utf-8 fileformat=unix filetype=tmux :
#https://gist.github.com/kotashiratsuka/8b4a17429053f79f75566fadb8bf1d95
# Screen Compatible
unbind C-b
set -g prefix C-z
# prefix-keyの有効時間
#set -g repeat-time 1000
" vim: set ff=unix tabstop=4 shiftwidth=0 softtabstop=-1 noexpandtab fileencoding=utf-8 fileformat=unix filetype=vim foldmethod=marker :
" https://gist.github.com/kotashiratsuka/eac44d7e569f3721be5a12b8c221cab6
" 基本コンセプト
" * scp1ファイルで環境移行済ます
" * mac/win/linux/ios環境依存しない、エラーが出ない
" * 自分以外の人が触っても混乱しないようにする(rootで複数人が使う場合などに配慮)
" * プラグインは極力使わない、プラグインは補助輪と割り切る、どうせ数年立ったら使わなくなる
" * プラグイン強化するくらいならその分vimの標準操作を速くできるように頭と指を鍛える
" * tips混じってるけど気にしない
# 基本形
git lfs init
git lfs track "*.rpm"
git lfs track "*.srpm"
git lfs ls-files
git add -A
git commit -m 'Adding $file lfs style'
# *.xxx のファイルを全てLFSへ移行 ref https://github.com/github/git-lfs/issues/326
@kotashiratsuka
kotashiratsuka / Vagrantfile
Last active August 29, 2015 14:11
ZFS on Linux for Vagrant + VMWare Fusion | Virtualbox
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "insaneworks/centos"
config.vm.provider :vmware_fusion do |vmf, override|
vdiskmanager = '/Applications/VMware\ Fusion.app/Contents/Library/vmware-vdiskmanager'