Miscellaneous setup

From Smith family
Jump to: navigation, search
Server setup
← Previous Next →
Ghost VNC

A couple of minor little things, more as personal taste than as functional changes.

Noisy boot

This is for the server machine. If I'm booting the server when it's attached to a monitor, it means there's something wrong with it. In that case, I want to see everything that's happening in the boot process.

These instructions are for Grub-legacy.

  • Edit /boot/grub/menu.lst
## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
## defoptions=quiet splash
# defoptions=
  • Regenerate the Grub menu
root@server:~# update-grub

Clean up Apt cache

Apt keeps copies of all the files it downloads. This can take up lots of disk space. aptitude autoclean discards the package files for obsolete package versions. Doing this weekly via a cron job stops the cache getting too big.

Create /etc/cron.weekly/aptitude-autoclean:

#! /bin/sh

# aptitude-autoclean      Cron script to clear apt cache of unneeded files.

aptitude autoclean

Then make the file executable:

root@server:~# chmod a+x /etc/cron.weekly/aptitude-autoclean

Remove old kernels

Old kernels hang around and clog up the /boot partition. Once you're sure the current kernel works fine, you can remove old kernels with this command:

root@server:~# dpkg -l linux-* | awk '/^ii/{ print $2}' | grep -v -e `uname -r | cut -f1,2 -d"-"` | grep -v -e 'libc' | grep -e [0-9] | xargs aptitude remove

Install additional packages

This is mainly for the desktop machine: a few additional packages to install.

Normal packages

This is starting from a basic Kubuntu installation.

First, install some general catch-all metapackages:

 root@desktop:~# aptitude install kde-full ubuntu-desktop

Then install

 root@desktop:~# aptitude install kubuntu-restricted-extras ubuntu-restricted-extras
for MP3 and other playback: it should install a number of other things for you. Agree to removing libavcodec53 and libavutil51 and ensure that libavcodec-extra-53 and libavutil-extra-51 are installed. (The -extra packages supercede the original ones.)

For DVD playback, install dvdcss:

root@desktop:~# aptitude install libdvdread4
root@desktop:~# /usr/share/doc/libdvdread4/install-css.sh

Then install all the packages in the additional packages list. Download the file as packages-to-install.list then install the packages with the command:

root@desktop:~# aptitude install $(< packages-to-install.list )

(Generate the package list with

user@desktop:~$ comm -23 <(aptitude search '~i !~M' -F '%p' | sed "s/ *$//" | sort -u) <(gzip -dc /var/log/installer/initial-status.gz | sed -n 's/^Package: //p' | sort -u) > manually-installed-packages.txt

)

Note that many of them may already be installed from previous steps.

Downloads

Install these from normal downloads:

VUE and Google Earth must be installed as a normal user. If you want them available to all users, you'll need to jiggle things around. Before installation, create a directory (somewhere like /opt) and make it world-writable. Then install the software into that directory as a normal user. VUE reports an error after installation, but it can be safely ignored.

Acrobat Reader isn't in the official 13.10 repo, so you have to install it by hand. In addition, it only comes as a 32-bit binary, it it needs additional libraries.

  • Download the .deb file: [1]
  • Install some additional packages
root@desktop:~$ aptitude install libxml2:i386 lib32stdc++6 libgtk2.0-0:i386
  • Install the deb:
root@desktop:~$ dpkg -i --force-architecture AdbeRdr9.5.5-1_i386linux_enu.deb && apt-get -f install

Firefox extensions

Add these Firefox extensions

  • Greasemonkey
  • Greasefire
  • NoScript
  • TabMixPlus
  • AdBlocke Plus
  • Better YouTube
  • Echofon

(More details at the Kubuntu Guide.)

Install Ruby

  • Install RMV as a multi-user environment:
user@desktop:~$ curl -sSL https://get.rvm.io | sudo bash -s stable
Note that this command must be run as a non-root user with sudo.
  • Add users to the rvm group:
user@desktop:~$ sudo adduser user rvm
  • Allow non-login shells to read the rvm.sh script. Add the following to each user's ~/.bashrc file (including root's):
if [ -f /etc/profile.d/rvm.sh ]; then
  source /etc/profile.d/rvm.sh
fi
  • Add the same two lines to /etc/bash.bashrc so that newly created users get it added to their ~/.bashrcs.
(Yes, this contradicts the recommendation from RVM, but I think it's the more sensible place to put it.)
  • Reboot so that the new group permissions to take effect.
  • Install any additional packages:
root@desktop:~# rvm requirements
  • Install the Rubies you want:
user@desktop:~$ rvm list known
user@desktop:~$ rvm install 2.1.0
user@desktop:~$ rvm install 1.9.3
  • Make sure bundler is installed (note that it's done as root):
root@desktop:~# gem install bundler
  • Add the following two lines to /etc/rvmrc
rvm_project_rvmrc_default=1
rvm_autoinstall_bundler_flag=1 

Starting a new Ruby project

When creating a new project, add a Gemfile like this one:

source 'https://rubygems.org' 
ruby "2.1.0"
gem 'nokogiri' 
gem 'rack', '~>1.1' 
gem 'rspec', :require => 'spec'

Then run

user@desktop:~/path/to/project$ bundle install --binstubs

See also the Ruby on Rails installation.

See also:

Install Python3 and associated packages

  • If you haven't already, install the basic packages:
user@desktop:~$ sudo aptitude install python-all python3-all python-pip python3-pip 
  • Then install various other scientific pacakges:
user@desktop:~$ sudo aptitude install build-essential tk-dev libpng12-dev pandoc
user@desktop:~$ sudo aptitude install python3-dev python3-tk python3-numpy python3-scipy python3-pandas
user@desktop:~$ sudo aptitude install python-dev python-tk python-numpy python-scipy python-pandas python-sklearn
user@desktop:~$ sudo aptitude install ipython ipython-notebook ipython3 ipython3-notebook 
user@desktop:~$ sudo aptitude install python-mpltoolkits.basemap python-pymongo python3-pymongo

  • Install Scikit-learn for Python3
user@desktop:~$ sudo pip3 install scikit-learn
user@desktop:~$ sudo pip3 install jupyter jupyter_nbextensions_configurator jupyter_contrib_nbextensions

user@desktop:~$ sudo jupyter nbextensions_configurator enable --system 
user@desktop:~$ sudo jupyter contrib nbextension install --system --symlink

Install matplotlib basemap for Python3

  • Install the GEOS library
user@desktop:~$ sudo aptitude install libgeos-dev
user@desktop:~$ sudo python3 setup.py install
  • Check it
user@desktop:~$ python3
Python 3.4.0 (default, Apr 11 2014, 13:05:11) 
[GCC 4.8.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from mpl_toolkits.basemap import Basemap
>>> 
(you're expecting no errors)

Older instructions

  • Install pylinter:
user@desktop:~$ sudo pip install pylint
user@desktop:~$ sudo pip3 install pylint
  • Install IPython:
user@desktop:~$ sudo pip install matplotlib ipython[all]
user@desktop:~$ sudo pip3 install matplotlib ipython[all]

If you want to use Virtual environments, you can use the built-in venv in Python3 or the add-on virtualenv for Python2.

  • Install Virtualenv and Virtualenvwrapper:
user@desktop:~$ sudo pip install virtualenv virtualenvwrapper
  • Append these lines to ~/.bashrc 
VIRTUALENVWRAPPER_PYTHON='/usr/bin/python'
export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/Documents/programming
source /usr/local/bin/virtualenvwrapper.sh
Then source it
 user@desktop:~$ . ~/.bashrc
  • Create a virtual environment:
user@desktop:~$ makevirtualenv pbasic
To use it, use the workon command, and use deactivate to stop using it:
user@desktop:~$ workon pbasic
(p3basic)user@desktop:~$ deactivate

Alternative

An alternative installation, using Pip not the Ubuntu package manager: http://bikulov.org/blog/2014/05/14/install-up-to-date-scientific-environment-in-ubuntu-14-dot-04-with-python-3-dot-4/

Install IRuby notebooks

A bit more complex than it needs to be.

  • First, install all the compilation requirements, then finally IRuby
root@desktop:~# aptitude install build-essential libtool-bin automake autoconf autogen
root@desktop:~# aptitude install libczmq3 libczmq-dev
root@desktop:~# gem update --system
root@desktop:~# gem install bundler
root@desktop:~# gem install rbczmq -- --with-system-libs
root@desktop:~# gem install pry pry-doc awesome_print gnuplot rubyvis nyaplot
root@desktop:~# gem install iruby
  • In the project you'll be working, create the Gemfile with contents:
gem "iruby"
gem 'rbczmq'
gem 'ffi'
gem 'pry'
gem 'nyaplot'
gem 'gnuplot'
gem 'awesome_print'
  • Start IRuby with
 user@desktop:~$ iruby notebook

Install R language

I install the Bionic packages for R 3.5 from Cran.

  • Import the public key for these packages:
root@desktop:~# apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 51716619E084DAB9
  • Install the package source list. Create the file /etc/apt/sources.list.d/r-language-cran.list to contain the line
deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/
  • Install the R 3.5 files
root@desktop:~# aptitude update
root@desktop:~# aptitude install r-base

Install extra system monitoring tools

  • Install htop:
root@server:~# aptitude install htop
root@server:~# htop
  • Install glances (requires Python2):
root@server:~# aptitude install python-dev
root@server:~# pip install Glances PySensors
root@server:~# glances

KMail server account

KMail doesn't seem to pick up the local machine name when sending mail. It seems to give the local host name as desktop.localnet rather than desktop.domain.tld. Therefore, when setting up the SMTP sending in KMail, set the local hostname in the 'Send custom hostname' field in the 'Advanced' tab of the SMTP transport settings dialog.

Emacs configuration

I like using Emacs, and here are a couple of simple tweaks to include in the ~/.emacs configuration file:

;; .emacs 

;;; uncomment this line to disable loading of "default.el" at startup
;; (setq inhibit-default-init t) 

;; turn on font-lock mode
(when (fboundp 'global-font-lock-mode)
  (global-font-lock-mode t))

;; enable visual feedback on selections
(setq transient-mark-mode t)

;; default to better frame titles
(setq frame-title-format
      (concat  "%b - emacs@" system-name))

;; don't display the splash screen
(setq inhibit-startup-message t)

;; Enable SLIME
(setq inferior-lisp-program "/usr/bin/sbcl")
(add-to-list 'load-path "/usr/share/emacs/site-lisp/slime")
(require 'slime)
(slime-setup)

To run SLIME, type M-x slime in Emacs.

Password-less SSH logins

Let's say you want account user@desktop.domain.tld to be able to log into account someone@server.domain.tld without a password. Let's also assume that you can already SSH into someone@server.domain.tld with a password.

  • Log into user@desktop.domain.tld
  • Generate the keycode pair for this user:
user@desktop:~$ ssh-keygen -t rsa
Accept the default location for the file (~/.ssh/) and just press <Enter> when asked for a passphrase.

This has generated a private key (~/.ssh/id_rsa) and a public key (~/.ssh/id_rsa.pub). If you tell SSH on the server machine about the public key, the server machine will trust logins from that machine. This is done on a per-user basis.

To allow a user here to log in as a someone over there, do this as the user here:

user@here:~$ ssh-copy-id someone@there

user@here should now be able to start SSH sessions as someone@there without giving someone's password:

user@desktop:~S ssh someone@there
<login banner snipped>
someone@there:~S

Read detailed instructions and some clear instructions.

Make Konqueror the default file manager

Ubuntu has chosen Dolphin as the default file manager for KDE. I prefer to use Konqueror, as I like the old-fashioned directory tree list. To make Konqueror default, use the KDE Menu | System Settings | Default Applications | File Associations and pick inode from the list in the window. For Directory and System Directory, move Konqueror up the list to make it the preferred application for opening such things.

Install and use Sun Java

Use the instructions from the Web Upd8 team, as recommended on the Ubuntu community documentation site.

root@server:~# add-apt-repository ppa:webupd8team/java
root@server:~# aptitude update
root@server:~# aptitude install oracle-java7-installer

Add KMenu actions

I like having the Quick Browser, Recent Documents, Settings, and Terminal Sessions actions on the KMenu. Enable them by editing ~/.kde/share/config/kickerrc to include

[menus]
Extensions=recentdocs.desktop,prefmenu.desktop,konsolemenu.desktop,find.desktop
NumVisibleEntries=6
RecentAppsStat=2 1227736562 ... and so on
UseBrowser=true

Other menu extensions can be found in /usr/share/apps/kicker/menuext/

Install Virtualbox

Install the packages:

root@desktop:~# aptitude install virtualbox virtualbox-guest-additions-iso
  • Note to self: Make sure the virtual machines get installed somewhere on /opt

Enable the Compose key

The KDE Keyboard settings allow you to define the Compose key directly.

For Ubuntu Unity (and perhaps Gnome), use dconf to set the compose key. First, find any bespoke keyboard settings:

user@desktop:~$ dconf read /org/gnome/desktop/input-sources/xkb-options 
@as []

This says there are no settings currently. You can set the right Alt key (Alt GR) to be the compose key with:

user@desktop:~$ dconf write /org/gnome/desktop/input-sources/xkb-options ['compose:ralt']

If there's are existing settings there, it looks like you need to include them in any dconf write, appending the new setting in the square brackets with settings separated by commas:

user@desktop:~$ dconf write /org/gnome/desktop/input-sources/xkb-options ['other:option','compose:ralt']

Try these first and only muck around with .Xmodmap if that doesn't work for some reason.

Change IBus default shortcut

The default shortcut for IBus (to change the input method for different languages) is Ctrl-Space. This interfers with a number of applications, such as Emacs.

To change the shortcut, either run ibus-setup as the relevant user, or click on the IBus icon in the system bar (a keyboard with a small globe on it). Change the default Ibus "next input method" shortcut to something obscure, such as Ctrl+Shift+Alt+Space.

Disable IBus

IBus's interception of keyboard signals interferes with some applications, notably Sublime Text. To disable IBus completely, run im-config as the user, click through the warnings about changing the input method, and select none (do not set any IM from imconfig) from the list, then press OK. You'll need to restart your KDE/X session for the changes to take effect.

Enable XIM

Enable the X Input Method for KDE and Gnome, rather than whatever they use as a default. This allows you to define additional Compose key codes.

Add these lines to ~/.profile:

export GTK_IM_MODULE="xim"
export QT_IM_MODULE="xim"

then restart X.

Overkill method using .Xmodmap

First, find the keycodes for the keys you want to modify. Run xev, press the required keys, and note the key codes. I use Alt Gr as the Compose key, but don't have a spare key for Mode_switch.

Edit ~/.Xmodmap to have the lines

keycode 113 = Mode_switch
keycode 116 = Multi_key

Insert the keycodes you have to suit.

(If you don't have a ~/.Xmodmap file, create it with

user@desktop:~$ xmodmap -pke > ~/.Xmodmap

)

Then run

user@desktop:~$ xmodmap ~/.Xmodmap

and the right Alt key (Alt Gr) should work and allow you access to funky additional characters. It allows you to combine multiple keystrokes for additional characters. Here is a list of Compose character codes.

Additional Compose sequences

Now you can create the file ~/.XCompose to include additional compose key sequences (a sample is below).

Basic Greek letters in .XCompose from Shobute; all the compose sequences you could think of at Kragen's xcompose repo.

(Note that I've gone against tradition and use g g as the prefix for Greek, rather than *: that's because the asterisk is used for some over-rings on letters.)

include "%L" 

# EMOTICONS
<Multi_key> <o> <underscore> <o>               : "ಠ_ಠ" # LOOK OF DISAPPROVAL
<Multi_key> <colon> <D>                        : "😃"   # :D
<Multi_key> <semicolon> <parenright>           : "😉"   # ;)
<Multi_key> <colon> <p>                        : "😛"   # :p
<Multi_key> <semicolon> <p>                    : "😜"   # ;p
<Multi_key> <colon> <bar>                      : "😐"   # :| 
<Multi_key> <colon> <apostrophe> <parenright>  : "😢"   # :'(  
 
# PUNCTUATION
<Multi_key> <bracketright> <apostrophe> : "’"   U2019    # RIGHT SINGLE QUOTATION MARK
<Multi_key> <bracketleft> <apostrophe>  : "‘"   U2018    # LEFT SINGLE QUOTATION MARK
<Multi_key> <bracketright> <quotedbl>   : "”"   U201d    # RIGHT DOUBLE QUOTATION MARK
<Multi_key> <bracketleft> <quotedbl>    : "“"   U201c    # LEFT DOUBLE QUOTATION MARK
<Multi_key> <space> <t>                 : " "   U2009    # THIN SPACE
<Multi_key> <space> <m>                 : " "   U2003    # EM SPACE 
 
# Custom additions: Typography
# <Multi_key> <period> <period>		: "…"	U2026		# HORIZONTAL ELLIPSIS
<Multi_key> <backslash> <space>		: "␣"	U2423		# OPEN BOX 
 
# GREEK
<Multi_key> <g> <g> <A>    : "Α"   U0391    # GREEK CAPITAL LETTER ALPHA
<Multi_key> <g> <g> <a>    : "α"   U03B1    # GREEK SMALL LETTER ALPHA
<Multi_key> <g> <g> <B>    : "Β"   U0392    # GREEK CAPITAL LETTER BETA
<Multi_key> <g> <g> <b>    : "β"   U03B2    # GREEK SMALL LETTER BETA
<Multi_key> <g> <g> <D>    : "Δ"   U0394    # GREEK CAPITAL LETTER DELTA
<Multi_key> <g> <g> <d>    : "δ"   U03B4    # GREEK SMALL LETTER DELTA
<Multi_key> <g> <g> <E>    : "Ε"   U0395    # GREEK CAPITAL LETTER EPSILON
<Multi_key> <g> <g> <e>    : "ε"   U03B5    # GREEK SMALL LETTER EPSILON
<Multi_key> <g> <g> <F>    : "Φ"   U03A6    # GREEK CAPITAL LETTER PHI
<Multi_key> <g> <g> <f>    : "φ"   U03C6    # GREEK SMALL LETTER PHI
<Multi_key> <g> <g> <G>    : "Γ"   U0393    # GREEK CAPITAL LETTER GAMMA
<Multi_key> <g> <g> <g>    : "γ"   U03B3    # GREEK SMALL LETTER GAMMA
<Multi_key> <g> <g> <H>    : "Η"   U0397    # GREEK CAPITAL LETTER ETA
<Multi_key> <g> <g> <h>    : "η"   U03B7    # GREEK SMALL LETTER ETA
<Multi_key> <g> <g> <I>    : "Ι"   U0399    # GREEK CAPITAL LETTER IOTA
<Multi_key> <g> <g> <i>    : "ι"   U03B9    # GREEK SMALL LETTER IOTA
<Multi_key> <g> <g> <J>    : "Θ"   U0398    # GREEK CAPITAL LETTER THETA
<Multi_key> <g> <g> <j>    : "θ"   U03B8    # GREEK SMALL LETTER THETA
<Multi_key> <g> <g> <K>    : "Κ"   U039A    # GREEK CAPITAL LETTER KAPPA
<Multi_key> <g> <g> <k>    : "κ"   U03BA    # GREEK SMALL LETTER KAPPA
<Multi_key> <g> <g> <L>    : "Λ"   U039B    # GREEK CAPITAL LETTER LAMDA
<Multi_key> <g> <g> <l>    : "λ"   U03BB    # GREEK SMALL LETTER LAMDA
<Multi_key> <g> <g> <M>    : "Μ"   U039C    # GREEK CAPITAL LETTER MU
<Multi_key> <g> <g> <m>    : "μ"   U03BC    # GREEK SMALL LETTER MU
<Multi_key> <g> <g> <N>    : "Ν"   U039D    # GREEK CAPITAL LETTER NU
<Multi_key> <g> <g> <n>    : "ν"   U03BD    # GREEK SMALL LETTER NU
<Multi_key> <g> <g> <O>    : "Ο"   U039F    # GREEK CAPITAL LETTER OMICRON
<Multi_key> <g> <g> <o>    : "ο"   U03BF    # GREEK SMALL LETTER OMICRON
<Multi_key> <g> <g> <P>    : "Π"   U03A0    # GREEK CAPITAL LETTER PI
<Multi_key> <g> <g> <p>    : "π"   U03C0    # GREEK SMALL LETTER PI
<Multi_key> <g> <g> <Q>    : "Χ"   U03A7    # GREEK CAPITAL LETTER CHI
<Multi_key> <g> <g> <q>    : "χ"   U03C7    # GREEK SMALL LETTER CHI
<Multi_key> <g> <g> <R>    : "Ρ"   U03A1    # GREEK CAPITAL LETTER RHO
<Multi_key> <g> <g> <r>    : "ρ"   U03C1    # GREEK SMALL LETTER RHO
<Multi_key> <g> <g> <S>    : "Σ"   U03A3    # GREEK CAPITAL LETTER SIGMA
<Multi_key> <g> <g> <s>    : "σ"   U03C3    # GREEK SMALL LETTER SIGMA
<Multi_key> <g> <g> <T>    : "Τ"   U03A4    # GREEK CAPITAL LETTER TAU
<Multi_key> <g> <g> <t>    : "τ"   U03C4    # GREEK SMALL LETTER TAU
<Multi_key> <g> <g> <U>    : "Υ"   U03A5    # GREEK CAPITAL LETTER UPSILON
<Multi_key> <g> <g> <u>    : "υ"   U03C5    # GREEK SMALL LETTER UPSILON
<Multi_key> <g> <g> <W>    : "Ω"   U03A9    # GREEK CAPITAL LETTER OMEGA
<Multi_key> <g> <g> <w>    : "ω"   U03C9    # GREEK SMALL LETTER OMEGA
<Multi_key> <g> <g> <X>    : "Ξ"   U039E    # GREEK CAPITAL LETTER XI
<Multi_key> <g> <g> <x>    : "ξ"   U03BE    # GREEK SMALL LETTER XI
<Multi_key> <g> <g> <Y>    : "Ψ"   U03A8    # GREEK CAPITAL LETTER PSI
<Multi_key> <g> <g> <y>    : "ψ"   U03C8    # GREEK SMALL LETTER PSI
<Multi_key> <g> <g> <Z>    : "Ζ"   U0396    # GREEK CAPITAL LETTER ZETA
<Multi_key> <g> <g> <z>    : "ζ"   U03B6    # GREEK SMALL LETTER ZETA 

# Some archaic Greek.  
# "period" will indicate a sort of variant of some kind; g g is still the "greek" marker
<Multi_key> <g> <g> <period> <p>	: "ϖ"	U03D6		# GREEK PI SYMBOL
# Reserving .f in case we want PHI SYMBOL.  Digamma was "w" sound anyway.
<Multi_key> <g> <g> <period> <w>	: "ϝ"	U03DD		# GREEK SMALL LETTER DIGAMMA
<Multi_key> <g> <g> <period> <W>	: "Ϝ"	U03DC		# GREEK CAPITAL LETTER DIGAMMA
<Multi_key> <g> <g> <Q>	: "Ϟ"	U03DE	# GREEK LETTER QOPPA
<Multi_key> <g> <g> <q>	: "ϟ"	U03DF	# GREEK SMALL LETTER QOPPA
<Multi_key> <g> <g> <period> <Q>	: "Ϙ"	U03D8	# GREEK LETTER ARCHAIC QOPPA
<Multi_key> <g> <g> <period> <q>	: "ϙ"	U03D9	# GREEK SMALL LETTER ARCHAIC QOPPA
<Multi_key> <g> <g> <ampersand>	: "ϗ"	U03D7	# GREEK KAI SYMBOL
<Multi_key> <g> <g> <period> <Z>	: "Ϡ"	U03E0	# GREEK LETTER SAMPI
<Multi_key> <g> <g> <period> <z>	: "ϡ"	U03E1	# GREEK SMALL LETTER SAMPI
<Multi_key> <g> <g> <period> <period> <Z> : "Ͳ"  U0372  # GREEK CAPITAL LETTER ARCHAIC SAMPI
<Multi_key> <g> <g> <period> <period> <z> : "ͳ"  U0373  # GREEK SMALL LETTER ARCHAIC SAMPI
<Multi_key> <g> <g> <period> <S>    : "Ϛ"	U03DA	# GREEK LETTER STIGMA
<Multi_key> <g> <g> <period> <s>    : "ϛ"	U03DB	# GREEK SMALL LETTER STIGMA
<Multi_key> <g> <g> <apostrophe>    : "ʹ"	U02B9	# MODIFIER LETTER PRIME, canonically equivalent to U0374 GREEK NUMERAL SIGN
 
# While we're at it...
<Multi_key> <g> <g> <period> <apostrophe>	: "′"	U2032	# PRIME
<Multi_key> <g> <g> <period> <quotedbl>      : "″"	U2033	# DOUBLE PRIME
<Multi_key> <g> <g> <comma>	       : "͵"	U0375	# GREEK LOWER NUMERAL SIGN (for thousands)
<Multi_key> <g> <g> <period> <b>    : "ϐ"	U03D0	# GREEK BETA SYMBOL
<Multi_key> <g> <g> <period> <j>    : "ϑ"	U03D1	# GREEK THETA SYMBOL
<Multi_key> <g> <g> <period> <Y>    : "ϒ"	U03D2	# GREEK UPSILON WITH HOOK SYMBOL
<Multi_key> <g> <g> <period> <f>    : "ϕ"	U03D5	# GREEK PHI SYMBOL
<Multi_key> <g> <g> <period> <k>    : "ϰ"	U03F0	# GREEK KAPPA SYMBOL
<Multi_key> <g> <g> <period> <r>    : "ϱ"	U03F1	# GREEK RHO SYMBOL
<Multi_key> <g> <g> <period> <U>    : "ϴ"	U03F4	# GREEK CAPITAL THETA SYMBOL
<Multi_key> <g> <g> <period> <e>    : "ϵ"	U03F5	# GREEK LUNATE EPSILON SYMBOL
 
<Multi_key> <g> <g> <period> <question>	 : "ϻ"	  U03FB	      # GREEK SMALL LETTER SAN
<Multi_key> <g> <g> <period> <slash>	 : "Ϻ"	  U03FA	      # GREEK CAPITAL LETTER SAN

Install and configure Sublime Text

root@desktop:~# dpkg -i sublime-text_build-3059_amd64.deb
  • When using KDE, update ~/.local/share/applications/mimeapps.list to include the line:
inode/directory=kde4-dolphin.desktop;
(This prevents Sublime Text from starting Nautilus when browsing files, and bringing most of Gnome with it.)
(Package suggestions from Daniel Bader.)
  • Enable the theme and colour scheme by opening the user preferences Preferences | Settings - User and adding these lines to Packages/User/Preferences.sublime-settings:
{
    "color_scheme": "Packages/Tomorrow Color Schemes/Tomorrow-Night-Eighties.tmTheme",
    "font_face": "Source Code Pro",
    "font_size": 10,
    "ignored_packages":
    [
        "Markdown",
        "Vintage"
    ],
    "soda_classic_tabs": true,
    "theme": "Soda Dark 3.sublime-theme"
}
This also changes the default font. (Leave unchanged any other lines in that file.)
  • Open a Markdown file, select Preferences | Settings - More | Syntax specific - User, and add these lines to Packages/User/Markdown.sublime-settings
{
    "color_scheme": "Packages/MarkdownEditing/MarkdownEditor-Dark.tmTheme"
}
To make the Python linter use Python 3 by default, insert the "@python": 3 line into Preferences | Package Settings | SublimeLinter | Settings - User (Packages/User/SublimeLinter.sublime-settings):
{
    "user": {
        "linters": {
            "pylint": {
            	"@python": 3 // Insert this line
            }
        }
    }
}
  • Open a Python file, select Preferences | Settings - More | Syntax specific - User, and add these lines to Packages/User/Python.sublime-settings
{
    "rulers": [80]
}

Enable KSysGuard on the server

KSysGuard is a nice graphic system performance monitor.

  • On the server, install ksysguardd, a lightweight monitor server that doesn't require all of KDE.
root@server:~# aptitude install ksysguardd
  • Create a user for ksysguard to run under:
root@server:~# groupadd ksysguard
root@server:~# useradd -s /usr/bin/ksysguardd -g ksysguard ksysguard
root@server:~# mkdir -p /home/ksysguard/.ssh
root@server:~# chown -R ksysguard:ksysguard /home/ksysguard
(the useradd line means that the ksysguard user will run the ksysguardd monitor as a login shell rather than Bash.
  • Copy across the user's ssh public key to allow passwordless logins
user@desktop:~# scp ~/.ssh/id_rsa.pub user@desktop:ksysguard_key

root@server:~# mv /home/user/ksysguard_key /home/ksysguard/.ssh/authorized_keys
root@server:~# chown ksysguard:ksysguard /home/ksysguard/.ssh/authorized_keys
  • Add ksysguard to the list of users that can connect via ssh. Add ksysguard to the end of the AllowUsers line in /etc/ssh/sshd_config.
  • Test it works by logging into the ksysguard user
user@desktop:~$ ssh ksysguard@ogedei
ksysguardd 4
(c) 1999, 2000, 2001, 2002 Chris Schlaeger <cs@kde.org>
(c) 2001 Tobias Koenig <tokoe@kde.org>
(c) 2006-2008 Greg Martyn <greg.martyn@gmail.com>
This program is part of the KDE Project and licensed under
the GNU GPL version 2. See http://www.kde.org for details.
ksysguardd> 
the commands monitors and quit should be helpful.
  • In the ksysguard graphical client, select File | Monitor Remote Machine and give the details of the server. You should now be able to add monitors for the server.

Instructions taken from NRS Central.

Enable Calibre server

Calibre is an ebook management system. It also supports the OPDS protocol for sharing ebooks across a network.

Get it working

  • Open the firewall to port 8080 on the local network
root@desktop:~# ufw allow from 192.168.1.0/24 to any port 8080
  • Start the server:
user@desktop:~$ calibre-server --with-library ~/Documents/calibre-library/
  • Test that you can see the library with a browser pointed to localhost:8080 and that OPDS-aware apps (such as FBReader on Android) can see the library.
  • Kill that server instance

Create systemd job

Create the file /lib/systemd/system/calibre-server.service (from version 3.0 onwards)

[Unit]
Description=Calibre ebook content service

[Service]
ExecStart=/usr/bin/calibre-server --port 8080 /home/user/path/to/calibre-library 

[Install]
WantedBy=multi-user.target

(The more correct way to do this is to create the file /etc/sysconfig/calibre-server that contains the environment variables (such as path to the library and port to serve the library on, and include that environment with EnvironmentFile=etc/sysconfig/calibre-server . But it's hardly worth it in this case.)

Reload the Systemd configuration and start the server:

root@desktop:~# systemctl enable calibre-server.service
root@desktop:~# systemctl daemon-reload
root@desktop:~# systemctl restart calibre-server.service
root@desktop:~# systemctl status calibre-server
  • Check again that the Calibre server is running.

Change tooltip colours

I use KDE as an environemnt, with a "dark text on light background" theme. The default Ubuntu theme has tooltips of "light text on dark background." Some non-KDE apps pick up the "light text" part of tooltips, but use the "light background" setting from KDE. This makes tooltips in several apps (GIMP and Inkscape, among others) unusable.

Fix this by editing ~/.gtkrc-2.0 to include, at the end:

style "gnome-color-chooser-tooltips"
{
    bg[NORMAL] = "#FFFFAF"
    fg[NORMAL] = "#000000"
}
widget "gtk-tooltip*" style "gnome-color-chooser-tooltips"

Edit /usr/share/themes/Ambiance/gtkrc-3.0/gtk.css so that the tooltip colours are:

tooltip_bg_color #FFFFAF;
tooltip_fg_color #000000;

Edit /usr/share/themes/Ambiance/gtkrc-3.0/settings.ini so that the gtk-color-scheme colours are:

tooltip_bg_color:#FFFFAF
tooltip_fg_color:#000000
(you may have to dig through that setting

(Instructions from I Will Folo.)

Media server

Install MiniDLNA for uPNP/DLNA serving of media across the network. (Instructions to follow.)