Difference between revisions of "Leo:Ubuntu config"

From DiLab
Jump to: navigation, search
(Video playback and edit)
(Editors and IDEs)
Line 54: Line 54:
====Editors and IDEs====
====Editors and IDEs====


sudo apt-get install mc emacs-snapshot geany texinfo
sudo apt-get install mc geany texinfo


Install [http://www.sublimetext.com Sublime Text editor] from http://www.sublimetext.com/3
Install [http://www.sublimetext.com Sublime Text editor] from http://www.sublimetext.com/3

Revision as of 07:59, 2 September 2015

This list gets updated as I remember or install new essentials for my Ubuntu environment.


Private config

I have my private config in a SVN repository, so I can update my various workspaces. Some examples for stuff in my configuration:

  • startup scripts: .bashrc and various dot-files
  • aliases
  • ~/bin - various custom scripts
  • ~/lib - custom libraries
  • icons
  • work environment configurations, for example, custom menus in Nautilus

One could keep the configuration in Dropbox or similar cloud storage, but I choose not to because of security reasons.


Config

Power button to shutdown, no prompts

sudo gedit /etc/acpi/events/powerbtn
  1. Add # to comment the line: # action=/etc/acpi/powerbtn.sh
  2. Add a new line: action=/sbin/poweroff
  3. Save file
sudo acpid restart

System essentials

Communication, access

SSH server for remote access, subversion

sudo apt-get install openssh-server subversion

Desktop alternative

Gnome 3 and others

sudo apt-get install gnome-shell

Tweak tools

The latest Ubuntu-tweak is not in standard repos, so add the latest:

sudo add-apt-repository ppa:tualatrix/ppa
sudo apt-get update
sudo apt-get install ubuntu-tweak

The other tweak tools:

sudo apt-get install unity-tweak-tool
sudo apt-get install gnome-tweak-tool
sudo apt-get install compizconfig-settings-manager

Development environment

Editors and IDEs

sudo apt-get install mc geany texinfo

Install Sublime Text editor from http://www.sublimetext.com/3

Build and test tools

sudo apt-get install build-essential gtkterm 

Version control

sudo apt-get install git subversion rapidsvn meld

May also consider installing FreeFileSync for convenient file synchronization across directories or filesystems.

sudo add-apt-repository ppa:freefilesync/ffs
sudo apt-get update
sudo apt-get install freefilesync

Media

Photos and graphics

sudo apt-get install gimp

Video playback and edit

sudo apt-get install ubuntu-restricted-extras flashplugin-installer mplayer avidemux vlc

To get DVDs playing nicely

sudo apt-get install libdvdread4 
sudo /usr/share/doc/libdvdread4/install-css.sh

Media centers: Kodi/XBMC is now in Ubuntu repository. But I prefer the newer team-xbmc/ppa

sudo apt-get install python-software-properties pkg-config software-properties-common
sudo add-apt-repository ppa:team-xbmc/ppa
sudo apt-get update
sudo apt-get install kodi

Common codecs:

sudo apt-get install libxine1-ffmpeg gxine mencoder totem-mozilla icedax tagtool easytag id3tool lame nautilus-script-audio-convert libmad0 mpg321

Latex

sudo apt-get install texlive texlive-latex-extra texlive-xetex texlive-fonts-recommended texlive-publishers texinfo


Microsoft fonts

...so that MS documents look better.

sudo apt-get install msttcorefonts
sudo fc-cache -fv


Virtual Box

Get the latest VirtualBox for Linux here.

After that, restore your saved VirtualBox images. The location depends on your current version and setup, but here are a few usual suspects: ".VirtualBox", "VirtualBox VMs"


Secured Filesystem

Cloud file storage such as Dropbox is nice. Even nicer if it is encrypted. Here is how:

Install prerequisites

sudo apt-get install encfs libpam-mount
sudo adduser <<yourusername>> fuse

For syncing you may want dvcs-autosync for syncing with your own servers:

sudo apt-get install dvcs-autosync

Set up the mount for secured filesystem

encfs path-to-mountpoint-dir path-to-storage-dir-for-encrypted-files

Enter the relevant parameters and the password (Same as for the logging in, if you want to auto-mount this at login). 'p' for paranoia parameters work, but 'x' for expert may yield better performance with the following options:

  • ‘1’ to use the AES cipher algorithm
  • ‘256’ for the key size
  • ‘1024’ for the block size
  • ‘1’ for block filename encoding
  • ‘y’ for filename initialization vector chaining
  • ‘n’ for per-file initialization vectors
  • ‘n’ for block authentication code headers
  • '0' for no random bytes to each block header
  • ‘y’ for file-hole pass-through

Note, the mounted directory may not be able to use hard links to files due to chaining enabled.

Setup auto-mount at login

sudo gedit /etc/security/pam_mount.conf.xml

Look for the line:

<!-- Volume definitions -->

Add this new line below:

<volume user="<yourusername>" fstype="fuse" path="encfs#/home/<yourusername>/<encfs-storage-dir>" mountpoint="/home/<yourusername>/<encfs-mountpoint>" />

Credit for this goes to this site.

Alternative: Add encfs password to keyring

Put the EncFS password into the keyring:

python gkeyring.py --set -n "Dropbox Private" -p encfs=dropbox --keyring login
> Password: <enter EncFS password here>

Mounting the EncFS folder with a Python script. Add this script to the list of start-up applications:

#!/usr/bin/python2.6

import os.path
import subprocess
import sys
import gtk
import gnomekeyring as gk

# paths constants:
PATH_ENCRYPTED = os.path.expanduser("~/Dropbox/Encrypted")
PATH_DECRYPTED = os.path.expanduser("~/Private")

# get the encfs-dropbox item:
try:
    items = gk.find_items_sync(gk.ITEM_GENERIC_SECRET, {"encfs": "dropbox"})
    item = items[0] # clean up your keyring if this list has multiple items
except gk.NoMatchError:
    print("no entry in keyring")
    sys.exit(1)

# run encfs:
cmd = ["encfs", "-S", PATH_ENCRYPTED, PATH_DECRYPTED]
p = subprocess.Popen(cmd, stdin=subprocess.PIPE)
err = p.communicate(input="%s\n" % item.secret)[1]

# either there is an error or we are done:
if err:
    print(err)
    sys.exit(1)

Credit for this goes to this site

SSD tweaks

These may become obsolete as the new OS versions take in account the SSD particularities automatically.

  • Add noatime option for the partition on SSD in /etc/fstab
UUID=my-partition-key  /  ext4    noatime,errors=remount-ro 0       1
  • Create /tmp in RAM by editing /etc/fstab
tmpfs /tmp tmpfs defaults,noatime,mode=1777 0 0
  • Set the scheduler to deadline (as opposed to cfq) in grub
    • Check for the options:
cat /sys/block/sda/queue/scheduler
    • Temporary change the scheduler
sudo su
echo deadline > /sys/block/sda/queue/scheduler
  • Move Firefox cache to /tmp/...
    • open [about:config] in firefox
    • create new string browser.cache.disk.parent_directory and set value to /tmp
  • Check the read speed of your HD:
sudo hdparm -t /dev/sda