You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

102 lines
1.7 KiB

12 years ago
12 years ago
12 years ago
12 years ago
  1. #!/bin/bash
  2. set -eux # -x for verbose logging to juju debug-log
  3. apt-get update
  4. apt-get -y install bash-completion wget bzip2 git-core less language-pack-en python-software-properties tmux sudo git
  5. apt-get -y install mountall ## nasty nfs bug corrected
  6. ##
  7. ## Allows to mount nfs shares
  8. ##
  9. apt-get -y install nfs-common
  10. ##
  11. ## etckeeper
  12. ##
  13. apt-get install etckeeper
  14. sed -i 's/#VCS="git"/VCS="git"/g' /etc/etckeeper/etckeeper.conf
  15. sed -i 's/VCS="bzr"/#VCS="bzr"/g' /etc/etckeeper/etckeeper.conf
  16. etckeeper init
  17. ##
  18. ## Git utilities
  19. ##
  20. echo "[alias]
  21. co = checkout
  22. com = commit
  23. st = status
  24. ci = commit
  25. [color]
  26. branch = auto
  27. diff = auto
  28. interactive = auto
  29. status = auto
  30. " >> /etc/gitconfig
  31. ##
  32. ## ldap client
  33. ##
  34. ##
  35. ## kal-scripts
  36. ##
  37. cat <<EOF >> /etc/apt/sources.list
  38. ## vlab's shell libraries
  39. deb http://deb.kalysto.org no-dist kal-alpha kal-beta kal-main
  40. EOF
  41. ##
  42. ## More shell configurations (prompt, functions)
  43. ##
  44. mkdir -p /etc/prompt
  45. cat <<EOF > /etc/prompt/prompt.1.rc
  46. PROMPT_COMMAND=""
  47. parse_git_branch() {
  48. ref=\$(git symbolic-ref HEAD 2> /dev/null) || return
  49. echo -en ' (\033[0;32m'\${ref#refs/heads/}'\033[0m)'
  50. }
  51. export PS1="\[\033[0;37m\][\[\033[1;30m\]\u\[\033[0;37m\]@\[\033[1;30m\]\h\[\033[0;37m\]]-[\[\033[1;34m\]\w\[\033[0;37m\]]\\\$(parse_git_branch)\n\[\033[1;37m\]\\$ \[\033[0;37m\]"
  52. EOF
  53. cat <<EOF >> /root/.bashrc
  54. # Prompt easy management
  55. prompt() {
  56. prompt_name="prompt.\$1.rc"
  57. for i in /etc/prompt ~/.prompt; do
  58. [ -f "\$i/\$prompt_name" ] &&
  59. . "\$i/\$prompt_name"
  60. done
  61. }
  62. function glog() {
  63. git log --graph --pretty=tformat:%C\(yellow\ normal\)%h%Creset\ %C\(blue\ normal\)%an%Creset\ %s\ %Cgreen%d%Creset -n 20 "\$@"
  64. }
  65. prompt 1
  66. EOF