Tuesday, April 26, 2011

my ~/.gitconfig file

[user]
name = Viktor Kelemen

[color]
diff = auto
status = auto
branch = auto
interactive = auto
ui = true
pager = true

[color "status"]
added = yellow
changed = green
untracked = cyan

[core]
pager = less -FRSX
whitespace=fix,-indent-with-non-tab,trailing-space,cr-at-eol

[alias]
co = checkout
st = status
ci = commit
co = checkout
w = whatchanged
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative


You can find more about .gitconfig customization on Hackernews or on Stackoverflow

Thursday, April 21, 2011

Get HTTP status code with curl in bash


curl --write-out %{http_code} --silent --output /dev/null URL

and then wrapping it into a function

getHTTPCode () {
echo $(curl --write-out %{http_code} --silent --output /dev/null $1)
}

response=$(getHTTPCode URL)
echo $response

Monday, April 18, 2011

Failed to install db46 on Snow Leopard

I have a brand new macbook (2011/04/19) and have some trouble with installing db46 with ports

port install db46

fails badly and complains about dependencies.

The easiest fix is to install it without java (and you don't need java)

sudo port -v selfupdate
port clean db46
port install db46 +no_java


There are other articles about this problem, How to fix db46 problem macport installation
or MacPorts 1.8.2 fails to build db46 on Mac OS X 1.6.3

Friday, April 15, 2011

Joyent Smartmachine Nodejs log


tail -f /var/svc/log/site-node-service\:default.log

Thursday, April 14, 2011

Reset Joyent Smartmachine Nodejs git repo


cd ~
rm -rf repo
mkdir repo
cd repo
git --bare init
cp /opt/nodejs/post-receive* hooks/
cd ~


Deleting the old repo, creating a new one and then copy the post-recieve hooks.