Ubuntu 16.04 "Xenial Xerus" setup

From Bitpost wiki

Throw Ubuntu on a USB stick following ubuntu instructions.

Reboot, select to boot the thumb in BIOS, install, checking the [download as you go] and [install 3rd party stuff] boxes.

Things to install ASAP:

  • (everything INCLUDING DEVELOPMENT STUFF)
sudo apt-get install i3 i3lock i3status suckless-tools dunst openssh-server cifs-utils smbclient synergy arandr ubuntu-restricted-extras exfat-fuse exfat-utils hfsprogs acpi gparted chromium-browser p7zip-full k4dirstat screen rxvt-unicode grdesktop openvpn bridge-utils nautilus-compare smartmontools git gimp network-manager-gnome network-manager-openvpn-gnome nautilus-dropbox synergy software-properties-common scrot gnome-screenshot gnome-settings-daemon gksu feh blueman pavucontrol pnmixer emacs build-essential automake libtool libssl-dev libbz2-dev python-dev curl libcurl4-openssl-dev kdiff3 sqlite3 sqlitebrowser qt-sdk qtcreator ruby ruby-dev tig meld blender
sudo apt-get install pommed firmware-b43-installer xserver-xorg-input-mtrack sensors-applet isight-firmware-tools
  • (everything for user env, then see more detailed notes, below)
sudo apt-get install i3 i3lock i3status suckless-tools dunst openssh-server cifs-utils smbclient synergy arandr ubuntu-restricted-extras exfat-fuse exfat-utils hfsprogs acpi gparted chromium-browser p7zip-full k4dirstat screen rxvt-unicode grdesktop openvpn bridge-utils nautilus-compare smartmontools git gimp network-manager-gnome network-manager-openvpn-gnome nautilus-dropbox synergy software-properties-common scrot gnome-screenshot gnome-settings-daemon gksu feh blueman pavucontrol pnmixer
  • if ubuntu forced grub as the boot manager, download the refind zip file, unpack, and (re)run ./install.sh.
  • install i3
    • EITHER install i3 and i3 meta package through ubuntu: sudo software-center # then install i3 and i3 meta package
    • OR do it yourself: sudo apt-get install i3 i3lock i3status suckless-tools dunst
    • in .i3/config, set up nm-applet to run on login: exec --no-startup-id nm-applet
    • in .i3/config, set up synergy to run on login: exec --no-startup-id synergy
    • gsettings set org.gnome.desktop.background show-desktop-icons false # this disables the gnome desktop from opening when you run nautilus
    • then logout from unity and log back in to i3
    • sudo apt-get install urxvt # for a terminal that we can control (float, set geometry) with i3
  • nvidia drivers
    • open unity-control-panel AS ROOT: sudo unity-control-panel
    • select Sofware and Updates
    • select Additional Drivers tab, click nvidia (and Intel mobo, etc as needed) proprietary driver, Apply
  • set up ssh
sudo apt-get install openssh-server # default is ok but see /etc/ssh/sshd_config for details
cd ~m/.ssh
scp [email protected]:/home/m/.ssh/authorized_keys .
scp [email protected]:/home/m/.ssh/id_rsa_3072_nopswd .
ln -s id_rsa_3072_nopswd id_rsa
  • as root, create /root/samba_credentials (copy it from another machine)
  • set up scripts repo
git clone ssh://bitpost.com/home/m/development/scripts 
cd && ln -s development/scripts scripts
mkdir scripts/ubuntu/[new machine]
  • set up config repo (remember we need files in git and symlinks to them from the system, YES THIS SUCKS, GIT!)
verify_ubuntu_config_symlinks # we need to turn ALL THESE into SYMLINKS
mkdir development && cd development
git clone ssh://bitpost.com/home/m/development/config 
cd config
# DO ALL THE FOLLOWING AT ONCE or your system will be fubar
cp -r -p [wallee or whatever]/ubuntu [new machine]/ # be careful, this will need pruning/updating NOW
cd && ln -s /home/m/development/config/[new machine]/ubuntu config
cd && ln -s development/config/[new machine]/ubuntu/home/m/.bashrc .bashrc 
subl .bashrc # update PATH to include custom scripts folder in path
cd .i3 && mv config config.backup && ln -s /home/m/development/config/common/home/m/.i3/config config # and press Mod+Shift+C to reload
cd .gconf/apps/gnome-terminal/profiles/Default && mv %gconf.xml %gconf.xml.backup && ln -s /home/m/development/config/common/home/m/.gconf/apps/gnome-terminal/profiles/Default/%gconf.xml %gconf.xml
# fix up fstab as/if needed
su -
cd /etc
mv fstab /home/m/config/etc/fstab
ln -s fstab /home/m/config/etc/fstab
diff /etc/hosts /home/m/config/etc/hosts (most important: make sure correct hostname is being used)
mv hosts /home/m/config/etc/hosts
ln -s hosts /home/m/config/etc/hosts
verify_ubuntu_config_symlinks # ALL THESE should now be SYMLINKS
  • sudo apt-get install cifs-utils smbclient # and create /root/samba_credentials and all the samba /etc/fstab entries
  • sudo apt-get install synergy # and configure it
  • sudo apt-get install arandr # run to turn a monitor back on if it gets turned off during power cycling
  • sudo apt-get install ubuntu-restricted-extras # for mp3s in firefox, etc.
  • sudo apt-get install exfat-fuse exfat-utils # for access to modern exfat thumb drives (>4gb files)
  • sudo apt-get install hfsprogs # if you want to access osx volumes
  • sudo apt-get install acpi # for power management, so we can check battery level on laptop!
  • sudo apt-get install gparted chromium-browser p7zip-full k4dirstat screen # more good tools
  • sudo apt-get install nautilus-compare # then run nautilus-compare-preferences and pick kdiff3 for all
  • sudo apt-get install smartmontools # use to test drive health with [smartctl] - DO IT OFTEN
  • sudo apt-get install software-properties-common # to get add-apt-repository if you should need it; verymeta noiz pollution
  • set up networking (see above)
  • MAKE SURE to turn off stupid errors=mount in /etc/fstab if Ubuntu set it there
# MDM UBUNTU STOP F'IN AROUND WITH remount-ro
# UUID=6d51557a-1aaf-4594-8c28-f51a8730f63f   /   ext4    errors=remount-ro  0 1
UUID=6d51557a-1aaf-4594-8c28-f51a8730f63f     /   ext4    errors=continue    0 1
  • # download steam .deb file, [sudo software-center ~m/Downloads/.....deb]
  • # set up firefox sync, make sure adblock is installed, etc.
  • from a running terminal, set scrollback buffer to unlimited: Edit -> Profile Preferences -> Scrolling

AWS | OpenVPN | RemoteDesktop

  • sudo apt-get install grdesktop openvpn bridge-utils
  • get a set of OpenVPN certificate files
OpenVPN Desc OpenVPN files
Config file (e.g.) m.gec.poweranalytics.io.conf
User Certificate client.crt
CA Certificate ca.crt
Private Key client.key
  • to start an openvpn connection manually, start a terminal as root, and run openvpn:
root@wallee:/home/m/development/power_analytics/docs/private/vpn/m.gec.poweranalytics.io-openvpn# openvpn --config m.gec.poweranalytics.io.conf 
  • (some day this may actually work... now, it just makes all traffic fail)
    • for automatic, multiple-VPN connections, upgrade to using NetworkManager, by installing network-manager-openvpn-gnome
    • you can configure multiple VPN connections, and turn them on/off independently, via the wifi/wired icon in the tray
    • tray->Edit Connections->Add->OpenVPN->point it at your certificate files
  • This is available but more work, never bothered...
    • sudo unity-control-center
    • Click +, VPN, OpenVPN, Create... etc.
  • google chrome via apt 3rd party repo
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
sudo apt-get update 
sudo apt-get install google-chrome-stable
  • set up Macbook fn keys to be fn first, media keys second:
echo options hid_apple fnmode=2 | sudo tee -a /etc/modprobe.d/hid_apple.conf
# OR: echo 2 | sudo tee /sys/module/hid_apple/parameters/fnmode
sudo update-initramfs -u -k all
# reinstall refind and reboot

Development setup

  • # install android studio manually from zips into development folder
  • (everything)
sudo apt-get install emacs build-essential automake libtool libssl-dev libbz2-dev python-dev curl libcurl4-openssl-dev kdiff3 sqlite3 sqlitebrowser qt-sdk qtcreator ruby ruby-dev tig meld
  • (or individually...)
  • install boost, see Development reference
  • install Eclipse
  • sudo apt-get install emacs
  • sudo apt-get install build-essential automake libtool # for automake - build-essential may be there already
  • sudo apt-get install libssl-dev # to get autotools "-lssl" to work
  • sudo apt-get install libbz2-dev python-dev # used by boost
  • sudo apt-get install curl libcurl4-openssl-dev php5-common php5-curl php5-cli php5-json php5-readline # for php with curl (for etrade PHP SDK etc)
    • The php-* stuff is no longer available, remove from one-line for now
  • sudo apt-get install kdiff3 # will pull in a shit-ton of kde deps, i guess that's good
  • sudo apt-get install sqlite3 sqlitebrowser
  • sudo apt-get install tig # ncurses git browser, really needed at times; simple, up-to-date
  • install sublime editor (see below)
  • install Node.js (see below) then you can install npm packages rad-scripts and mah-haus
  • install Java (see below), then you can add to the Java stack as needed: play, sbt, activator...
  • run setup_for_dev.node.js to pull down all active dev repos (in progress)
  • hipchat hipshat
sudo su
echo "deb http://downloads.hipchat.com/linux/apt stable main" > /etc/apt/sources.list.d/atlassian-hipchat.list
wget -O - https://www.hipchat.com/keys/hipchat-linux.key | apt-key add -
apt-get update
apt-get install hipchat

Set up all those UnixPorn goodies