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
# install packages to get RVM | |
sudo apt-get install build-essential git-core curl | |
# install RVM | |
curl -L get.rvm.io | bash -s stable | |
# load RVM | |
echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"' >> ~/.bashrc | |
source "$HOME/.rvm/scripts/rvm" |
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
@echo off | |
rem cd /d e:/proj/oss/jruby | |
call :check_cp 437 775 850 852 855 857 860 861 862 863 864 865 866 869 1250 1251 1252 1253 1254 1255 1256 1257 1258 | |
:check_cp | |
for %%e in (%*) do ( | |
chcp %%e | |
for %%c in (ruby bin\jruby) do ( |
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
# Here is how to directly connect to an Oracle DB without setting up tnsname first. | |
# | |
# sqlplus "$DB_USER/$DB_PASS@( | |
# description= | |
# ( | |
# address_list=( | |
# address= | |
# (protocol=tcp) | |
# (host=$DB_HOST) | |
# (port=$DB_PORT))) |
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
# Usage: | |
# num_formatted=`format_number 12345.6789` | |
# OR | |
# num_formatted=`format_number 12345.6789 . , 3` | |
format_number() { | |
[ $# = 0 ] && retrun | |
raw_num=$1 | |
dec_mark="$2"; [ -z "$dec_mark" ] && dec_mark=. | |
grp_sep="$3"; [ -z "$grp_sep" ] && grp_sep=, |
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
@if "%DEBUG%" == "" @echo off | |
@rem ########################################################################## | |
@rem ## | |
@rem Groovy JVM Bootstrap for Windowz ## | |
@rem ## | |
@rem ########################################################################## | |
@rem | |
@rem $Revision$ $Date$ | |
@rem |
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
# local branches | |
git branch | tr '*' ' ' | tr -d ' ' | |
# all remote branches | |
git branch -a | grep remotes/ | cut -d/ -f3 | |
# subtract | |
grep -F -v -f <(git branch | tr '*' ' ' | tr -d ' ') <(git branch -a | grep remotes/ | cut -d/ -f3) | |
# insert remote name as prefix |
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/sh | |
each_line() { | |
filename="$1" | |
func=$2 | |
line_num=0 | |
while read -r line; do | |
line_num=$((line_num + 1)) | |
$func "$line" $line_num | |
done < "$filename" |
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
swap_xy() { | |
SRC_FILE="$1" | |
n=0 | |
max_width=0 | |
(while read line; do | |
[ -z "`echo $line`" ] && continue | |
n=$((n + 1)) | |
[ $n -eq 1 ] && SEP="" || SEP=" | " | |
num_cells=`echo "$line" | sed "s/[^|]//g" | wc -m` |
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
curl -u username -d "{}" https://api.github.com/authorizations |
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
dpkg -l linux-image-* | awk '/^ii/ {print $2}' | grep -v $(uname -r) | xargs sudo apt-get -y purge | |
sudo update-grub2 | |
#sudo dpkg --clear-avail |