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 | |
# This script helps install postfix SMTP server and plain login authentication without TLS/SSL | |
# | |
# Tested on Ubuntu 12.04 Server | |
sudo aptitude -y install postfix sasl2-bin | |
sudo dpkg-reconfigure postfix |
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 | |
# bash script for installing Rails environment on Ubuntu 12.04 Desktop | |
# | |
# Some sources has been changed to mirrors in China mainland. | |
# | |
# To use this script, do this in your shell: | |
# | |
# $ curl -L https://raw.github.com/gist/2521307/install-rails-12-04-desktop.sh | bash |
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 中 Terminal 下 Bash 提示中显示 git 当前分支和状态 | |
# username@hostname:directory[branch-name]$ # 干净的工作目录 | |
# username@hostname:directory[branch-name*]$ # 不干净的工作目录 | |
function parse_git_dirty { | |
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*" | |
} | |
function parse_git_branch { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/" | |
} |
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
# Mac OS X 中 Terminal 下 Bash 提示中显示 git 当前分支和状态 | |
# hostname:directory[branch-name] username$ # 干净的工作目录 | |
# hostname:directory[branch-name*] username$ # 不干净的工作目录 | |
function parse_git_dirty { | |
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*" | |
} | |
function parse_git_branch { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/" | |
} |