Fedora Workstation

Setup using ansible

Before walking through the full installation with explicit instructions, I will go over the ansible install instructions. First, install the system, using KDE and Gnome, and update the packages using yum.

Install rpmfusion

su -c 'yum localinstall --nogpgcheck \
http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm \
http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm'

Install other software

sudo yum install ansible keychain git vim firefox</code>

Configuring git and fetching the repo

add ~/.gitconfig file

[user]
name = Patrick Malsom
email = patrickmalsom@gmail.com
  • generate ssh key and add to gitlab

ssh-keygen -t rsa

  • add ansible git repo
  • run workstation playbook

Extra configuration (use instructions below)

  • SSD configuration for TRIM

Fedora Desktop Install

This page is a (personal) guide for setting up a Linux-GNU Fedora desktop or server computer.

First Things First... install the base system using the Fedora Installer. I always recommend using the DVD media unless there is a good reason not to (ie: no DVD drive). I personally recommend KDE or LXDE as a desktop manager.

My Standard Installation

Desktop Environments KDE, LXDE(optional)
Applications Editors, Graphical Internet, Text Internet
Development None
Servers Printing
Base System (Defaults)
Languages None

General things to do

  • Make all new users for the system with useradd username
  • Turn SELinux to disabled in /etc/selinux/config
  • turn off the firewall: sudo systemctl disable firewalld.service

SSD configuration

Solid State Disks (SSD) require a few special options to enable trim support. The storage system configuration is saved in /etc/fstab. The best way to find the partitions is sudo fdisk -l | grep dev

The preferred method of identification of disks is through uuid's, which can be found using ls -l /dev/disk/by-uuid/

If using an SSD for the root/home partitions the mount options should include noatime and discard. Example fstab entry for the ssd

UUID=30bdb3ab-fb3a-4657-93a1-105976ff9617  /       xfs    defaults,noatime,discard   0 1
UUID=81e80168-284b-4341-9730-582c26e81be1  /boot   xfs    defaults,noatime,discard   0 2
UUID=5c26c001-a8d6-4c31-b77a-3dad7e50e586  swap    swap   defaults                   0 0

When using an SSD for the root drive, change the swapiness of the OS

echo "vm.swappiness=1" >> /etc/sysctl.conf

Network Setup

A few things to do to get the network up. I will assume that you are using dhcp.

  • edit /etc/sysconfig/network/ifcfg-p10p1
    • p10p1 might be different, it should be the device with the ip given in ifconfig
    • DHCP_HOSTNAME="hostname"

Installing rpmfusion

RPMFusion is a very useful repositry for Fedora. It includes software that is not supported by Red Hat. Almost all of the following relies in some way on it. It is highly recommended to include this in a desktop environment.

This will only work if you are using a stable relase of Fedora. Furthermore it might not work in the first few weeks of a new stable release as many of the packages must be rebuilt by RPM-Fusion.

su -c 'yum localinstall --nogpgcheck \ 
  http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm \
  http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm'

AwesomeWM Setup

AwesomeWM is my personal windowing manager of choice. It is a tiling window manager and not recommended for a regular/standard desktop manager. If you are looking for a regular desktop environment, try KDE or LXDE.

sudo yum install awesome Terminal
touch ~/.xinitrc
echo "exec awesome" > ~/.xinitrc

Dont forget to copy the config files!

Sound Mixer

Sometimes the sound is WAY too quiet. You can usually turn up the master volume using ALSA utilities. sudo yum install alsa-utils To use the mixer use the following sudo alsamixer -c 0 Edit to the settings that you require and esc to exit the program. To save the settings run: sudo alsactl store

If you want to switch devices in pulse audio things are a bit different. First find the device you want to use with pacmd list-sinks Once you have found the device edit /etc/pulse/default.pa with the following line set-default-sink [device-num]

Install MP3 Codec

sudo yum install gstreamer-plugins-ugly

Other Installed Software

All software installed using sudo yum install

sudo yum install pidgin zsh ksh htop vim screen ncdu gcc gcc-c++ gcc-gfortran \
  rdiff-backup ffmpeg tmux Terminal evince gsl-devel elinks cmus tcsh \
  compat-gcc-34-g77 emacs vim python python-matplotlib scipy python3 kernel-devel \
  bash-completion ipython keychain levien-inconsolata-fonts unison

RC Files

All configuration files have been moved to ansible!

Also included is a script that will initialize the rc files to the standard location for Fedora.

manpatrc

Firefox

Firefox! You should use it, or I will make fun of you (for legitimate privacy and security reasons). Chrome (The GOOG) tracks you, Safari (Apple) is evil, IE (Microsoft) is just a bad browser... and is also evil. In all seriousness, the security/privacy plugins are necessary. Be careful about your security and information!

Flash

Flash has been discontinued for GNU+Linux... oh well, html5 here we go! Gnash is a gnu free alternative to flash player. For the firefox plugin, install from the yum repos: sudo yum install gnash-plugin

Suggested Add Ons

  • Firefox Sync: Built into Firefox. Synchronizes your bookmarks and such to multiple computers.
  • AdBlock+: Blocks advertisements and thus tracking cookies.
  • Preferred subscription: Fanboy
  • BetterPrivacy: Tool for managing/removing LSO's (flash cookies). need to manually configure it to use ".gnash/SharedObjects".
  • httpsEverywhere: default the page to SSL connection if available.
  • ghostery: block most cookies from the major ad companies and others.
  • DuckDuckGo-SSL: Search engine that does not track you like an ex-convict (ehem... Google).
  • NoScript: Blocks scripts from running! Required of a browser. Requires a bit of tuning to get working perfectly. This plugin is especially useful for Windows machines.
  • Vimperator: Makes Firefox behave like vim. Amazing if you are used to vim commands. There are a couple things to set up. Commands given inside of firefox after the plugin is installed, just like vim commands
:set defsearch=duckduckgo-ssl
:mkv

Thunderbird

sudo yum install thunderbird thunderbird-lightning Gmail setup is automatic other than disabling dowloading of emails and disabling junk settings. Then manually disable downloading of emails and junk settings. UC Mail is not automatic... * INCOMING * server name - pod51000.outlook.com:993 * user name - "UCID"@mail.uc.edu * security - SSL/TLS w/ password * OUTGOING * server name - pod51000.outlook.com:587 * Security - STARTTLS w/ password * user name - "UCID"@mail.uc.edu

If you like your settings and addons that you have with thunderbird you can copy them so you dont have to reset it up every time you reinstall. you can rename your profile by renaming the folder and editing the *****.profile file to reflect the changed folder name. Copy the following files from the .thunderbird folder:

******.profile
******.default/prefs.js
******.default/extensions

Add Ons

  • Firetray: Minimize to tray in Linux. (Must download and install manually)
  • Zindus: Sync local address book with Gmail.
  • Enigmail: GPG encryption and signing plugin.
  • External Editor: Use an external editor to write messages (ex: vim).
  • provider for google calendar: Full google calendar integration/sync.

Mount Samba share (Hauck)

sudo mount -t cifs -o username=***,password=*** //slapdash.geop.uc.edu/hauck /mnt/Hauck/
sudo umount -t cifs /mnt/Hauck/

Installing Virtualbox

First get the Virtualbox RPM file. Now you need to get a couple of dependencies before you install. sudo yum install make automake autoconf gcc kernel-devel dkms Use yum localinstall to install the .rpm file. If the setup fails after the installation you will have to run sudo /etc/init.d/vboxdrv setup

Unison file syncronization

Unison is a file syncronization tool. It is very useful for keeping multiple dirctories on different computers in sync. The following installs the GTK version:

sudo yum install unison227`

Use Unison with a profile to take full advantage of the program. An example profile is show below. An example file path for the profile is ~/.unison/example-profile.prf

root = /home/USER
root = ssh://user@ipaddress//home/USER/
sshargs = -C -c blowfish -p 555
path = Desktop
ignore = Name *.iso

Free NX

FreeNX is a better alternative to VNC. It is reasonably fast over broadband (very useable as a desktop environment) and very fast over local networks (plays video over gigabit). If there is a need to use a desktop remotely (ie: Mathematica notebooks) this is the software to use. I recommend using KDE as the default desktop manager if freeNX is going to be used extensivley, as it is nativley supported. Gnome-3 is useful for a user that only needs to complete specific tasks but must be used in fallback mode. Gnome-3 in fallback mode is what is configured below.

sudo yum install freenx-server
sudo nxsetup --install --setup-nomachine-key
sudo vim /etc/nxserver/node.conf

Edit /etc/nxserver/node.conf with the correct sshd port of the server and uncomment/add the following.

ENABLE_PASSDB_AUTHENTICATION="0"
ENABLE_SSH_AUTHENTICATION="1"
ENABLE_CLIPBOARD="both"
NX_LOG_LEVEL=4
COMMAND_START_GNOME="/usr/bin/gnome-session --session=gnome-fallback"

Now enable the services using systemctl

sudo systemctl enable freenx-server.service
sudo systemctl start freenx-server.service

Get the NoMachine NX Client Product for your system and set up a profile with the correct settings from above. NX should run on the remote machine. The best viewer is the NoMachine (proprietary) client and it is available for linux, Windows and Mac. Simply download from their website and configure the settings to connect to the server. If if the server is inside of UC's network you will need to VPN in before tryig to log into the freeNX server.

LaTeX installation

sudo yum install texlive texlive-dvips texlive-texmf-doc vim-latex kile (KDE integrated \(\LaTeX\) environment) is a good IDE if you are an inexperienced latex user (install using: sudo yum install kile) For experienced users, just use vim (or emacs, if you hate yourself... just kidding). After becoming familiar with \(\LaTeX\), using an advanced editor is much faster than using an IDE.

UC DNS hostname resolution

UC's DNS does not work with fedora for some reason. DNS will resolve the correct hostname by adding the following to /etc/sysconfig/network-scripts/ifcfg-eth0 DHCP_HOSTNAME="hostname-here"

Installing Skype

Installing skype on a 32-bit Fedora machine is very easy. Simply download the 32-bit YUM install file from the skype website. sudo yum localinstall /home/$USER/Downloads/skype-*-fedora.i586 For a 32-bit machine skype, should now be installed. For a 64 bit install you should install the above i586 32-bit yum application and then install the following 32-bit libraries

sudo yum install pulseaudio-libs.i686 pulseaudio-libs-devel.i686 \
  alsa-plugins-pulseaudio.i686 libv4l.i686 libXv.i686 libXv-devel.i686 \
  libXScrnSaver.i686 libXScrnSaver-devel.i686 dbus-qt.i686 \
  dbus-qt-devel.i686 qt.i686 qt-devel.i686

You will then have to configure the dynamic linker to recognize the new i586 libraries by running the following sudo ldconfig

Using ssh keys

To generate a key on a workstation (NOT on the server you will be logging in to), generate an rsa key called id_rsa.pub and a private key called id_rsa.

The id_rsa PRIVATE key should never be shared with anyone! This file contains your new rsa password.

At the prompts you should use a reasonable password to encrypt the key. ssh-keygen -t rsa

Also you should make sure the correct permissions are set for the .ssh folder and its contents. Do this as your normal user (NOT root!)

chmod 700 ~/.ssh
chmod 600 ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa.pub
chmod 600 ~/.ssh/known_hosts
chown -R $USER:$USER ~/.ssh

You also might what to use a keychain that can save your passwords and thus automatically login. My prefered keychain is called 'keychain' and is a command line utility. Install using

sudo yum install -y keychain

In .zshrc or .bashrc add an alias to the ssh command:

alias ssh='eval $(/usr/bin/keychain --eval --agents ssh -Q --quiet ~/.ssh/id_rsa) && ssh'

To add the public key to a server with name "myserver.com" simply call

ssh-copy-id myserver.com

For some reason, a computer seemed to have problems adding keys to keychain. the solution to this seems to be adding the key to ssh-agent

ssh-add ~/.ssh/id_rsa

NVidia Driver installation

For a regular desktop system a package manager can keep all of your drivers up to date and working with automatic kernel updates. The rpmfusion repositories are necessary to install this driver. I will also assume that this is non-legacy hardware (better than 6000 series). First install the nvidia driver:

yum install kmod-nvidia

Rebuild your kernel configuration (otherwise it may try to load a conflicting driver during boot):

new-kernel-pkg --mkinitrd --dracut --update \
  $(rpm -q --queryformat="%{version}-%{release}.%{arch}\n" kernel | tail -n 1)

Reboot the machine and everything should be done!

Vertical Monitors

for dual vertical 1080P monitors the the tops of the monitors at the center run the following

xrandr --output DVI-I-2 --mode 1920x1080 --pos 0x0 --rotate left \
  --output DVI-I-3 --mode 1920x1080 --pos 1080x0 --rotate right

Asus Zenbook keyboard backlights

#!/bin/bash

VAL=$(cat /sys/class/leds/phy0-led/brightness)

if [ "$1" = "1" ] && [ "$VAL" -lt "3" ]; then
  echo $(($VAL+1)) > /sys/class/leds/phy0-led/brightness
fi

if [ "$1" = "1" ] && [ "$VAL" = "3" ]; then
  echo "2" > /sys/class/leds/phy0-led/brightness
  sleep 0.2
  echo "3" > /sys/class/leds/phy0-led/brightness
fi

if [ "$1" = "0" ] && [ "$VAL" -gt "0" ]; then
  echo $(($VAL-1)) > /sys/class/leds/phy0-led/brightness
fi