Skip to content

Instantly share code, notes, and snippets.

@byplayer
byplayer / gist:3629153
Created September 5, 2012 02:05 — forked from freshtonic/gist:1999083
Git hook to disallow non-fastforward updates (also disallows merges into feature branches in order to keep them cleanly rebaseable)
#!/usr/bin/env ruby
# This update hook enforces the following policies
# 1) release and master branches are fast-forward only
# 2) feature branches cannot contain merges
$refname = ARGV[0]
$oldrev = ARGV[1]
$newrev = ARGV[2]
@byplayer
byplayer / gist:3915865
Created October 19, 2012 02:04
VirtualBox IP
# change IP range for NAT
VBoxManage modifyvm "YOUR_VM_NAME" --natnet1 "192.168.0/24"
@byplayer
byplayer / gist:4015386
Last active October 12, 2015 10:48
resize VirtualBox disk
# 固定サイズ → 可変サイズに変換
% VBoxManage clonehd <FIXED_VDI> <DYNAMIC_VDI> --format VDI --variant Standard
# 仮想ディスクを拡張
% VBoxManage modifyhd <DYNAMIC_VDI> --resize <NEW_SIZE> ← サイズは MB で指定 (例: 10GB = 10240)
# 可変サイズ → 固定サイズに変換
% VBoxManage clonehd <DYNAMIC_VDI> <NEW_FIXED_VDI> --format VDI --variant Fixed
# hide menu and status bar
@byplayer
byplayer / ADT
Last active December 14, 2015 18:49
FindBugs
http://findbugs.cs.umd.edu/eclipse
CheckStyle
http://eclipse-cs.sourceforge.net/update
PMD
http://sourceforge.net/projects/pmd/files/pmd-eclipse/update-site/
JAutodoc
@byplayer
byplayer / eclipse.txt
Last active December 14, 2015 21:09
eclipse cheat sheet
C-S-l ショートカット一覧を表示
F12 Cmd+F12 エディタへ
Ctrl+E Cmd+E エディタ切替・一覧から
Ctrl+PageUp Ctrl+Fn+↑ エディタ切替・前
Ctrl+PageDown Ctrl+Fn+↓ エディタ切替・後
Ctrl+M Ctrl+M エディタ最大化
Ctrl+W Cmd+W エディタ閉じる
Ctrl+Shift+T Cmd+Shift+T クラスを開く

仮想ディスクを圧縮する

仮想ディスクを圧縮する 仮想ディスクの空き領域を0で埋める OSがファイルを削除する場合、実際にはファイルのインデックス情報を削除するだけで、ファイルの実体は削除されません。 圧縮する前に仮想ディスクの空き領域を0で埋める必要があります。 Windowsではマイクロソフトから空き領域を0で上書きするsdeleteツールが無料で提供されているので、これを利用します。 コマンドプロンプトを起動し-zオプションでsdeleteを実行します。

@byplayer
byplayer / Mac
Last active December 21, 2015 06:29
install xcode
install xcode command tools from Preference -> Download
# https://github.com/byplayer/docs/blob/master/git/git_config.txt
# install macports
# $ sudo port install パッケージ名
# $ sudo port uninstall パッケージ名
# $ port variants パッケージ名
#!/bin/bash
function install(){
REPO=$1
DIR=$2
TARGET=$3
BUILD_DIR=~/buildxcodeplugins/work
mkdir -p ${BUILD_DIR}
rm -rf ${BUILD_DIR}/*
@byplayer
byplayer / gist:10217861
Created April 9, 2014 01:42
virtualbox dns
VBoxManage modifyvm "Debian 6" --natdnspassdomain1 off --natdnshostresolver1 on
shiftを押して、ubuntuを起動
Ctrl + e で編集
linux /boot/vmlinuz... で始まる行の quiet splash の後に single と追記する
Ctrl + x キーを押して single user mode で起動する
gpasswd -a user_name adm
gpasswd -a user_name sudo