Install LTSP

#!/bin/bash

# todo
# command to configure language
# command to configure timezone

apt-get update
apt-get -y dist-upgrade

# OPTIONAL: configure germany locale
# http://www.thomas-krenn.com/de/wiki/Locales_unter_Ubuntu_konfigurieren
#sudo sed -i 's|en_US.UTF-8|de_DE.UTF-8|g' /etc/environment
#sudo sed -i 's|en_US|de_DE|g' /etc/default/locale
sudo locale-gen de_DE.UTF-8
update-locale LANG=de_DE.UTF-8
update-locale LANGUAGE=de_DE
sudo sed -i 's|XKBLAYOUT="us"|XKBLAYOUT="de"|g' /etc/default/keyboard

reboot

# install ubuntu-desktop
sudo apt-get -y install ubuntu-desktop

# configure paper size to DIN A4
#echo "a4" > /etc/papersize

# configure timezone
#dpkg-reconfigure tzdata

# OPTINAL: install german language support for gnome
sudo apt-get install -y language-pack-de-base
sudo apt-get install -y language-pack-gnome-de
sudo apt-get install -y hunspell-de-de hunspell-en-us

# install restricted extras
# http://www.panticz.de/Install-Ubuntu-restricted-extras
wget https://raw.githubusercontent.com/panticz/installit/master/install.ubuntu-restricted-extras.sh -O - | bash -

# intall ltsp server
sudo apt-get -y install ltsp-server

# install Gnome classic on Ubuntu Oneiric
RELEASE=$(lsb_release -rs | tr -d ".")
if [ ${RELEASE} -ge 1110 ]; then
wget https://raw.githubusercontent.com/panticz/installit/master/install.gnome-fallback.sh -O - | bash -
fi

# configure local devices
http://www.panticz.de/LTSP-configure-local-devices

# fix cups
### sed -i 's|Listen /var/run/cups/cups.sock|#Listen /var/run/cups/cups.sock|g' /etc/cups/cupsd.conf

# tune up: disable directory content listing
sudo gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults/ -t string -s /apps/nautilus/preferences/show_directory_item_counts never

# does this work?
sudo gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults/ -t string -s /apps/metacity/general/mouse_button_modifier ""

# disable screen saver lock
gsettings set org.gnome.desktop.screensaver lock-enabled false
gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults/ -t boolean -s /apps/gnome-screensaver/idle_activation_enabled false
gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults/ -t boolean -s /apps/gnome-power-manager/lock_on_blank_screen false
gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults/ -t boolean -s /apps/gnome-power-manager/lock_use_screensaver_settings false
#gsettings set org.gnome.desktop.lockdown disable-lock-screen 'true'
#gsettings set org.gnome.power-manager lock-use-screensaver 'false'
sudo apt-get remove -y gnome-screensaver

# disable services
sudo update-rc.d -f avahi-daemon remove
sudo update-rc.d -f bluetooth remove
#sed -i "s|BLUETOOTH_ENABLED=1|BLUETOOTH_ENABLED=0|g" /etc/default/bluetooth

#sudo update-rc.d -f nbd-server remove
#sudo update-rc.d -f gdm remove
#sudo update-rc.d -f pulseaudio remove

# increate MaxClients in CUPS
sed -i '12i\MaxClients 8192' /etc/cups/cupsd.conf

# fix file descriptor limit in CUPS / Upstream
sed -i '13i\limit nofile 8192 8192' /etc/init/cups.conf

# test
mv /etc/init.d/network-manager /root/
mv /etc/init/modemmanager.conf /root
mv /etc/init/network-manager.conf /root/

sudo update-rc.d -f ntpdate remove # ??
sudo update-rc.d -f winbind remove
sudo update-rc.d -f avahi-daemon remove

mkdir /etc/xdg/autostart/disabled
mv /etc/xdg/autostart/nm-applet.desktop /etc/xdg/autostart/disabled
mv /etc/xdg/autostart/orca-autostart.desktop /etc/xdg/autostart/disabled
mv /etc/xdg/autostart/vino-server.desktop /etc/xdg/autostart/disabled
mv /etc/xdg/autostart/bluetooth-applet.desktop /etc/xdg/autostart/disabled
mv /etc/xdg/autostart/bluetooth-applet-unity.desktop /etc/xdg/autostart/disabled
mv /etc/xdg/autostart/jockey-gtk.desktop /etc/xdg/autostart/disabled
mv /etc/xdg/autostart/deja-dup-monitor.desktop /etc/xdg/autostart/disabled
mv /etc/xdg/autostart/onboard-autostart.desktop /etc/xdg/autostart/disabled
mv /etc/xdg/autostart/user-dirs-update-gtk.desktop /etc/xdg/autostart/disabled
mv /etc/xdg/autostart/ubuntuone-launch.desktop /etc/xdg/autostart/disabled
mv /etc/xdg/autostart/update-notifier.desktop /etc/xdg/autostart/disabled
mv /etc/xdg/autostart/gnome-user-share.desktop /etc/xdg/autostart/disabled
mv /etc/xdg/autostart/telepathy-indicator.desktop /etc/xdg/autostart/disabled
mv /etc/xdg/autostart/gwibber.desktop /etc/xdg/autostart/disabled
mv /etc/xdg/autostart/gdu-notification-daemon.desktop /etc/xdg/autostart/disabled
mv /etc/xdg/autostart/notification-daemon.desktop /etc/xdg/autostart/disabled

# gnome-screensaver.desktop
# evolution-alarm-notify.desktop
# gnome-power-manager.desktop

mkdir /usr/share/gnome/autostart/disabled
mv /usr/share/gnome/autostart/gnome-screensaver.desktop /usr/share/gnome/autostart/disabled/
mv /usr/share/gnome/autostart/libcanberra-login-sound.desktop /usr/share/gnome/autostart/disabled/

# disable osd notifications
sudo mv /usr/share/dbus-1/services/org.freedesktop.Notifications.service /usr/share/dbus-1/services/org.freedesktop.Notifications.service.disabled

# test
#mv /etc/init/network-manager.conf /etc/init/network-manager.conf.disabled
#mv /etc/init/avahi-daemon.conf /etc/init/avahi-daemon.conf.disabled
#mv indicator-applet.desktop indicator-applet.desktop.disabled
#mv gnome-user-share.desktop disabled/
#mv gwibber.desktop disabled/

#
# install / remove applications
#
sudo apt-get install -y tofrodos
sudo apt-get install -y sshfs vlc libnotify-bin
sudo apt-get install -y rsync
sudo apt-get install -y pcmanfm
sudo apt-get install -y fontmatrix
sudo apt-get install -y gnote
sudo apt-get install -y pdftk
sudo apt-get install -y pdfshuffler
sudo apt-get install -y imagemagick

# OPTIONAL: install wine
http://www.panticz.de/install_wine

# install gimp
#apt-get install -y gimp

# install packages LibreOffice
http://www.panticz.de/ubuntu_install_openoffice

# fix LibreOffice quickstarter bug
http://www.panticz.de/Fix-OpenOffice-Quickstarter-logout-bug

# install fax client
http://www.panticz.de/install_yajhfc

# java
http://www.panticz.de/ubuntu_install_java_jre

# nautilus
http://www.panticz.de/Compile-Nautilus

# firefox
http://www.panticz.de/ubuntu_install_firefox
apt-get remove -y firefox-globalmenu

# thunderbird
http://www.panticz.de/install_thunderbird
apt-get remove -y thunderbird-globalmenu lightning-extension xul-ext-calendar-timezones xul-ext-gdata-provider xul-ext-lightning

# remove gnome games
sudo apt-get remove -y gnome-games-common
sudo apt-get remove -y gbrainy
sudo apt-get remove -y aisleriot

# remove unnecessarily applications
sudo apt-get remove -y openjdk-6-jre openjdk-6-jre-headless icedtea-6-plugin icedtea-plugin
sudo apt-get remove -y sun-java6-plugin
sudo apt-get remove -y gnome-orca onboard
sudo apt-get remove -y brasero
sudo apt-get remove -y transmission-gtk transmission-common

# clean up
sudo apt-get -y autoremove
sudo apt-get clean

#
# OPTIONAL
#
# German language
sudo apt-get install -y language-pack-de
sudo apt-get install -y language-pack-gnome-de

# OPTIONAL: install nfs client

# OPTIONAL: create gnome menu
# http://www.panticz.de/Create-Gnome-menu-entry

# OPTIONAL: install printer
http://www.panticz.de/Ubuntu_Epson_B-500DN

# Build LTSP thin client
http://www.panticz.de/Build-LTSP-thin-client

reboot

# Links
https://help.ubuntu.com/community/UbuntuLTSP/AMDE-350
https://help.ubuntu.com/community/UbuntuLTSP/GetMoreFromLocalApps

# test
[Default]
LDM_DIRECTX = True
XRANDR_DISABLE = True
X_RAMPERC = 80
X_MODE_0 = 1280x1024
LOCAL_APPS = True
LOCAL_APPS_MENU = True
LOCAL_APPS_MENU_ITEMS = firefox
SEARCH_DOMAIN = 192.168.0.1 || Change this for your own network
DNS_SERVER = 92.168.0.1 || Change this for your own network
RCFILE_01 = /etc/init.d/chmod-resolv.sh

# OLD
# ltsp-server-standalone
# apt-get -y install language-pack-gnome-en-base language-pack-en language-pack-gnome-en
# apt-get -y install language-pack-gnome-de-base language-pack-de language-pack-gnome-de