|
| 1 | +--- |
| 2 | +title: My first steps after installing Xubuntu |
| 3 | +layout: post |
| 4 | +categories: |
| 5 | + - blog |
| 6 | + - tech |
| 7 | +--- |
| 8 | + |
| 9 | +Every time a new Ubuntu version is released you see blog posts popping up about |
| 10 | +the first things to do after installing it and every time I read one of those |
| 11 | +it's mostly a waste of time to me. I guess I just have different requirements. |
| 12 | +So here is the list of things I do after installing Ubuntu. Xubuntu 16.04 that |
| 13 | +is in this case. First a few things that will be relevant for common users too, |
| 14 | +before getting to the geeky stuff. |
| 15 | + |
| 16 | + |
| 17 | +## Setup Supported Languages |
| 18 | + |
| 19 | +The dialog pops up into your face after the first boot, so why not do it right |
| 20 | +away. Otherwise you can find it under `Language Support`. You don't need to |
| 21 | +change the languages for menus and windows assuming you made the right choice |
| 22 | +during installation. However, you should install all the languages you could |
| 23 | +possibly care about as they are important for spell checking in Libre Office |
| 24 | +for example. |
| 25 | + |
| 26 | + |
| 27 | +## Setup Touchpad Properly |
| 28 | + |
| 29 | +Under `Mouse and Touchpad` you should either disable the touchpad altogether (I |
| 30 | +prefer using the pointing stick) or tick the `Disable touchpad while typing` |
| 31 | +box while reducing the delay (unless you have really slow fingers). This is to |
| 32 | +avoid having your mouse cursor jumping around or changin focus while you type. |
| 33 | + |
| 34 | + |
| 35 | +## Setup Window Panel |
| 36 | + |
| 37 | +It can be configured by doing a right click and then choosing `Panel` -> `Panel |
| 38 | +Preferences`. I prefer to have the panel at the bottom, to get it there you go |
| 39 | +to the `Display` tab, untick `lock`, drag the panel to the bottom of the screen |
| 40 | +and tick `lock` again. |
| 41 | +There are several things to do under the `Items` tab: |
| 42 | + |
| 43 | + - First configure the window buttons. I disable `Switch windows using the |
| 44 | + mouse wheel`, set `Sorting order` to `None` (the default order is weird and |
| 45 | + like this I can drag and drop) and change the `Middle click action` to `Close |
| 46 | + Window` (so it's the same thing as in Firefox) |
| 47 | + - Add CPU Graph, configure it to not have a frame and make the background |
| 48 | + color the same as the panel using the colour picker. |
| 49 | + - Change the format of the clock to `%A %d %B, %H:%M:%S` |
| 50 | + |
| 51 | +## Setup External Hardware |
| 52 | + |
| 53 | +I have got a printer and a NAS both configured with static IPs. |
| 54 | + |
| 55 | +### NAS |
| 56 | + |
| 57 | +I mount the nfs shares of the NAS using autofs: |
| 58 | + |
| 59 | +```bash |
| 60 | +sudo apt-get install autofs |
| 61 | +sudo vi /etc/auto.master |
| 62 | +``` |
| 63 | + |
| 64 | +Add the following line (`--ghost` creates empty directories for the shares): |
| 65 | + |
| 66 | +``` |
| 67 | +/nas /etc/auto.nas --ghost |
| 68 | +``` |
| 69 | + |
| 70 | +Then create /etc/auto.nas with the following content: |
| 71 | + |
| 72 | +``` |
| 73 | +Documents 192.168.1.2:/data/Documents |
| 74 | +Music 192.168.1.2:/data/Music |
| 75 | +Pictures 192.168.1.2:/data/Pictures |
| 76 | +Transmission 192.168.1.2:/data/Transmission |
| 77 | +Videos 192.168.1.2:/data/Videos |
| 78 | +``` |
| 79 | + |
| 80 | +And restart (reload does not bring up the ghost directories) the autofs |
| 81 | +service: |
| 82 | + |
| 83 | +```bash |
| 84 | +sudo /etc/init.d/autofs restart |
| 85 | +``` |
| 86 | + |
| 87 | +Unfortunately there is a problem with the wireless that prevents it from |
| 88 | +locating local IPs for a few minutes after starting it (and thus access to the |
| 89 | +NAS fails) and I could not figure out why. However, disabling the wireless n |
| 90 | +protocol serves as a workaround: |
| 91 | + |
| 92 | +```bash |
| 93 | +sudo tee /etc/modprobe.d/iwlwifi-opt.conf <<< "options iwlwifi 11n_disable=1" |
| 94 | +# restart wireless |
| 95 | +sudo modprobe --remove iwlwifi |
| 96 | +sudo modprobe iwlwifi |
| 97 | +``` |
| 98 | + |
| 99 | +### Printer |
| 100 | + |
| 101 | +Every time I tried to add a network printer through the dialogues, I was left |
| 102 | +with now printer installed and a broken package system which was quite hard to |
| 103 | +fix. Most likely culprit: `gutenprint` Luckily `Brother` provides a `Driver |
| 104 | +Install Tool` on their homepage. So I download it under http://www.brother.com |
| 105 | +-> Software Downloads -> Printers and do the following: |
| 106 | + |
| 107 | +```bash |
| 108 | +gunzip linux-brprinter-installer-2.0.0-1.gz |
| 109 | +sudo bash linux-brprinter-installer-2.0.0-1 |
| 110 | +Input model name -> DCP-L2560DW |
| 111 | +``` |
| 112 | + |
| 113 | +After confirming a few things and typing in the IP (192.168.1.3) printing and |
| 114 | +scanning (using `Simple Scan`) work like a charm. But for the best quality, you |
| 115 | +still need to change resolution to `HQ1200` under `Printer Properties` -> |
| 116 | +`Printer Options` |
| 117 | + |
| 118 | +### Bluetooth |
| 119 | + |
| 120 | +I listen to music over bluetooth and discovering and pairing of my receiver |
| 121 | +works without problems. However, connecting to it as audio sink generally fails |
| 122 | +with `Connection Failed: blueman.bluez.errors.DBusFailedError: Protocol not |
| 123 | +available...` Installing `pulseaudio-module-bluetooth` solves this problem. |
| 124 | + |
| 125 | +## Setup Keyboard Shortcuts |
| 126 | + |
| 127 | + - Set preferred terminal emulator to `X Term` in `Preferred Applications` |
| 128 | + - Add keyboard shortcuts for `xbacklight -dec 1` and `xbacklight -inc 1` (the |
| 129 | + default hardware keys do not allow fine enough steps for backlight) and |
| 130 | + install xbacklight `sudo apt-get install xbacklight` |
| 131 | + - Change application for keyboard shortcut `Print Screen` to |
| 132 | + `xfce4-screenshooter --fullscreen --save /home/sebastian/Desktop` |
| 133 | + - Change keyboard shortcut for xfce4-popup-whiskermenu to `Super+X` (can't use |
| 134 | + only `Super`, as shortcuts using `Super+something` will not work if you do) |
| 135 | + - Change key for drag-and-drop of windows to `Super` in `Window Manager Tweaks` |
| 136 | + - Change `Show Desktop` shortcut to `Super+D` in `Window Manager` |
| 137 | + |
| 138 | +## Install Useful Apps |
| 139 | + |
| 140 | +XnView and Skype have to be downloaded and installed manually all other are |
| 141 | +available through the package manager: |
| 142 | + |
| 143 | +```bash |
| 144 | +sudo apt-get install \ |
| 145 | + entr \ |
| 146 | + gmusicbrowser \ |
| 147 | + gnome-font-viewer \ |
| 148 | + gparted \ |
| 149 | + inkscape \ |
| 150 | + pdftk \ |
| 151 | + pinta \ |
| 152 | + puddletag \ |
| 153 | + silversearcher-ag \ |
| 154 | + texlive |
| 155 | + tree \ |
| 156 | + usb-creator-gtk \ |
| 157 | + vlc \ |
| 158 | + |
| 159 | +``` |
| 160 | + |
| 161 | +## Uninstall Apps I Don't Use |
| 162 | + |
| 163 | +```bash |
| 164 | +sudo apt-get purge \ |
| 165 | + gnome-mines \ |
| 166 | + gnome-sudoku \ |
| 167 | + parole `# I prefer vlc and gmusicbrowser` \ |
| 168 | + pidgin \ |
| 169 | + ristretto `# I prefer xnview` \ |
| 170 | + |
| 171 | +``` |
| 172 | + |
| 173 | +## Enable support for watching HBO |
| 174 | + |
| 175 | +Unfortunately HBO does not use HTML5 and does use DRM, so all you see is a |
| 176 | +black screen when you try to watch Game of Thrones. However, there is a great |
| 177 | +[tutorial](https://ubuntuforums.org/showthread.php?t=2274467) of how to get |
| 178 | +around this problem. As pipelight kept on stealing focus on several websites, I |
| 179 | +found it necessary to enable it only for watching something and to disable it |
| 180 | +when done: |
| 181 | + |
| 182 | +```bash |
| 183 | +sudo pipelight-plugin --create-mozilla-plugins |
| 184 | +sudo pipelight-plugin --remove-mozilla-plugins |
| 185 | +``` |
| 186 | + |
| 187 | +## Enable support for playing DVDs |
| 188 | + |
| 189 | +Playing DVDs won't work by default either and apparently there might be legal |
| 190 | +issues when doing something about it. So here is just a [link with more |
| 191 | +information](https://help.ubuntu.com/community/RestrictedFormats/PlayingDVDs) |
| 192 | + |
| 193 | +## Setup Terminal Environment |
| 194 | + |
| 195 | +### Switch To ZSH |
| 196 | + |
| 197 | +```bash |
| 198 | +sudo apt-get install zsh |
| 199 | +chsh -s /usr/bin/zsh |
| 200 | +``` |
| 201 | + |
| 202 | +Logout and login again |
| 203 | + |
| 204 | +### Install Dotfiles |
| 205 | + |
| 206 | +My dotfiles are on Github along with all my other public projects, so lets get |
| 207 | +all of them at the same time. First access has to be sorted, so either existing |
| 208 | +ssh keys (~/.ssh folder) need to be recovered or new ones generated and |
| 209 | +registered with Github |
| 210 | +(https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/) |
| 211 | +Then the repositories can be cloned: |
| 212 | + |
| 213 | +```bash |
| 214 | +# a few things are required |
| 215 | +sudo apt-get install curl jq git subversion |
| 216 | +mkdir ~/Clones |
| 217 | +cd ~/Clones |
| 218 | +curl --silent https://api.github.com/users/sblask/repos \ |
| 219 | + | jq --raw-output ".[] | .ssh_url" \ |
| 220 | + | xargs -L 1 git clone |
| 221 | +cd ~/Clones/dotfiles |
| 222 | +# retrieves a few things that are not part of my dotfiles repository |
| 223 | +./clone.sh |
| 224 | +./install.py # a few folders have to be created manually, but install will tell you about them |
| 225 | +``` |
| 226 | + |
| 227 | +Side note: I also have private repositories on Bibucket, they can be cloned |
| 228 | +like this: |
| 229 | + |
| 230 | +```bash |
| 231 | +echo "Bitbucket password:" \ |
| 232 | + && read -s password \ |
| 233 | + && curl --silent --user "sblask:${password}" https://api.bitbucket.org/2.0/repositories/sblask \ |
| 234 | + | jq --raw-output ".values | .[] | .links.clone | .[] | select(.name==\"ssh\") | .href" \ |
| 235 | + | xargs -L 1 git clone |
| 236 | +``` |
| 237 | + |
| 238 | +There is a lot of stuff in the dotfiles, so a few more programs need to be |
| 239 | +installed that are either configured in the dotfiles or are required in some |
| 240 | +other ways: |
| 241 | + |
| 242 | +```bash |
| 243 | +sudo apt-get install \ |
| 244 | + baobab `# to analyze disk usage from Thunar context menu` \ |
| 245 | + compton \ |
| 246 | + devilspie2 \ |
| 247 | + maximus \ |
| 248 | + meld `# to compare files and directories from Thunar context menu` \ |
| 249 | + puddletag `# to edit mp3 tags from Thunar context menu` \ |
| 250 | + redshift \ |
| 251 | + tmux `# use `CTRL-B` + `I` to install the plugins` \ |
| 252 | + vim-gtk `# run BundleInstall the first time you run it to install all the plugins` \ |
| 253 | + xclip \ |
| 254 | + |
| 255 | +``` |
| 256 | + |
| 257 | +## Setup Programming Language Environments |
| 258 | + |
| 259 | +The following environments are mostly for programming, where it's important to |
| 260 | +avoid version conflicts between dependencies of different projects. They also |
| 261 | +help to keep your system clean. I think it's preferable to only install stuff |
| 262 | +system wide if it comes with the system package manager. But there is for |
| 263 | +example [Jekyll][jekyll] which I use for this blog that comes as a Ruby gem. |
| 264 | +Using [rvm][rvm] allows me to do `gem install jekyll` without installing it |
| 265 | +system wide. |
| 266 | + |
| 267 | +### Javascript/Node |
| 268 | + |
| 269 | +Really the easiest of the lot, all you need is the following which will also |
| 270 | +change you shell configuration file. |
| 271 | + |
| 272 | +```bash |
| 273 | +curl -L http://git.io/n-install | bash |
| 274 | +``` |
| 275 | + |
| 276 | +### Ruby |
| 277 | + |
| 278 | +```bash |
| 279 | +gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 |
| 280 | +curl -sSL https://get.rvm.io | bash -s stable |
| 281 | +rvm list known |
| 282 | +rvm install 2.3.1 # the latest version from `list known` |
| 283 | +``` |
| 284 | + |
| 285 | +Rvm has to be in your [PATH][rvm_path] and be [loaded][rvm_zsh] by your shell. |
| 286 | + |
| 287 | +[jekyll]: http://jekyllrb.com/ |
| 288 | +[rvm]: https://rvm.io/ |
| 289 | +[rvm_path]: https://github.com/sblask/dotfiles/blob/40cccd3fc918059e5da160151af2bde7ce73b515/zshrc.dotfile#L227 |
| 290 | +[rvm_zsh]: https://github.com/sblask/dotfiles/blob/40cccd3fc918059e5da160151af2bde7ce73b515/zshrc.dotfile#L406 |
| 291 | + |
| 292 | +### Python |
| 293 | + |
| 294 | +There are certainly other ways to do this, but when the goal is to keep the |
| 295 | +system clean, I can even get away without installing virtualenv system wide: |
| 296 | + |
| 297 | +```bash |
| 298 | +cd /tmp |
| 299 | +# get the current virtualenv package |
| 300 | +curl https://pypi.python.org/pypi/virtualenv \ |
| 301 | + | pup 'a[href]:contains("tar.gz") attr{href}' | xargs -L 1 wget |
| 302 | + |
| 303 | +# install virtualenv and virtualenvwrapper |
| 304 | +tar --extract --strip-components 1 --file *.tar.gz |
| 305 | +./virtualenv.py ~/opt/virtualenv |
| 306 | +~/opt/virtualenv/bin/pip install virtualenvwrapper |
| 307 | + |
| 308 | +``` |
| 309 | + |
| 310 | +Now virtualenvwrapper can be loaded from your [shell |
| 311 | +configuration][virtualenvwrapper_zsh] which requires your |
| 312 | +[PATH][virtualenv_path] to contain the path to the virtualenv in `~/opt`. |
| 313 | +To make it even handier and to be able to easily handle the difference between |
| 314 | +Python 2 and 3, I've got [few aliases][virtualenvwrapper_aliases]. |
| 315 | + |
| 316 | +[virtualenvwrapper_aliases]: https://github.com/sblask/dotfiles/blob/48d47a96aa174b92b808f5b3faff94e05b8bb5f0/zshrc.dotfile#L293 |
| 317 | +[virtualenvwrapper_zsh]: https://github.com/sblask/dotfiles/blob/40cccd3fc918059e5da160151af2bde7ce73b515/zshrc.dotfile#L233 |
| 318 | +[virtualenv_path]: https://github.com/sblask/dotfiles/blob/40cccd3fc918059e5da160151af2bde7ce73b515/zshrc.dotfile#L227 |
0 commit comments