- Backup data to Time machine drive
- Backup some important data to HDD drive manually
- Make a list which directory should be copied into the new OS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# gzsplit.rb | |
# split gz files into pieces | |
# usage: ruby gzsplit [file-name] [lines-per-file] | |
require 'zlib' | |
require 'fileutils' | |
OUTPUT_DIR = "splited_files" | |
file_name = ARGV[0] || "20130910-03_01_00.gz" | |
lines_per_file = ARGV[1] ? ARGV[1].to_i : 5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
tcpdump -s0 -i eth0 -X port 44567 -w test.cap |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ubuntu@box432:~$ lsb_release -a | |
No LSB modules are available. | |
Distributor ID: Ubuntu | |
Description: Ubuntu 12.04.5 LTS | |
Release: 12.04 | |
Codename: precise | |
ubuntu@box432:~$ sudo apt-get install libboost-all-dev | |
Reading package lists... Done | |
Building dependency tree |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
We're using git's Merge commit history to list features&bug fixes in a release tag. But I found cases where no merge commit was made as a result of `git merge`. According to this article (http://arjanvandergaag.nl/blog/clarify-git-history-with-merge-commits.html) it's due to fast-forward merge. To prevent it from happening, use `--no-ff` option when you merge. e.g. `git merge --no-ff feature/u483-asdf-asdf` This create a merge commit even if fast-forward merge is possible. Or, you can make it default with `git config --add merge.ff false` | |
Omit them needless merge commits. Add them to convey information. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RSpec::Matchers.define :terminate do |code| | |
actual = nil | |
def supports_block_expectations? | |
true | |
end | |
match do |block| | |
begin | |
block.call |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## rvm bash install script reading memo | |
## Based on https://github.com/wayneeseguin/rvm/blob/1.25.28/binscripts/rvm-installer | |
#!/usr/bin/env bash | |
# enable extended pattern matching | |
# shopt command changes the shell optional behavior | |
# extglob option enables you to write like `ls !(b*)` | |
# http://stackoverflow.com/questions/216995/how-can-i-use-inverse-or-negative-wildcards-when-pattern-matching-in-a-unix-linu | |
shopt -s extglob |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat /dev/urandom | LC_CTYPE=C tr -dc '[:alnum:]' | head -c 40 && echo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ gem -v | |
2.0.3 | |
$ gem list rubygems-update | |
$ gem uninstall -v 2.0.3 rubygems-update | |
$ gem install -v 1.8.24 rubygems-update | |
$ update_rubygems | |
$ gem -v | |
1.8.24 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dir_path=$(cd $(dirname $0);pwd) |