├── LICENSE ├── README.md ├── bin ├── colortest ├── git-brst ├── git-cm ├── git-publish ├── git-uncommit ├── tat └── tmuxinator.zsh ├── bootstrap └── lib └── default.yml /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 Joshua Steele 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Linux Bootstrap 2 | =============== 3 | 4 | The purpose of this script is to provision a new machine running a fresh install of Ubuntu or other Debian-type Linux system. It includes the software, dotfiles, and general preference I use for web development. The command line environment is based on zsh, vim and tmux. This setup is intended for a personal development machine, not a web-facing server. 5 | 6 | ▹ **Running macOS? Check out [Mac Bootstrap](http://jsua.co/macos).** 7 | 8 | Supported distros 9 | ----------------- 10 | 11 | This script has been successfully tested on the following Linux distros: 12 | 13 | * Ubuntu 14.04, 15.04, 16.04 14 | * Lubuntu 14.10, 15.04 15 | * Debian 7.8, 8.2 16 | 17 | Installation 18 | ------------ 19 | 20 | To install with a one-liner, run this: 21 | 22 | ```sh 23 | bash <(wget -qO- https://raw.githubusercontent.com/joshukraine/linux-bootstrap/master/bootstrap) 2>&1 | tee ~/bootstrap.log 24 | ``` 25 | 26 | Want to read through the script first? 27 | 28 | ```sh 29 | wget -qO- https://raw.githubusercontent.com/joshukraine/linux-bootstrap/master/bootstrap > bootstrap 30 | less bootstrap 31 | bash bootstrap 2>&1 | tee ~/bootstrap.log 32 | ``` 33 | 34 | What does it do? 35 | ---------------- 36 | 37 | When you invoke `bootstrap`, this is what it does in a nutshell: 38 | 39 | * Patch the system and install various software packages. 40 | * Install [oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh). 41 | * Symlink dotfiles to `$HOME` 42 | * Install several fixed-width fonts. 43 | * Install Vundle and plugins for vim. 44 | * Install [rbenv](https://github.com/sstephenson/rbenv) and [ruby-build](https://github.com/sstephenson/ruby-build#readme). 45 | * Install Ruby and Bundler. 46 | * Set up Tmuxinator. 47 | 48 | 49 | Some of my favorite dotfile repos 50 | --------------------------------- 51 | 52 | * Pro Vim (https://github.com/Integralist/ProVim) 53 | * Trevor Brown (https://github.com/Stratus3D/dotfiles) 54 | * Lars Kappert (https://github.com/webpro/dotfiles) 55 | * Ryan Bates (https://github.com/ryanb/dotfiles) 56 | * thoughtbot (https://github.com/thoughtbot/dotfiles) 57 | * Ben Orenstein (https://github.com/r00k/dotfiles) 58 | * Joshua Clayton (https://github.com/joshuaclayton/dotfiles) 59 | * Drew Neil (https://github.com/nelstrom/dotfiles) 60 | * Chris Toomey (https://github.com/christoomey/dotfiles) 61 | * Kevin Suttle (https://github.com/kevinSuttle/OSXDefaults) 62 | * Carlos Becker (https://github.com/caarlos0/dotfiles) 63 | * Zach Holman (https://github.com/holman/dotfiles/) 64 | * Mathias Bynens (https://github.com/mathiasbynens/dotfiles/) 65 | * Paul Irish (https://github.com/paulirish/dotfiles) 66 | 67 | 68 | Helpful web resources on dotfiles, et al. 69 | ----------------------------------------- 70 | 71 | * http://dotfiles.github.io/ 72 | * https://medium.com/@webprolific/getting-started-with-dotfiles-43c3602fd789 73 | * http://code.tutsplus.com/tutorials/setting-up-a-mac-dev-machine-from-zero-to-hero-with-dotfiles--net-35449 74 | * https://github.com/webpro/awesome-dotfiles 75 | * http://blog.smalleycreative.com/tutorials/using-git-and-github-to-manage-your-dotfiles/ 76 | * http://carlosbecker.com/posts/first-steps-with-mac-os-x-as-a-developer/ 77 | * https://mattstauffer.co/blog/setting-up-a-new-os-x-development-machine-part-1-core-files-and-custom-shell 78 | * http://blog.smalleycreative.com/tutorials/using-git-and-github-to-manage-your-dotfiles/ 79 | 80 | License 81 | ------- 82 | 83 | Copyright (c) 2016 Joshua Steele. [MIT License](https://github.com/joshukraine/linux-bootstrap/blob/master/LICENSE) 84 | -------------------------------------------------------------------------------- /bin/colortest: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | # by entheon, do whatever the hell you want with this file 4 | 5 | print "\n"; 6 | print "**************************\n"; 7 | print "*XTERM 256Color Test Chart\n"; 8 | print "**************************\n"; 9 | print "* 16 = black\n"; 10 | print "* 255 = white\n"; 11 | print "*\n"; 12 | print "* Usage:\n"; 13 | print "* colortest -w\n"; 14 | print "* wide display\n"; 15 | print "*\n"; 16 | print "* colortest -w -r\n"; 17 | print "* wide display reversed\n"; 18 | print "*\n"; 19 | print "* colortest -w -s\n"; 20 | print "* extra spaces padding\n"; 21 | print "*\n"; 22 | print "* colortest -w -r -s\n"; 23 | print "* available combination\n"; 24 | print "*\n"; 25 | print "**************************\n"; 26 | 27 | if( $ARGV[0] eq "-w" || $ARGV[1] eq "-w" || $ARGV[2] eq "-w" ) { 28 | push(@arr, [( " 16: 00/00/00", " 17: 00/00/5f", " 18: 00/00/87", " 19: 00/00/af", " 20: 00/00/d7", " 21: 00/00/ff")] ); 29 | push(@arr, [( " 22: 00/5f/00", " 23: 00/5f/5f", " 24: 00/5f/87", " 25: 00/5f/af", " 26: 00/5f/d7", " 27: 00/5f/ff")] ); 30 | push(@arr, [( " 28: 00/87/00", " 29: 00/87/5f", " 30: 00/87/87", " 31: 00/87/af", " 32: 00/87/d7", " 33: 00/87/ff")] ); 31 | push(@arr, [( " 34: 00/af/00", " 35: 00/af/5f", " 36: 00/af/87", " 37: 00/af/af", " 38: 00/af/d7", " 39: 00/af/ff")] ); 32 | push(@arr, [( " 40: 00/d7/00", " 41: 00/d7/5f", " 42: 00/d7/87", " 43: 00/d7/af", " 44: 00/d7/d7", " 45: 00/d7/ff")] ); 33 | push(@arr, [( " 46: 00/ff/00", " 47: 00/ff/5f", " 48: 00/ff/87", " 49: 00/ff/af", " 50: 00/ff/d7", " 51: 00/ff/ff")] ); 34 | push(@arr, [( " 52: 5f/00/00", " 53: 5f/00/5f", " 54: 5f/00/87", " 55: 5f/00/af", " 56: 5f/00/d7", " 57: 5f/00/ff")] ); 35 | push(@arr, [( " 58: 5f/5f/00", " 59: 5f/5f/5f", " 60: 5f/5f/87", " 61: 5f/5f/af", " 62: 5f/5f/d7", " 63: 5f/5f/ff")] ); 36 | push(@arr, [( " 64: 5f/87/00", " 65: 5f/87/5f", " 66: 5f/87/87", " 67: 5f/87/af", " 68: 5f/87/d7", " 69: 5f/87/ff")] ); 37 | push(@arr, [( " 70: 5f/af/00", " 71: 5f/af/5f", " 72: 5f/af/87", " 73: 5f/af/af", " 74: 5f/af/d7", " 75: 5f/af/ff")] ); 38 | push(@arr, [( " 76: 5f/d7/00", " 77: 5f/d7/5f", " 78: 5f/d7/87", " 79: 5f/d7/af", " 80: 5f/d7/d7", " 81: 5f/d7/ff")] ); 39 | push(@arr, [( " 82: 5f/ff/00", " 83: 5f/ff/5f", " 84: 5f/ff/87", " 85: 5f/ff/af", " 86: 5f/ff/d7", " 87: 5f/ff/ff")] ); 40 | push(@arr, [( " 88: 87/00/00", " 89: 87/00/5f", " 90: 87/00/87", " 91: 87/00/af", " 92: 87/00/d7", " 93: 87/00/ff")] ); 41 | push(@arr, [( " 94: 87/5f/00", " 95: 87/5f/5f", " 96: 87/5f/87", " 97: 87/5f/af", " 98: 87/5f/d7", " 99: 87/5f/ff")] ); 42 | push(@arr, [( " 100: 87/87/00", " 101: 87/87/5f", " 102: 87/87/87", " 103: 87/87/af", " 104: 87/87/d7", " 105: 87/87/ff")] ); 43 | push(@arr, [( " 106: 87/af/00", " 107: 87/af/5f", " 108: 87/af/87", " 109: 87/af/af", " 110: 87/af/d7", " 111: 87/af/ff")] ); 44 | push(@arr, [( " 112: 87/d7/00", " 113: 87/d7/5f", " 114: 87/d7/87", " 115: 87/d7/af", " 116: 87/d7/d7", " 117: 87/d7/ff")] ); 45 | push(@arr, [( " 118: 87/ff/00", " 119: 87/ff/5f", " 120: 87/ff/87", " 121: 87/ff/af", " 122: 87/ff/d7", " 123: 87/ff/ff")] ); 46 | push(@arr, [( " 124: af/00/00", " 125: af/00/5f", " 126: af/00/87", " 127: af/00/af", " 128: af/00/d7", " 129: af/00/ff")] ); 47 | push(@arr, [( " 130: af/5f/00", " 131: af/5f/5f", " 132: af/5f/87", " 133: af/5f/af", " 134: af/5f/d7", " 135: af/5f/ff")] ); 48 | push(@arr, [( " 136: af/87/00", " 137: af/87/5f", " 138: af/87/87", " 139: af/87/af", " 140: af/87/d7", " 141: af/87/ff")] ); 49 | push(@arr, [( " 142: af/af/00", " 143: af/af/5f", " 144: af/af/87", " 145: af/af/af", " 146: af/af/d7", " 147: af/af/ff")] ); 50 | push(@arr, [( " 148: af/d7/00", " 149: af/d7/5f", " 150: af/d7/87", " 151: af/d7/af", " 152: af/d7/d7", " 153: af/d7/ff")] ); 51 | push(@arr, [( " 154: af/ff/00", " 155: af/ff/5f", " 156: af/ff/87", " 157: af/ff/af", " 158: af/ff/d7", " 159: af/ff/ff")] ); 52 | push(@arr, [( " 160: d7/00/00", " 161: d7/00/5f", " 162: d7/00/87", " 163: d7/00/af", " 164: d7/00/d7", " 165: d7/00/ff")] ); 53 | push(@arr, [( " 166: d7/5f/00", " 167: d7/5f/5f", " 168: d7/5f/87", " 169: d7/5f/af", " 170: d7/5f/d7", " 171: d7/5f/ff")] ); 54 | push(@arr, [( " 172: d7/87/00", " 173: d7/87/5f", " 174: d7/87/87", " 175: d7/87/af", " 176: d7/87/d7", " 177: d7/87/ff")] ); 55 | push(@arr, [( " 178: d7/af/00", " 179: d7/af/5f", " 180: d7/af/87", " 181: d7/af/af", " 182: d7/af/d7", " 183: d7/af/ff")] ); 56 | push(@arr, [( " 184: d7/d7/00", " 185: d7/d7/5f", " 186: d7/d7/87", " 187: d7/d7/af", " 188: d7/d7/d7", " 189: d7/d7/ff")] ); 57 | push(@arr, [( " 190: d7/ff/00", " 191: d7/ff/5f", " 192: d7/ff/87", " 193: d7/ff/af", " 194: d7/ff/d7", " 195: d7/ff/ff")] ); 58 | push(@arr, [( " 196: ff/00/00", " 197: ff/00/5f", " 198: ff/00/87", " 199: ff/00/af", " 200: ff/00/d7", " 201: ff/00/ff")] ); 59 | push(@arr, [( " 202: ff/5f/00", " 203: ff/5f/5f", " 204: ff/5f/87", " 205: ff/5f/af", " 206: ff/5f/d7", " 207: ff/5f/ff")] ); 60 | push(@arr, [( " 208: ff/87/00", " 209: ff/87/5f", " 210: ff/87/87", " 211: ff/87/af", " 212: ff/87/d7", " 213: ff/87/ff")] ); 61 | push(@arr, [( " 214: ff/af/00", " 215: ff/af/5f", " 216: ff/af/87", " 217: ff/af/af", " 218: ff/af/d7", " 219: ff/af/ff")] ); 62 | push(@arr, [( " 220: ff/d7/00", " 221: ff/d7/5f", " 222: ff/d7/87", " 223: ff/d7/af", " 224: ff/d7/d7", " 225: ff/d7/ff")] ); 63 | push(@arr, [( " 226: ff/ff/00", " 227: ff/ff/5f", " 228: ff/ff/87", " 229: ff/ff/af", " 230: ff/ff/d7", " 231: ff/ff/ff")] ); 64 | push(@arr, [( " 232: 08/08/08", " 233: 12/12/12", " 234: 1c/1c/1c", " 235: 26/26/26", " 236: 30/30/30", " 237: 3a/3a/3a")] ); 65 | push(@arr, [( " 238: 44/44/44", " 239: 4e/4e/4e", " 240: 58/58/58", " 241: 62/62/62", " 242: 6c/6c/6c", " 243: 76/76/76")] ); 66 | push(@arr, [( " 244: 80/80/80", " 245: 8a/8a/8a", " 246: 94/94/94", " 247: 9e/9e/9e", " 248: a8/a8/a8", " 249: b2/b2/b2")] ); 67 | push(@arr, [( " 250: bc/bc/bc", " 251: c6/c6/c6", " 252: d0/d0/d0", " 253: da/da/da", " 254: e4/e4/e4", " 255: ee/ee/ee")] ); 68 | 69 | if( $ARGV[0] eq "-s" || $ARGV[1] eq "-s" || $ARGV[2] eq "-s" ){ 70 | $padding = " "; 71 | } 72 | else { 73 | 74 | } 75 | 76 | # display in reverse order 77 | if( $ARGV[0] eq "-r" || $ARGV[1] eq "-r" || $ARGV[2] eq "-r" ){ 78 | for( $dimone = 0; $dimone < scalar @arr; $dimone++ ) { 79 | 80 | $seed = ($dimone % 6) * -1; 81 | for( $dimtwo = 0; $dimtwo < 6; $dimtwo++ ) { 82 | 83 | $movone = $seed; 84 | $movtwo = $seed * -1; 85 | 86 | print $arr[$dimone][$dimtwo] . $padding; 87 | 88 | $seed = $seed+1; 89 | } 90 | 91 | print "\n"; 92 | } 93 | } 94 | else { 95 | for( $dimone = 0; $dimone < scalar @arr; $dimone++ ) { 96 | 97 | $seed = ($dimone % 6) * -1; 98 | for( $dimtwo = 0; $dimtwo < 6; $dimtwo++ ) { 99 | 100 | $movone = $seed; 101 | $movtwo = $seed * -1; 102 | 103 | $newone = $dimone+$movone; 104 | $newtwo = $dimtwo+$movtwo; 105 | 106 | if( $newone < scalar @arr ){ 107 | print $arr[$newone][$newtwo] . $padding; 108 | } 109 | 110 | $seed = $seed+1; 111 | } 112 | 113 | print "\n"; 114 | } 115 | } 116 | print "\n"; 117 | print "\n"; 118 | 119 | } 120 | else { 121 | print " 16: 00/00/00\n"; 122 | print " 17: 00/00/5f\n"; 123 | print " 18: 00/00/87\n"; 124 | print " 19: 00/00/af\n"; 125 | print " 20: 00/00/d7\n"; 126 | print " 21: 00/00/ff\n"; 127 | print " 22: 00/5f/00\n"; 128 | print " 23: 00/5f/5f\n"; 129 | print " 24: 00/5f/87\n"; 130 | print " 25: 00/5f/af\n"; 131 | print " 26: 00/5f/d7\n"; 132 | print " 27: 00/5f/ff\n"; 133 | print " 28: 00/87/00\n"; 134 | print " 29: 00/87/5f\n"; 135 | print " 30: 00/87/87\n"; 136 | print " 31: 00/87/af\n"; 137 | print " 32: 00/87/d7\n"; 138 | print " 33: 00/87/ff\n"; 139 | print " 34: 00/af/00\n"; 140 | print " 35: 00/af/5f\n"; 141 | print " 36: 00/af/87\n"; 142 | print " 37: 00/af/af\n"; 143 | print " 38: 00/af/d7\n"; 144 | print " 39: 00/af/ff\n"; 145 | print " 40: 00/d7/00\n"; 146 | print " 41: 00/d7/5f\n"; 147 | print " 42: 00/d7/87\n"; 148 | print " 43: 00/d7/af\n"; 149 | print " 44: 00/d7/d7\n"; 150 | print " 45: 00/d7/ff\n"; 151 | print " 46: 00/ff/00\n"; 152 | print " 47: 00/ff/5f\n"; 153 | print " 48: 00/ff/87\n"; 154 | print " 49: 00/ff/af\n"; 155 | print " 50: 00/ff/d7\n"; 156 | print " 51: 00/ff/ff\n"; 157 | print " 52: 5f/00/00\n"; 158 | print " 53: 5f/00/5f\n"; 159 | print " 54: 5f/00/87\n"; 160 | print " 55: 5f/00/af\n"; 161 | print " 56: 5f/00/d7\n"; 162 | print " 57: 5f/00/ff\n"; 163 | print " 58: 5f/5f/00\n"; 164 | print " 59: 5f/5f/5f\n"; 165 | print " 60: 5f/5f/87\n"; 166 | print " 61: 5f/5f/af\n"; 167 | print " 62: 5f/5f/d7\n"; 168 | print " 63: 5f/5f/ff\n"; 169 | print " 64: 5f/87/00\n"; 170 | print " 65: 5f/87/5f\n"; 171 | print " 66: 5f/87/87\n"; 172 | print " 67: 5f/87/af\n"; 173 | print " 68: 5f/87/d7\n"; 174 | print " 69: 5f/87/ff\n"; 175 | print " 70: 5f/af/00\n"; 176 | print " 71: 5f/af/5f\n"; 177 | print " 72: 5f/af/87\n"; 178 | print " 73: 5f/af/af\n"; 179 | print " 74: 5f/af/d7\n"; 180 | print " 75: 5f/af/ff\n"; 181 | print " 76: 5f/d7/00\n"; 182 | print " 77: 5f/d7/5f\n"; 183 | print " 78: 5f/d7/87\n"; 184 | print " 79: 5f/d7/af\n"; 185 | print " 80: 5f/d7/d7\n"; 186 | print " 81: 5f/d7/ff\n"; 187 | print " 82: 5f/ff/00\n"; 188 | print " 83: 5f/ff/5f\n"; 189 | print " 84: 5f/ff/87\n"; 190 | print " 85: 5f/ff/af\n"; 191 | print " 86: 5f/ff/d7\n"; 192 | print " 87: 5f/ff/ff\n"; 193 | print " 88: 87/00/00\n"; 194 | print " 89: 87/00/5f\n"; 195 | print " 90: 87/00/87\n"; 196 | print " 91: 87/00/af\n"; 197 | print " 92: 87/00/d7\n"; 198 | print " 93: 87/00/ff\n"; 199 | print " 94: 87/5f/00\n"; 200 | print " 95: 87/5f/5f\n"; 201 | print " 96: 87/5f/87\n"; 202 | print " 97: 87/5f/af\n"; 203 | print " 98: 87/5f/d7\n"; 204 | print " 99: 87/5f/ff\n"; 205 | print " 100 :87/87/00\n"; 206 | print " 101 :87/87/5f\n"; 207 | print " 102 :87/87/87\n"; 208 | print " 103 :87/87/af\n"; 209 | print " 104 :87/87/d7\n"; 210 | print " 105 :87/87/ff\n"; 211 | print " 106 :87/af/00\n"; 212 | print " 107 :87/af/5f\n"; 213 | print " 108 :87/af/87\n"; 214 | print " 109 :87/af/af\n"; 215 | print " 110 :87/af/d7\n"; 216 | print " 111 :87/af/ff\n"; 217 | print " 112 :87/d7/00\n"; 218 | print " 113 :87/d7/5f\n"; 219 | print " 114 :87/d7/87\n"; 220 | print " 115 :87/d7/af\n"; 221 | print " 116 :87/d7/d7\n"; 222 | print " 117 :87/d7/ff\n"; 223 | print " 118 :87/ff/00\n"; 224 | print " 119 :87/ff/5f\n"; 225 | print " 120 :87/ff/87\n"; 226 | print " 121 :87/ff/af\n"; 227 | print " 122 :87/ff/d7\n"; 228 | print " 123 :87/ff/ff\n"; 229 | print " 124 :af/00/00\n"; 230 | print " 125 :af/00/5f\n"; 231 | print " 126 :af/00/87\n"; 232 | print " 127 :af/00/af\n"; 233 | print " 128 :af/00/d7\n"; 234 | print " 129 :af/00/ff\n"; 235 | print " 130 :af/5f/00\n"; 236 | print " 131 :af/5f/5f\n"; 237 | print " 132 :af/5f/87\n"; 238 | print " 133 :af/5f/af\n"; 239 | print " 134 :af/5f/d7\n"; 240 | print " 135 :af/5f/ff\n"; 241 | print " 136 :af/87/00\n"; 242 | print " 137 :af/87/5f\n"; 243 | print " 138 :af/87/87\n"; 244 | print " 139 :af/87/af\n"; 245 | print " 140 :af/87/d7\n"; 246 | print " 141 :af/87/ff\n"; 247 | print " 142 :af/af/00\n"; 248 | print " 143 :af/af/5f\n"; 249 | print " 144 :af/af/87\n"; 250 | print " 145 :af/af/af\n"; 251 | print " 146 :af/af/d7\n"; 252 | print " 147 :af/af/ff\n"; 253 | print " 148 :af/d7/00\n"; 254 | print " 149 :af/d7/5f\n"; 255 | print " 150 :af/d7/87\n"; 256 | print " 151 :af/d7/af\n"; 257 | print " 152 :af/d7/d7\n"; 258 | print " 153 :af/d7/ff\n"; 259 | print " 154 :af/ff/00\n"; 260 | print " 155 :af/ff/5f\n"; 261 | print " 156 :af/ff/87\n"; 262 | print " 157 :af/ff/af\n"; 263 | print " 158 :af/ff/d7\n"; 264 | print " 159 :af/ff/ff\n"; 265 | print " 160 :d7/00/00\n"; 266 | print " 161 :d7/00/5f\n"; 267 | print " 162 :d7/00/87\n"; 268 | print " 163 :d7/00/af\n"; 269 | print " 164 :d7/00/d7\n"; 270 | print " 165 :d7/00/ff\n"; 271 | print " 166 :d7/5f/00\n"; 272 | print " 167 :d7/5f/5f\n"; 273 | print " 168 :d7/5f/87\n"; 274 | print " 169 :d7/5f/af\n"; 275 | print " 170 :d7/5f/d7\n"; 276 | print " 171 :d7/5f/ff\n"; 277 | print " 172 :d7/87/00\n"; 278 | print " 173 :d7/87/5f\n"; 279 | print " 174 :d7/87/87\n"; 280 | print " 175 :d7/87/af\n"; 281 | print " 176 :d7/87/d7\n"; 282 | print " 177 :d7/87/ff\n"; 283 | print " 178 :d7/af/00\n"; 284 | print " 179 :d7/af/5f\n"; 285 | print " 180 :d7/af/87\n"; 286 | print " 181 :d7/af/af\n"; 287 | print " 182 :d7/af/d7\n"; 288 | print " 183 :d7/af/ff\n"; 289 | print " 184 :d7/d7/00\n"; 290 | print " 185 :d7/d7/5f\n"; 291 | print " 186 :d7/d7/87\n"; 292 | print " 187 :d7/d7/af\n"; 293 | print " 188 :d7/d7/d7\n"; 294 | print " 189 :d7/d7/ff\n"; 295 | print " 190 :d7/ff/00\n"; 296 | print " 191 :d7/ff/5f\n"; 297 | print " 192 :d7/ff/87\n"; 298 | print " 193 :d7/ff/af\n"; 299 | print " 194 :d7/ff/d7\n"; 300 | print " 195 :d7/ff/ff\n"; 301 | print " 196 :ff/00/00\n"; 302 | print " 197 :ff/00/5f\n"; 303 | print " 198 :ff/00/87\n"; 304 | print " 199 :ff/00/af\n"; 305 | print " 200 :ff/00/d7\n"; 306 | print " 201 :ff/00/ff\n"; 307 | print " 202 :ff/5f/00\n"; 308 | print " 203 :ff/5f/5f\n"; 309 | print " 204 :ff/5f/87\n"; 310 | print " 205 :ff/5f/af\n"; 311 | print " 206 :ff/5f/d7\n"; 312 | print " 207 :ff/5f/ff\n"; 313 | print " 208 :ff/87/00\n"; 314 | print " 209 :ff/87/5f\n"; 315 | print " 210 :ff/87/87\n"; 316 | print " 211 :ff/87/af\n"; 317 | print " 212 :ff/87/d7\n"; 318 | print " 213 :ff/87/ff\n"; 319 | print " 214 :ff/af/00\n"; 320 | print " 215 :ff/af/5f\n"; 321 | print " 216 :ff/af/87\n"; 322 | print " 217 :ff/af/af\n"; 323 | print " 218 :ff/af/d7\n"; 324 | print " 219 :ff/af/ff\n"; 325 | print " 220 :ff/d7/00\n"; 326 | print " 221 :ff/d7/5f\n"; 327 | print " 222 :ff/d7/87\n"; 328 | print " 223 :ff/d7/af\n"; 329 | print " 224 :ff/d7/d7\n"; 330 | print " 225 :ff/d7/ff\n"; 331 | print " 226 :ff/ff/00\n"; 332 | print " 227 :ff/ff/5f\n"; 333 | print " 228 :ff/ff/87\n"; 334 | print " 229 :ff/ff/af\n"; 335 | print " 230 :ff/ff/d7\n"; 336 | print " 231 :ff/ff/ff\n"; 337 | print " 232 :08/08/08\n"; 338 | print " 233 :12/12/12\n"; 339 | print " 234 :1c/1c/1c\n"; 340 | print " 235 :26/26/26\n"; 341 | print " 236 :30/30/30\n"; 342 | print " 237 :3a/3a/3a\n"; 343 | print " 238 :44/44/44\n"; 344 | print " 239 :4e/4e/4e\n"; 345 | print " 240 :58/58/58\n"; 346 | print " 241 :62/62/62\n"; 347 | print " 242 :6c/6c/6c\n"; 348 | print " 243 :76/76/76\n"; 349 | print " 244 :80/80/80\n"; 350 | print " 245 :8a/8a/8a\n"; 351 | print " 246 :94/94/94\n"; 352 | print " 247 :9e/9e/9e\n"; 353 | print " 248 :a8/a8/a8\n"; 354 | print " 249 :b2/b2/b2\n"; 355 | print " 250 :bc/bc/bc\n"; 356 | print " 251 :c6/c6/c6\n"; 357 | print " 252 :d0/d0/d0\n"; 358 | print " 253 :da/da/da\n"; 359 | print " 254 :e4/e4/e4\n"; 360 | print " 255 :ee/ee/ee\n"; 361 | print "\n"; 362 | print "\n"; 363 | } 364 | print "0m"; 365 | exit; 366 | -------------------------------------------------------------------------------- /bin/git-brst: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Prints out branch ahead/behind status vs origin/master for all branches 4 | # 5 | # example: 6 | # $ git branch-status 7 | # dns_check (ahead 1) | (behind 112) origin/master 8 | # master (ahead 2) | (behind 0) origin/master 9 | # 10 | # https://github.com/Stratus3D/dotfiles/blob/4565b251354bed240b55c83fc15d226aa8f798a5/scripts/git/git-branch-status 11 | 12 | TMP_FILE_NAME=/tmp/git_upstream_status_delta 13 | 14 | git for-each-ref --format="%(refname:short) %(upstream:short)" refs/ | \ 15 | while read local remote 16 | do 17 | if [ -x $remote ]; then 18 | branches=("$local") 19 | else 20 | branches=("$local" "$remote") 21 | fi; 22 | for branch in ${branches[@]}; do 23 | master="origin/master" 24 | git rev-list --left-right ${branch}...${master} -- 2>/dev/null > $TMP_FILE_NAME || continue 25 | LEFT_AHEAD=$(grep -c '^<' $TMP_FILE_NAME) 26 | RIGHT_AHEAD=$(grep -c '^>' $TMP_FILE_NAME) 27 | echo "$branch (ahead $LEFT_AHEAD) | (behind $RIGHT_AHEAD) $master" 28 | done 29 | done | grep -v "^origin/master" | sort | uniq 30 | -------------------------------------------------------------------------------- /bin/git-cm: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # https://github.com/christoomey/dotfiles/blob/77fb4084bd3f207aace80aa93a49769a6a298ddb/bin/git-cm 4 | # Small wrapper around git commit. Bare 'cm' will enter normal git commit 5 | # editor, but with args it will do a direct `commit -m` 6 | 7 | if [[ $# > 0 ]]; then 8 | git commit -m "$@" 9 | else 10 | git commit -v 11 | fi 12 | -------------------------------------------------------------------------------- /bin/git-publish: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # 3 | # https://github.com/christoomey/dotfiles/blob/77fb4084bd3f207aace80aa93a49769a6a298ddb/bin/git-publish 4 | # Usage: git publish 5 | # Open the pull request page for , or the current branch if not 6 | # specified. Lands on the new pull request page when no PR exists yet. 7 | # The local branch must be tracking the remote branch. 8 | 9 | def get_current_branch 10 | `git rev-parse --abbrev-ref HEAD`.chomp 11 | end 12 | 13 | def main 14 | current_branch = get_current_branch 15 | if current_branch == "master" 16 | $stderr.puts "Currently on master, aborting." 17 | exit 1 18 | else 19 | system("git push -u origin #{current_branch}:#{current_branch}") 20 | end 21 | end 22 | 23 | main 24 | -------------------------------------------------------------------------------- /bin/git-uncommit: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # https://github.com/christoomey/dotfiles/blob/77fb4084bd3f207aace80aa93a49769a6a298ddb/bin/git-uncommit 3 | 4 | git_clean() { 5 | git diff --no-ext-diff --quiet --exit-code 6 | } 7 | 8 | main() { 9 | if git_clean; then 10 | local branch_name=$(git symbolic-ref HEAD 2>/dev/null | tr '/' '\n' | tail -1) 11 | local current_sha=$(git rev-parse HEAD) 12 | echo "Branch $branch_name was $current_sha" 13 | git reset --soft HEAD^ 14 | git reset 15 | else 16 | >&2 echo "Aborting due to local changes" 17 | exit 1 18 | fi 19 | } 20 | 21 | main 22 | -------------------------------------------------------------------------------- /bin/tat: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Attach or create tmux session named the same as current directory. 4 | 5 | path_name="$(basename "$PWD" | tr . -)" 6 | session_name=${1-$path_name} 7 | 8 | not_in_tmux() { 9 | [ -z "$TMUX" ] 10 | } 11 | 12 | session_exists() { 13 | tmux list-sessions | sed -E 's/:.*$//' | grep -q "^$session_name$" 14 | } 15 | 16 | create_detached_session() { 17 | (TMUX='' tmux new-session -Ad -s "$session_name") 18 | } 19 | 20 | create_if_needed_and_attach() { 21 | if not_in_tmux; then 22 | tmux new-session -As "$session_name" 23 | else 24 | if ! session_exists; then 25 | create_detached_session 26 | fi 27 | tmux switch-client -t "$session_name" 28 | fi 29 | } 30 | 31 | create_if_needed_and_attach 32 | -------------------------------------------------------------------------------- /bin/tmuxinator.zsh: -------------------------------------------------------------------------------- 1 | _tmuxinator() { 2 | local commands projects 3 | commands=(${(f)"$(tmuxinator commands zsh)"}) 4 | projects=(${(f)"$(tmuxinator completions start)"}) 5 | 6 | if (( CURRENT == 2 )); then 7 | _describe -t commands "tmuxinator subcommands" commands 8 | _describe -t projects "tmuxinator projects" projects 9 | elif (( CURRENT == 3)); then 10 | case $words[2] in 11 | copy|debug|delete|open|start) 12 | _arguments '*:projects:($projects)' 13 | ;; 14 | esac 15 | fi 16 | 17 | return 18 | } 19 | 20 | compdef _tmuxinator tmuxinator mux 21 | alias mux="tmuxinator" 22 | 23 | # Local Variables: 24 | # mode: Shell-Script 25 | # sh-indentation: 2 26 | # indent-tabs-mode: nil 27 | # sh-basic-offset: 2 28 | # End: 29 | # vim: ft=zsh sw=2 ts=2 et 30 | -------------------------------------------------------------------------------- /bootstrap: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ################################################################################ 4 | # bootstrap 5 | # 6 | # This script is intended to set up a new Linux desktop machine with my dotfiles 7 | # and other development preferences. 8 | # 9 | # Much of this script was derived from thoughtbot's now unsupported Linux 10 | # version of Laptop. 11 | # https://github.com/thoughtbot/laptop/tree/39768b19959f74724ed0c0ea92e5b2f6f78e45c1 12 | ################################################################################ 13 | 14 | 15 | # Thank you, thoughtbot! :) 16 | bootstrap_echo() { 17 | local fmt="$1"; shift 18 | 19 | # shellcheck disable=SC2059 20 | printf "\n[BOOTSTRAP] $fmt\n" "$@" 21 | } 22 | 23 | 24 | ################################################################################ 25 | # Variable declarations 26 | ################################################################################ 27 | 28 | osname=$(uname) 29 | ruby_version="2.3.3" 30 | OLD_DOTFILES_BACKUP=$HOME/old_dotfiles_backup 31 | 32 | DOTFILES_REPO_URL="https://github.com/joshukraine/linux-dotfiles.git" 33 | DOTFILES_BRANCH="master" 34 | DOTFILES_DIR=$HOME/dotfiles 35 | 36 | BOOTSTRAP_REPO_URL="https://github.com/joshukraine/linux-bootstrap.git" 37 | BOOTSTRAP_BRANCH="master" 38 | BOOTSTRAP_DIR=$HOME/linux-bootstrap 39 | 40 | 41 | ################################################################################ 42 | # Make sure we're on Linux before continuing 43 | ################################################################################ 44 | 45 | if [[ "$osname" == 'Darwin' ]]; then 46 | bootstrap_echo "Oops, looks like you're on a Mac. Please check out the link 47 | below for instructions on setting up macOS." 48 | bootstrap_echo "http://jsua.co/macos" 49 | exit 1 50 | elif [[ "$osname" != 'Linux' ]]; then 51 | bootstrap_echo "Oops, it looks like you're using a non-supported OS. Exiting..." 52 | exit 1 53 | fi 54 | 55 | 56 | ################################################################################ 57 | # 1. Update the system. 58 | ################################################################################ 59 | 60 | bootstrap_echo "Step 1: Updating system packages ..." 61 | 62 | if command -v aptitude >/dev/null; then 63 | bootstrap_echo "Using aptitude ..." 64 | else 65 | bootstrap_echo "Installing aptitude ..." 66 | sudo apt-get install -y aptitude 67 | fi 68 | 69 | sudo aptitude update 70 | sudo aptitude -y upgrade 71 | 72 | 73 | ################################################################################ 74 | # 2. Install basic tools 75 | ################################################################################ 76 | 77 | bootstrap_echo "Step 2: Installing basic tools..." 78 | 79 | bootstrap_echo "Installing build-essential..." 80 | sudo aptitude install -y build-essential 81 | 82 | bootstrap_echo "Installing curl ..." 83 | sudo aptitude install -y curl 84 | 85 | bootstrap_echo "Installing python software properties..." 86 | sudo aptitude install -y python-software-properties 87 | 88 | bootstrap_echo "Installing other useful libraries..." 89 | sudo aptitude install -y zlib1g-dev libssl-dev libreadline-dev libyaml-dev libsqlite3-dev libxml2-dev libxslt1-dev libcurl4-openssl-dev libffi-dev libcurl4-gnutls-dev libexpat1-dev gettext unzip 90 | 91 | # http://sourcedigit.com/21550-git-2-11-released-how-to-install-git-on-ubuntu-16-10/ 92 | bootstrap_echo "Installing git..." 93 | sudo add-apt-repository -y ppa:git-core/ppa 94 | sudo aptitude update 95 | sudo aptitude install -y git 96 | 97 | bootstrap_echo "Installing sqlite3..." 98 | sudo aptitude install -y sqlite3 99 | 100 | bootstrap_echo "Installing Postgres..." 101 | if grep -qiE 'xenial' /etc/os-release; then 102 | sudo add-apt-repository -y "deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main" 103 | wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - 104 | sudo apt-get update 105 | sudo apt-get install -y postgresql-9.6 postgresql-server-dev-9.6 libpq-dev 106 | else 107 | sudo aptitude install -y postgresql postgresql-server-dev-all libpq-dev 108 | fi 109 | 110 | bootstrap_echo "Installing Redis..." 111 | sudo aptitude install -y redis-server 112 | 113 | bootstrap_echo "Installing ctags..." 114 | sudo aptitude install -y exuberant-ctags 115 | 116 | bootstrap_echo "Installing Vim ..." 117 | sudo aptitude remove vim-tiny -y 118 | sudo aptitude install -y vim-gtk 119 | 120 | bootstrap_echo "Installing htop..." 121 | sudo aptitude install -y htop 122 | 123 | bootstrap_echo "Installing tree..." 124 | sudo aptitude install -y tree 125 | 126 | if grep -qiE 'precise|saucy|trusty|utopic|vivid' /etc/os-release; then 127 | bootstrap_echo "Adding tmux ppa:pi-rho/dev..." 128 | sudo add-apt-repository -y ppa:pi-rho/dev 129 | sudo aptitude update 130 | fi 131 | 132 | bootstrap_echo "Installing tmux..." # http://stackoverflow.com/a/25952511 133 | if grep -qiE 'trusty' /etc/os-release; then 134 | sudo aptitude install -y tmux=2.0-1~ppa1~t 135 | elif grep -qiE 'vivid' /etc/os-release; then 136 | sudo aptitude install -y tmux=2.0-1~ppa1~v 137 | else 138 | sudo aptitude install -y tmux 139 | fi 140 | 141 | bootstrap_echo "Installing ImageMagick..." 142 | sudo aptitude install -y imagemagick 143 | 144 | bootstrap_echo "Installing zsh..." 145 | sudo aptitude install -y zsh 146 | 147 | bootstrap_echo "Installing xclip..." 148 | sudo aptitude install -y xclip 149 | 150 | if grep -qiE 'precise|saucy|trusty|utopic|vivid|wheezy' /etc/os-release; then 151 | bootstrap_echo "Installing gnome-tweak-tool..." 152 | sudo aptitude install -y gnome-tweak-tool 153 | fi 154 | 155 | bootstrap_echo "Installing node via NVM..." 156 | # shellcheck source=/dev/null 157 | export NVM_DIR="$HOME"/.nvm && ( 158 | git clone https://github.com/creationix/nvm.git "$NVM_DIR" 159 | cd "$NVM_DIR" 160 | git checkout "$(git describe --abbrev=0 --tags --match "v[0-9]*" origin)" 161 | ) && . "$NVM_DIR"/nvm.sh 162 | 163 | nvm install --lts 164 | 165 | bootstrap_echo "Cloning linux-bootstrap repo..." 166 | git clone "$BOOTSTRAP_REPO_URL" -b "$BOOTSTRAP_BRANCH" "$BOOTSTRAP_DIR" 167 | 168 | 169 | ################################################################################ 170 | # 3. Install oh-my-zsh 171 | ################################################################################ 172 | 173 | bootstrap_echo "Step 3: Installing oh-my-zsh..." 174 | 175 | if [ -d "$HOME"/.oh-my-zsh ]; then 176 | rm -rf "$HOME"/.oh-my-zsh 177 | fi 178 | 179 | git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh 180 | 181 | bootstrap_echo "Changing your shell to zsh ..." 182 | 183 | chsh -s "$(which zsh)" 184 | 185 | 186 | ################################################################################ 187 | # 4. Setup dotfiles 188 | ################################################################################ 189 | 190 | bootstrap_echo "Step 4: Installing dotfiles..." 191 | if [[ -d $DOTFILES_DIR ]]; then 192 | bootstrap_echo "Backing up old dotfiles to $HOME/old_dotfiles_backup..." 193 | rm -rf "$OLD_DOTFILES_BACKUP" 194 | cp -R "$DOTFILES_DIR" "$OLD_DOTFILES_BACKUP" 195 | rm -rf "$DOTFILES_DIR" 196 | fi 197 | 198 | bootstrap_echo "Cloning your dotfiles repo to ${DOTFILES_DIR} ..." 199 | 200 | git clone "$DOTFILES_REPO_URL" -b "$DOTFILES_BRANCH" "$DOTFILES_DIR" 201 | 202 | # shellcheck source=/dev/null 203 | source "$DOTFILES_DIR"/install.sh 204 | 205 | 206 | ################################################################################ 207 | # 5. Install ~/bin utilities 208 | ################################################################################ 209 | 210 | bootstrap_echo "Step 5: Installing bin utilities..." 211 | 212 | if [ ! -d "$HOME"/bin ]; then 213 | mkdir "$HOME"/bin 214 | fi 215 | 216 | cp -R "$BOOTSTRAP_DIR"/bin/* "$HOME"/bin/ 217 | 218 | 219 | ################################################################################ 220 | # 6. Install Powerline-patched fonts 221 | ################################################################################ 222 | 223 | bootstrap_echo "Step 6: Installing fixed-width fonts patched for use with Powerline symbols..." 224 | 225 | if [ -d "$HOME"/src/fonts ]; then 226 | rm -rf "$HOME"/src/fonts 227 | fi 228 | 229 | git clone https://github.com/powerline/fonts.git "$HOME"/src/fonts 230 | 231 | cd "$HOME"/src/fonts || exit 232 | 233 | ./install.sh 234 | 235 | cd "$HOME" || exit 236 | 237 | rm -rf "$HOME"/src/fonts 238 | 239 | bootstrap_echo "Done!" 240 | 241 | 242 | ################################################################################ 243 | # 7. Install Vundle and Vim plugins 244 | ################################################################################ 245 | 246 | bootstrap_echo "Step 7: Installing Vundle and Vim plugins..." 247 | 248 | if [ -d "$HOME"/.vim/bundle ]; then 249 | rm -rf "$HOME"/.vim/bundle 250 | fi 251 | 252 | git clone https://github.com/gmarik/Vundle.vim.git "$HOME/.vim/bundle/Vundle.vim" 253 | 254 | cp -R "$DOTFILES_DIR"/vim/colors "$HOME"/.vim # So Vim won't complain about solarized not being found. 255 | 256 | vim +PluginInstall +qall 257 | 258 | rm -rf "$HOME"/.vim/colors 259 | 260 | bootstrap_echo "Done!" 261 | 262 | 263 | ################################################################################ 264 | # 8. Install rbenv and ruby-build 265 | ################################################################################ 266 | 267 | bootstrap_echo "Step 8: Installing rbenv and ruby-build..." 268 | if [[ ! -d "$HOME"/.rbenv ]]; then 269 | bootstrap_echo "Installing rbenv..." 270 | git clone https://github.com/sstephenson/rbenv.git ~/.rbenv 271 | 272 | export PATH="$HOME"/.rbenv/bin:$PATH 273 | eval "$(rbenv init - zsh)" 274 | fi 275 | 276 | if [[ ! -d "$HOME"/.rbenv/plugins/ruby-build ]]; then 277 | bootstrap_echo "Installing ruby-build..." 278 | git clone https://github.com/sstephenson/ruby-build.git \ 279 | ~/.rbenv/plugins/ruby-build 280 | fi 281 | 282 | bootstrap_echo "Done!" 283 | 284 | 285 | ################################################################################ 286 | # 9. Install Ruby and Bundler 287 | ################################################################################ 288 | 289 | bootstrap_echo "Step 9: Installing Ruby & Bundler..." 290 | 291 | bootstrap_echo "Installing Ruby $ruby_version ..." 292 | rbenv install -s "$ruby_version" 293 | 294 | bootstrap_echo "Setting $ruby_version as global default Ruby ..." 295 | rbenv global "$ruby_version" 296 | 297 | bootstrap_echo "Updating to latest Rubygems version ..." 298 | gem update --system 299 | 300 | bootstrap_echo "Installing Bundler..." 301 | gem install bundler --no-document --pre 302 | 303 | bootstrap_echo "Done!" 304 | 305 | 306 | ################################################################################ 307 | # 10. Set up Tmuxinator (https://github.com/tmuxinator/tmuxinator) 308 | ################################################################################ 309 | 310 | bootstrap_echo "Step 10: Setting up Tmuxinator..." 311 | 312 | gem install tmuxinator 313 | 314 | if [ ! -d "$HOME"/.tmuxinator/ ]; then 315 | mkdir "$HOME"/.tmuxinator 316 | fi 317 | 318 | cp "$BOOTSTRAP_DIR"/lib/default.yml "$HOME"/.tmuxinator/ 319 | 320 | bootstrap_echo "Done!" 321 | 322 | echo "" 323 | echo "******************************************************************" 324 | echo "**** Bootstrap script complete! Please restart your computer. ****" 325 | echo "******************************************************************" 326 | echo "" 327 | -------------------------------------------------------------------------------- /lib/default.yml: -------------------------------------------------------------------------------- 1 | # ~/.tmuxinator/default.yml 2 | 3 | name: default 4 | root: ~/ 5 | 6 | windows: 7 | - editor: 8 | layout: 0da4,212x51,0,0[212x37,0,0,9,212x13,0,38,23] 9 | panes: 10 | - vim -S 11 | - # 12 | --------------------------------------------------------------------------------