Skip to content

Instantly share code, notes, and snippets.

@prograhammer
Last active January 19, 2018 19:16
Show Gist options
  • Save prograhammer/b9325dae74c1838f8edc2c56d9a8330b to your computer and use it in GitHub Desktop.
Save prograhammer/b9325dae74c1838f8edc2c56d9a8330b to your computer and use it in GitHub Desktop.
I'm a Web Developer with a fresh hard drive, set me up!

I'm a Web Developer with a blank SSD

Table of contents generated with markdown-toc

Install Gnome3.x Ubuntu 16.04 (Xenial Xerus) and Windows 10

Install Ubuntu / Gnome

  • Download GnomeUbuntu iso for 16.04.1 (this has the 4.4.0-83-generic kernel, since future versions have the screen flicker problem not fixed yet). Format a USB drive to FAT32 and create a bootable version with Unetbootin or Universal USB Installer (Windows). You could also use the dd command.

  • To check the SSD firmware and etc:

    sudo hdparm -I /dev/sda
    
  • The SSD's I have are: plextor px-256m6m and samsung evo 850 2.5 500gb MZ-75E500. Better to use Windows to update firmware.

  • Go into BIOS (Delete key on PC startup): UEFI for boot (fast boot and secure boot is also off and usb selected for top choice on boot order)

  • Setup raid in bios if not set, for the plextor SSDs.

  • Here are the install partitions (after create a new partition table, which should create as "GPT"):

    /dev/sdc1 swap 3998 MB
    /dev/sdc2 efi (efi system partition) 550MB
    /dev/sdc3 ext4 the remainer of the GB on your HDD/SSD   (check box for "format")
    
    Device for boot loader installation: /dev/sdc2
    

Install Windows 10

First burn an ISO downloaded from Microsoft, you can use Bootcamp on Mac. Windows will look for EFI partition automatically and install it's bootloader there too. Grub2 then picks this up automatically so you should see Grub loader appear at boot with option to boot into Windows. Or use hotkey f11 when computer starts to select boot (ubuntu or windows). Then go to settings > activation: Use windows 7 key: (see Enpass) (It will recognize your Microsoft account at (see Enpass).

Laptop Settings

  • Search in searcbar touchpad to see the settings for it and turn it off.

Packages and Setups

  sudo apt-get update
  • Node

    curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
    sudo apt-get install -y nodejs
    sudo apt-get install -y build-essential
    
  • Vue-cli

    sudo npm install -g vue-cli
    
  • Git

    sudo apt-get install git
    git config --global user.name "David Graham"
    git config --global user.email "prograhammer@gmail.com"
    ssh-keygen -t rsa -b 4096 -C "prograhammer@gmail.com"  
    # I leave passphrase blank, so I don't worry about adding the key to ssh-agent
    # Copy contents of key to clipboard:
    sudo apt-get install xclip
    xclip -sel clip < ~/.ssh/id_rsa.pub
    # Now go to Github and add/paste this ssh key to my account.
    
  • Setup some directories:

    mkdir -p projects/code
    mkdir projects/workspace
    
  • MySQL

    sudo apt-get update
    sudo apt-get install mysql-server
    sudo mysql_secure_installation
    
    systemctl status mysql.service  # Test mysql is working.
    sudo systemctl start mysql      # Start it if not started.
    mysql -u root -p                # Login to check version.
    SHOW VARIABLES LIKE "%version%";
    
  • MySQL Workbench - Download Deb package (for Ubuntu 16.04)

  • Enpass (Password Manager) - Download Deb package

  • TeamViewer (Remote Desktop) - Download Deb package Bug, seems I have to do this to the daemon every time I want to use it: sudo teamviewer --daemon restart

  • Maven (Java package manager)

  • Meld (directory gui diff tool)

  • Install Redis - https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-redis-on-ubuntu-16-04
    Start the service: sudo systemctl start redis
    Check the status: sudo systemctl status redis
    Enable it to start at boot: sudo systemctl enable redis

  • Install RabbitMQ
    Install deb package.
    Install deb package of erlang/otl (but you need to first uninstall sudo apt-get purge erlang*)

  • key-mon & screenkey (for showing keys for screencasts in Ubuntu)

Online Tools (Links)

  • StackEdit - Online Markdown editor.

Bug Fixes

  • Gnome Software app doesn't open (closes/crashes immediately)

    • This may not be a problem, but if so, fix with:

      sudo apt-get upgrade gnome-software

  • Plymouth crash

    • plymouthd crashed with SIGSEGV in script_obj_deref_direct()
    • Fix in terminal with command: sudo dpkg-reconfigure Plymouth
    • If problem persists, may be some "framebuffer problem", so try (from this answer): echo "FRAMEBUFFER=y" | sudo tee -a /etc/initramfs-tools/conf.d/splash && sudo update-initramfs -u -k all
  • Bluetooth not working (and also not pairing with Bose QC 35 headphones)

    • This problem exists because Atheros re-used the chip VID and PID.
    • As a workaround you can patch the btusb.c module and change it form ath3k to Rome. But this is a lot of steps, so instead, download this package here which is referenced in this answer on askubuntu.
    • To get Bose QC 35 headphones paired (sovled with help from this answer:
      1. On Ubuntu, remove the headphones from the Bluetooth paired list. You can do this in the terminal also with bluetoothctl, spot the address and then remove aa:bb:cc:dd:ee:ff.
      2. On the headphones, hold the switch in Bluetooth pairing position for 10 seconds to delete all paired devices (You'll get a voice confirmation).
      3. If you can, deactivate Bluetooth on other surrounding devices to make sure they won't interact.
      4. sudo nano /etc/bluetooth/main.conf
      5. Replace #ControllerMode = dual with ControllerMode = bredr and restart with sudo service bluetooth restart
      6. Make sure the headphones are in pairing mode.
      7. Pair with System Settings > Bluetooth.
      8. Select & test the headphones in System Settings > Sound. You may want to choose High Fidelity Playback (A2DP Sink) for high playback quality.
      9. As it is only the pairing that has to be done without Bluetooth LE, once it is paired you can go back to the original configuration if you want.
      10. Still sometimes the headphones will not let me switch over to A2DP_sync. Running tail -f /var/log/syslog shows the error pulseaudio module-bluez5-device.c: Refused to switch profile to a2dp_sink: Not connected. So I have to restart bluetooth and then turn on/off the headphones. Also try setting AutoEnable=true in that main.conf file.

Bug and possible solution: actually I found a bug in that make the headset unusable, it seems that the pulse audio module: module-bluetooth-discover works only if started after the X11 session is up. So I have a workaround.

Edit the file:

  /etc/pulse/default.pa
  and comment out (with an # at the beginning of the line) the following line:

  #load-module module-bluetooth-discover
  now edit the file:

  /usr/bin/start-pulseaudio-x11
  and after the lines:

     if [ x”$SESSION_MANAGER” != x ] ; then
          /usr/bin/pactl load-module module-x11-xsmp “display=$DISPLAY session_manager=$SESSION_MANAGER” > /dev/null
      fi
  add the following line:

      /usr/bin/pactl load-module module-bluetooth-discover
  This way the Pulse audio’s Bluetooth modules will not be downloaded at boot time but after x11 is started.

Setting up JAVA / Eclipse

Installing the Oracle JDK

  sudo add-apt-repository ppa:webupd8team/java    # Add the PPA to your repository
  sudo apt-get update                             # Update your repository
  sudo apt-get install oracle-java8-installer     # Install

Setting the JAVA_HOME Environment Variable

First check alternatives. This is how java makes it easy to switch out versions. If you notice, in /usr/bin (which is on your PATH) those java executables (ie. javac) are symlinked to alternatives instead of the actual location such as /usr/lib/jvm/java-8-oracle/bin/.

  sudo update-alternatives --config java  # <-- notice the path, minus the /jre... part

The best way to add new environment variables is to create a shell script in the folder /etc/profile.d/. This is preferred over /etc/environment (which shouldn't be touched) or something like ~/.bashrc mainly due to the fact you want them to also run in a desktop session of graphical environment (you can read more about that in Ubuntu Help here):

  sudo nano /etc/profile.d/my-env-vars.sh   # create a new shell script to hold our env vars

Then add this line:

  export JAVA_HOME=/usr/lib/jvm/java-8-oracle

Then save the file and reopen your terminal. You can test with:

  echo $JAVA_HOME

Installing Eclipse IDE

Create a Folder for your Workspace

First create a folder where you want your Eclipse workspace. I typically do this:

  1. /home/david/projects/code <-- where all my Git repositories are
  2. /home/david/projects/workspace <-- my Eclipse workspace

Use the Eclipse Installer

The easiest way is to use the Eclipse Installer. Go to the website at the download packages page: http://www.eclipse.org/downloads/eclipse-packages/. At the top you should see "Try the Eclipse Installer" with a link to your OS 32bit/64bit. Download and run it. Then choose "Eclipse IDE for Java EE Developers" from the installer (this will give you some more packages you'll likely need for enterprise development).

Create an Application Shortcut

Create the file:

gedit ~/.local/share/applications/eclipse.desktop

Add this to the file and save:

[Desktop Entry]
Name=Eclipse
Type=Application
Exec=/home/david/eclipse/jee-oxygen/eclipse/eclipse
Terminal=false
Icon=/home/david/eclipse/jee-oxygen/eclipse/icon.xpm
Comment=Integrated Development Environment
NoDisplay=false
Categories=Development;IDE;
Name[en]=Eclipse
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment