IPv6

# grub: /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="ipv6.disable=1"
update-grub

# sysctl
sudo echo "#disable ipv6" >> /etc/sysctl.conf
sudo echo "net.ipv6.conf.all.disable_ipv6 = 1" >> /etc/sysctl.conf
sudo echo "net.ipv6.conf.default.disable_ipv6 = 1" >> /etc/sysctl.conf
sudo echo "net.ipv6.conf.lo.disable_ipv6 = 1" >> /etc/sysctl.conf

sudo sed -i 's|udp6|#udp6|g' /etc/netconfig
sudo sed -i 's|tcp6|#tcp6|g' /etc/netconfig

# Links
https://askubuntu.com/questions/309461/how-to-disable-ipv6-permanently/337736#337736

Fix file permissions

#!/bin/bash

for DIR in /media/bilder /media/lagerliste /media/projekte /media/texte; do
echo ${DIR}

echo "set owner..."
find ${DIR} \! -user nobody -exec chown nobody {} \;
find ${DIR} \! -group nogroup -exec chgrp nogroup {} \;
# chown nobody:nogroup ${DIR} -R

echo "set directory permissions..."
find ${DIR} \! -perm 777 -type d -exec chmod 777 {} \;
# find ${DIR} -type d -exec chmod 777 {} \;

echo "set file permissions..."
find ${DIR} \!

Downgrade Libreoffice to 3.3.4

# remove current LibreOffice
sudo apt-get remove -y libreoffice*

# change repository
sudo rm /etc/apt/sources.list.d/libreoffice-ppa-oneiric.list*

sudo mv /etc/apt/sources.list /etc/apt/sources.list.oneiric

cat << EOF | sudo tee /etc/apt/sources.list.d/natty.list
deb http://archive.ubuntu.com/ubuntu natty main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu natty main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu natty-updates main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu natty-updates main restricted u

Build LTSP thin client

# OPTIONAL: update debootstrap first
http://www.panticz.de/update_debootstrap

# build thin client image
# ltsp-build-client --arch=i386 --dist=trusty
# ltsp-build-client --dist=xenial --base /opt/ltsp/amd64-xenial
ltsp-build-client

# disable encryption
#cat <> /var/lib/tftpboot/ltsp/i386/lts.conf

cat <> /var/lib/tftpboot/ltsp/amd64/lts.conf
[default]
LDM_DIRECTX=True
LDM_SESSION="gnome-session --session=gnome-fallback"
EOF

# local apps (nvidia, virtualbox and firefox)
export LTSP_HANDLE_DAEMONS=false
ltsp-chroot -p -a amd64
LANG=en_US.UTF-8
apt-get updat

LTSP Nvidia thin client

# build client (copy of default amd64 image)
# backup amd64-nvidia
tar czf /opt/ltsp/amd64-nvidia.bkp.$(date -I).tar.gz /opt/ltsp/amd64-nvidia
cp /opt/ltsp/images/amd64-nvidia.img /opt/ltsp/images/amd64-nvidia.img.bkp.$(date -I)

# copy amd64 to amd64-nvidia
rm -r /opt/ltsp/amd64-nvidia/
cp -a /opt/ltsp/amd64/ /opt/ltsp/amd64-nvidia

# install nvidia driver
export LTSP_HANDLE_DAEMONS=false
ltsp-chroot -p -a amd64-nvidia
LANG=en_US.UTF-8
# apt-get update -y
# apt-get install -y linux-headers-generic
# apt-get install -y nvidia-173
# apt-get install -y nvidia-304

smartmontools (smartctl)

<?php
$URL="https://raw.githubusercontent.com/panticz/installit/master/install.smartmontools.sh";
echo "wget -q --no-check-certificate $URL -O - | bash -";
echo "

";
$c = curl_init();
curl_setopt($c, CURLOPT_URL, $URL);
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
echo htmlspecialchars(curl_exec($c));
curl_close($c);
echo "

";
?>

Enable SMART on device
sudo smartctl -s on /dev/sdb

Show device SMART Health status
sudo smartctl -H /dev/sda

Show device selftest log
smartctl -l selftest /dev/sdb

Get info from usb data
sudo smartctl -d sat -a /dev/sdb

Test
smartctl -t short /dev/sdb
smartctl -t offline /dev/sdb

Calculate total writen GB from a SSD
echo "Total GB written: $(echo "scale=3; $(sudo /usr/sbin/smartctl -A /dev/sda | grep "Total_LBAs_Written" | awk '{print $10}') * 512 / $((1024*1024*1024))" | bc)"

Links
http://sourceforge.net/apps/trac/smartmontools/wiki/Supported_USB-Devices