Skip to content

Instantly share code, notes, and snippets.

@mollifier
mollifier / rsa_decrypt.sh
Created February 10, 2021 14:55
RSA暗号で復号化するシェルスクリプト
#!/bin/bash
# RSA暗号で復号化します
# 使い方
# rsa_decrypt.sh -d 秘密鍵dのファイル -n 公開鍵nのファイル 暗号文となる数字
# 例
# rsa_decrypt.sh -d private_key_a/d.txt -n public_key/n_a.txt 16
set -e
@mollifier
mollifier / rsa_encrypt.sh
Last active February 10, 2021 14:56
RSA暗号で暗号化するシェルスクリプト
#!/bin/bash
# RSA暗号で暗号化します
# 使い方
# rsa_encrypt.sh -e 公開鍵eのファイル -n 公開鍵nのファイル 平文となる数字
# 例
# rsa_encrypt.sh -n public_key/n_a.txt -e public_key/e_a.txt 4
set -e
@mollifier
mollifier / example_tmux.conf
Created September 23, 2020 15:24
簡単なtmux.confの例
# 簡単なtmux.confの例
# プレフィックスキーをCtrl+tに変更する
unbind-key C-b
set-option -g prefix C-t
bind-key C-t send-prefix
# Ctrlを押したままウィンドウの切り替えができるようにする
bind-key C-c new-window
bind-key C-n next-window
@mollifier
mollifier / vimrc_example
Last active July 18, 2020 05:43
vimrcの例
" vimrcの例
" 行番号を表示する
set number
" 現在のモードを表示する
set showmode
" 入力中のコマンドを表示する
set showcmd
if which peco &> /dev/null; then
function peco_select_history() {
BUFFER=$(fc -l -n -r 1 | \
peco --layout=bottom-up --query "$LBUFFER")
CURSOR=$#BUFFER # move cursor
zle -R -c # refresh
}
zle -N peco_select_history
bindkey '^R' peco_select_history
FROM node:0.10.36
MAINTAINER "Hideaki Miyake" <mollifier@gmail.com>
RUN mkdir -p /usr/local/app
WORKDIR /usr/local/app
RUN git clone https://github.com/emanon001/drinking-water-watcher.git
RUN cd drinking-water-watcher && npm install
ENTRYPOINT cd /usr/local/app/drinking-water-watcher && npm start
@mollifier
mollifier / autols.zsh
Created October 6, 2014 12:46
zshで存在しないコマンドを実行しようとしたときはlsを行うようにする
# これを.zshrcに書く
function command_not_found_handler() {
shift
ls "$@"
}
@mollifier
mollifier / .zshrc_word-chars
Last active September 11, 2021 05:13
zsh で / や . も単語の区切り文字とみなす設定
# .zshrcに書く
# word-chars で指定した文字が単語の区切りとみなされる。
# M-f, M-b, ^w などの動作に影響する
autoload -Uz select-word-style
select-word-style default
zstyle ':zle:*' word-chars ' /=;@:{}[]()<>,|.'
zstyle ':zle:*' word-style unspecified
@mollifier
mollifier / wip-pr
Last active August 29, 2015 14:00 — forked from bouzuya/wip-pr
#!/bin/bash
# Description:
# Backlog + git-flow + WIP PR script
# Usage:
# wip-pr pj-123
#
# Requirement:
# use Mac OS X
@mollifier
mollifier / double_space_keybind.zsh
Created November 25, 2013 03:27
zsh で連続したスペースにキーバインドを割り当てる ref: http://qiita.com/mollifier/items/2ba8ebddc222f9d21b6d
function _double_space_to_git() {
if [[ "${BUFFER}" == " " ]]; then
LBUFFER="git "
else
zle self-insert
fi
}
zle -N _double_space_to_git
bindkey ' ' _double_space_to_git