Skip to content

Instantly share code, notes, and snippets.

@christofluethi
Last active February 13, 2021 06:59
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save christofluethi/1ac5bb1b90778d9b369e to your computer and use it in GitHub Desktop.
Save christofluethi/1ac5bb1b90778d9b369e to your computer and use it in GitHub Desktop.
HP Zbook 15 G3 Installation

HP ZBook 15 G3 - Ubuntu GNOME - 16.04 LTS

*: Included in the image

Disk /dev/nvme0n1: 477 GiB, 512110190592 bytes, 1000215216 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x7bb4c15f

Device         Boot     Start        End   Sectors   Size Id Type                       Mount
/dev/nvme0n1p1 *         2048     999423    997376   487M ef EFI (FAT-12/16/32)
/dev/nvme0n1p2      234375168  242374655   7999488   3.8G 82 Linux swap / Solaris
/dev/nvme0n1p3      242374656 1000214527 757839872 361.4G 83 Linux
/dev/nvme0n1p4         999424  234375167 233375744 111.3G 83 Linux

/dev/nvme0n1p4 on / type ext4 (rw,relatime,errors=remount-ro,data=ordered)
/dev/nvme0n1p3 on /home type ext4 (rw,relatime,data=ordered)
/dev/nvme0n1p1 on /boot/efi type vfat (rw,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)

Prerequisites

Hardware Issues - Display Driver Recovery

  • Install in UEFI Boot mode

If machine does not boot after installing:

  1. press shift while grub is loading (during bootup). this will give you the grub prompt.
  2. select "Advanced options for Ubuntu"
  3. select "recovery mode"
  4. select "resume"
    • Now the gui is partially be available but not fully operable.
  5. switch to console (ctrl+alt+f1)
  6. login as wlinstall or your own user
  7. enter startx to start the gui environment correctly
  8. open terminal and run sudo ubuntu-drivers autoinstall
  9. sudo reboot

Get rid of crash reports

sudo dpkg-reconfigure nvidia-361
sudo dpkg-reconfigure nvidia-361-uvm
sudo rm /var/crash/nvidia*

Basic system*

sudo apt-get install aptitude
sudo apt-get update
sudo apt-get upgrade
sudo aptitude install ubuntu-restricted-extras
sudo ubuntu-drivers autoinstall

Use gdm3 as login manager

sudo dpkg-reconfigure gdm3

Grub

Edit the following lines in /etc/default/grub to look like this:

# GRUB_HIDDEN_TIMEOUT=0
# GRUB_HIDDEN_TIMEOUT_QUIET=true

Run sudo update-grub

User

Replace --uid 1000 with your UserID.

sudo adduser --uid 1000 --gid 100 username
sudo adduser username adm
sudo adduser username sudo
sudo adduser username cdrom
sudo adduser username plugdev
sudo adduser username dip
sudo adduser username lpadmin
sudo adduser username sambashare
sudo adduser username wireshark

create a resource folder

mkdir ~/resources

create a tools folder

mkdir ~/tools

UMASK

Change UMASK to 002 in /etc/login.defs. Reboot to apply the changes.

Locale*

Set the default locale to en_US.UTF-8 in /etc/default/locale

sudo vi /etc/default/locale
LANG="en_US.UTF-8"
LANGUAGE="en_US.UTF-8"
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL="en_US.UTF-8"

Updates

  • applications > system tools > software & updates
    • When there are security updates: download and install automatically
  • applications > system tools > software updater
    • run update
reboot

Bluetooth disable on system boot*

make any changes before exit 0

sudo vi /etc/rc.local
-> add "rfkill block bluetooth"

Packages*

sudo aptitude install chromium-browser wireshark gimp subversion-tools maven openjdk-8-jdk apache2 imagemagick feh php libapache2-mod-php netcat iperf iptables iotop vlc curl gcc g++ xmlstarlet ghostscript make xsltproc openssh-server dconf-editor texmaker texlive-fonts-recommended git nmap unzip shutter texlive-full

Optional

sudo aptitude install gnuplot links2 lynx okular netem cifs-utils sketch
sudo aptitude install openvpn vpnc network-manager-vpnc network-manager-openvpn brasero
sudo aptitude install wv xlhtml ppthtml shared-mime-info libxml-parser-perl libexpat-dev poppler-utils automake libtool byacc flex libswitch-perl gettext gettext-base

Automount

To use automount proceed like this. Create folder data

mkdir /data

change /etc/auto.master to look like this.

$ cat /etc/auto.master
/data /etc/auto.cifs-shares --ghost

change /etc/auto.cifs-shares to look like this.

$ cat /etc/auto.cifs-shares
share1 -fstype=cifs,rw,credentials=/etc/fstab.credentials,file_mode=0664,dir_mode=0775,uid=username,gid=users ://srv.domain.ch/share1\$
share2 -fstype=cifs,rw,credentials=/etc/fstab.credentials,file_mode=0664,dir_mode=0775,uid=username,gid=users ://srv.domain.ch/xyz\$

Note: /etc/auto.cifs-shares and /etc/auto.master must have permissions 644

I'm not sure if you have to create the following folders yourself

  • /data/share1
  • /data/share2
sudo service autofs start

Get rid of IBUS CTRL+SPACE mapping*

only available if cinnamon is installed

  1. open dconf-editor
  2. Desktop > ibus > general > hotkey
    • The trigger and triggers setting will show control+space. Edit these settings out, being careful to leave empty brackets [] in triggers.

Cinnamon Desktop*

sudo add-apt-repository ppa:tsvetko.tsvetkov/cinnamon
  • In order to get the full Cinnamon experience you may also install the Cinnamon/Mint themes as well as the Mint icons/backgrounds.
sudo apt-get update
sudo aptitude install cinnamon

logout and use cinnamon as Desktop

UI Configuration

  • Menu > System Settings
    • Hot Corners * tl: desktop, tr: show all windows, br: show all workspaces
    • Panel * Panel Layout: Flipped * Use customized panel size * Allow scale * top panel height: ~1/3
    • Date and Time * Display the Date
    • Applets * Remove Keyboard * Add workspace switcher
    • Desktop * Mounted volumes
    • Keyboard * Layouts: German (Switzerland) * Shortcuts: Super+e Terminal, Super+w Home Folder, Super+l Lock
    • Mouse * Touchpad: Disable Touchpad while typing, Scrolling two finger scrolling, enable horizontal scrolling
    • Bluetooth * turn off
    • Power Management * When battery is critical: power off
    • Firewall * Profile Office rename to company * Enable Firewall and allow only 22, 80, 443, 8080 for inline traffic.

Smaller titlebars

change every occurance of title_vertical_pad to 4 (except second occurance which should be 3).

sudo vi /usr/share/themes/Adwaita/metacity-1/metacity-theme-3.xml

Restart Cinnamon: ALT+F2 -> r

Terminal Colors

wget -O /tmp/term.conf http://dev.shaped.ch/terminal.conf
gconftool-2 --load /tmp/term.conf

Backup Deja Dup

Keep backups for 30 days only

gsettings set org.gnome.DejaDup delete-after 30

ZSH

Install and change default shell

sudo apt-get install zsh
chsh -s /bin/zsh

Install Oh My ZSH and Powerline fonts

sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)
sudo apt-get install fonts-powerline

Configure ZSH

vim ~/.zshrc

Theme

Change [ZSH_THEME="robbyrussell"] to [ZSH_THEME="agnoster"]

ZSH_THEME="agnoster"
Change theme colors to solarize

dconf is required if you don't already have it.

sudo apt-get install dconf-cli
git clone git://github.com/sigurdga/gnome-terminal-colors-solarized.git ~/.solarized
cd ~/.solarized
./install.sh
  • I recommend you option 1 (dark theme) which is just great.
  • Choose option 1 to download seebi' dircolors-solarized

After installation, open .zshrc and add the line:

eval `dircolors ~/.dir_colors/dircolors`

Development Applications

Docker

sudo aptitude install docker

Change the bridge interface ip edit /etc/docker/daemon.json to include the bip setting

{
  "bip": "192.168.252.1/24"
}

GIT

sudo aptitude install git
git config --global user.name "NAME"
git config --global user.email "EMAIL"
ssh-keygen -t rsa -C "EMAIL"

paste the generated key to github account. verify with:

ssh -T git@github.com
Hi xy! You've successfully authenticated, but GitHub does not provide shell access.

Vim

Install VIM instead of VI

sudo aptitude install vim

Download configuration

cd ~/
wget -O ~/.vimrc http://dev.shaped.ch/vimrc

Set default editor to vim.basic using:

sudo update-alternatives --config editor

VIM Airline Plugin

mkdir ~/.vim
cd ~/.vim
wget -O airline-master.zip https://github.com/bling/vim-airline/archive/master.zip
unzip airline-master.zip
mv vim-airline-master/* ~/.vim/

VIM Emmet Plugin

wget -O emmet-master.zip https://github.com/mattn/emmet-vim/archive/master.zip
unzip emmet-master.zip
cp emmet-vim-master/plugin/emmet.vim ~/.vim/plugin/
cp emmet-vim-master/autoload/emmet.vim ~/.vim/autoload/
cp -a emmet-vim-master/autoload/emmet ~/.vim/autoload/

VIM Supertab Plugin

cd ~/.vim
wget -O supertab-master.zip https://github.com/ervandew/supertab/archive/master.zip
unzip supertab-master.zip
cp supertab-master/plugin/supertab.vim ~/.vim/plugin/
cp supertab-master/plugin/supertab.vim ~/.vim

Bash

wget -O  ~/.bashrc http://dev.shaped.ch/bashrc
source ~/.bashrc

Local Tomcat

  • Download Apache Tomcat 7 to ~/resources

IDEs

  • Download intellij to ~/tools
  • Download eclipse to ~/tools
  • Download rubymine to ~/tools

Intellij

tar -xvzf ideaIU-14.1.1.tar.gz
ln -s ~/tools/idea-IU-141.178.9/ ~/idea

Import the settings for Jetbrains IntelliJ

wget -O intellij-settings.jar http://dev.shaped.ch/intellij-settings.jar

Now use File > Import Settings to import the settings in IntelliJ

Eclipse

tar -xvzf eclipse-jee-luna-SR2-linux-gtk-x86_64.tar.gz
mv eclipse eclipse-luna
ln -s ~/tools/eclipse-luna/ ~/eclipse

RubyMine

tar -xvzf RubyMine-7.0.4.tar.gz
ln -s ~/tools/RubyMine-7.0.4/ ~/rubymine

Other Tools

JProfiler

  • Downlaod and install jprofiler7 to ~/tools
    • License Available

VisualParadigm

  • Downlaod and install VisualParadigm 11.1 to ~/tools
    • Use Perpertual Licence

VisualVM

  • Downlaod and install VisualVM to ~/tools

JMeter

  • Downlaod and install JMeter to ~/tools

Apache Luke

  • Downlaod and install Apache Luke to ~/tools

Spotify

sudo apt-add-repository -y "deb http://repository.spotify.com stable non-free"
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 94558F59
sudo apt-get update -qq
sudo aptitude install spotify-client

Skype

  • Software & Updates > Other Software > Enable "Canonical Partners"
sudo aptitude install skype

Sublime Text 3

sudo add-apt-repository ppa:webupd8team/sublime-text-3
sudo apt-get update
sudo aptitude install sublime-text
@sofieneJamel
Copy link

nice job ;)

@philgrazi
Copy link

After reinstalling Ubuntu 16.04 LTS I ran the sudo Ubuntu driver auto install and it fixed my driver's. Thank you for finding that. NOW I CAN BOOT WITHOUT NEEDING RECOVERY MODE OR NOMODESET

@FahadRazaKhan
Copy link

I had the same problem (after installation black screen), I changed the GPU setting in the BIOS to Discreet instead of Hybrid. It worked for me. Thank you for your help.

@pierpiero83
Copy link

Hi and thanks for the very informative guide.
Did you try to install Ubuntu 18.04? Any issue with drivers?
I have a AMD firePRO W5170M graphic card system and I can't find any driver for it.

@christofluethi
Copy link
Author

Hi and thanks for the very informative guide.
Did you try to install Ubuntu 18.04? Any issue with drivers?
I have a AMD firePRO W5170M graphic card system and I can't find any driver for it.

i did once but had the issue of freezing after booting. however, i think this is resolvable with bios settings but now i'm still on 16.04.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment