Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

setup.sh 2.6 KiB

12 anos atrás
12 anos atrás
12 anos atrás
12 anos atrás
12 anos atrás
12 anos atrás
12 anos atrás
12 anos atrás
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. #!/bin/sh
  2. mkdir -p ~/.my/log
  3. mkdir -p ~/.local/bin
  4. install_script(){
  5. local dir="$HOME/.local/bin"
  6. mkdir -p "$dir"
  7. for f in "$@"
  8. do
  9. bn=$(basename "$f")
  10. type $bn >/dev/null 2>&1 || {
  11. if type wget >/dev/null 2>&1
  12. then
  13. wget "$f" -P "$dir/" &&
  14. chmod u+x "${dir}/${bn}"
  15. elif type curl >/dev/null 2>&1
  16. then
  17. curl --url "$f" --output "${dir}/${bn}" &&
  18. chmod u+x "${dir}/${bn}"
  19. fi
  20. }
  21. done
  22. }
  23. install_symlink_script(){
  24. mkdir -p "$HOME/.local/bin/"
  25. for f in "$@"
  26. do
  27. ln -s "$PWD/$f" "$HOME/.local/bin/"
  28. done
  29. }
  30. git_config(){
  31. git config --global user.name '10sr'
  32. git config --global user.email '8slashes+git@gmail.com'
  33. git config --global core.autocrlf false
  34. git config --global core.excludesfile '~/.gitignore'
  35. git config --global color.ui auto
  36. git config --global status.relativePaths false
  37. git config --global status.showUntrackedFiles normal
  38. git config --global log.date iso
  39. git config --global alias.graph "log --graph --date-order -C -M --pretty=tformat:\"<%h> %ad [%an] %Cgreen%d%Creset %s\" --all --date=iso"
  40. git config --global alias.st "status -s -b"
  41. git config --global alias.b "branch"
  42. git config --global alias.ci "commit --verbose"
  43. git config --global alias.co "checkout"
  44. git config --global alias.cim "commit --verbose -m"
  45. git config --global alias.di "diff --color"
  46. git config --global alias.me "merge --no-ff --stat -v"
  47. git config --global alias.ls "ls-files -v --full-name"
  48. git config --global alias.sl "!sl"
  49. # git config --global alias.my-ls "ls-files | xargs ls"
  50. # git config --global alias.ll "!git ls-files | xargs ls -l -CFG --color=auto --time-style=long-iso"
  51. git config --global alias.addi "add -i"
  52. if false iswindows; then
  53. git config --global core.fileMode false
  54. fi
  55. }
  56. mac_defaults(){
  57. # add quit entry in menu
  58. defaults write com.apple.finder QuitMenuItem -bool YES
  59. # show full path on titlebar
  60. defaults write com.apple.finder _FXShowPosixPathInTitle -bool YES
  61. # do not show desktop icons
  62. defaults write com.apple.finder CreateDesktop -boolean false
  63. killall finder
  64. # disable dashboard
  65. #defaults write com.apple.dashboard mcx-disabled -bool YES
  66. }
  67. gen_source_script(){
  68. # _gen_source_script file lines
  69. test $# -eq 2 || return 1
  70. head -n $2 $1 | \grep -v '^#!' | sed -e 's/^..//g'
  71. }
  72. install_script http://www.frexx.de/xterm-256-notes/data/colortable16.sh http://www.frexx.de/xterm-256-notes/data/256colors2.pl
  73. type git >/dev/null 2>&1 && _my_git_config