Skip to content

Instantly share code, notes, and snippets.

@emil-palm
Created March 23, 2010 09:43
Show Gist options
  • Save emil-palm/340995 to your computer and use it in GitHub Desktop.
Save emil-palm/340995 to your computer and use it in GitHub Desktop.
function get_latest_html()
{
URL=$1
PATTERN=$2
TYPE=$3
LATEST=`curl -s ${URL} | egrep -o '<a href="([^\"]+)"' | awk -F\" '{print $2 }' | egrep ${PATTERN} | egrep ${TYPE} | egrep -v '(diff|sig)' | sort -nr | head -n1`
curl -s "${URL}/${LATEST}"
}
function get_latest_text()
{
URL=$1
PATTERN=$2
TYPE=$3
LATEST=`curl -s ${URL} | egrep ${PATTERN} | egrep ${TYPE} | egrep -v '(diff|sig)' | awk '{print $9}' | sort -nr | head -n1`
curl -s "${URL}/${LATEST}"
}
# GPG (if you didn't have it already)
get_latest_text "ftp://ftp.gnupg.org/gcrypt/gnupg/" "gnupg" "tar\.bz2" | tar xj
cd gnupg-*
./configure
make
sudo make install
cd ..
# GetText
get_latest_html "http://mirrors.usc.edu/pub/gnu/gettext/" "gettext" "tar\.gz" | tar xz
cd gettext-*
./configure
make
sudo make install
cd ..
# GIT
get_latest_html "http://kernel.org/pub/software/scm/git/" "git-[0-9]+" "tar\.bz2" | tar xj
cd git-*
./configure
make
sudo make install
cd ..
get_latest_html "http://kernel.org/pub/software/scm/git/" "git-manpages-[0-9]+" "tar\.bz2" | sudo tar xj -C /usr/local/share/man
# alias "g" for "git"
cat >> ~/.profile << \EOF
alias g='git'
EOF
source ~/.profile
git config --global color.diff auto
git config --global color.status auto
git config --global color.branch auto
git config --global color.interactive auto
# shortcuts
git config --global alias.st status
git config --global alias.ci commit
git config --global alias.co checkout
git config --global alias.br branch
if you ever have conflicts you can type git-mergetool
to use Apple opendiff (FileMerge) for resolving conflicts
git config --global merge.tool opendiff
Whenever we merge provide a summary of commits
git config --global merge.summary true
globally ignore some cruft files
git config --global core.excludesfile ~/.gitignore
echo "*~" >~/.gitignore
echo ".DS_Store" >>~/.gitignore
echo -n "Input git username: "
read $USERNAME
git config --global user.name "$USERNAME"
echo -n "Input git email: "
read $EMAIL
git config --global user.email "$EMAIL"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment