linux

warning: Creating default object from empty value in /data/web/1/000/027/003/273448/htdocs/panticz.de/modules/taxonomy/taxonomy.pages.inc on line 33.

How Linux is Built

smartmontools (smartctl)

wget -q --no-check-certificate https://raw.githubusercontent.com/panticz/installit/master/install.smartmontools.sh -O - | bash -

#!/bin/bash

# ensure that this script is run by root
if [ $(id -u) -ne 0 ]; then
sudo $0
  exit
fi

apt-get install -y smartmontools --no-install-recommends

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

Check / Update DDNS

wget http://dl.panticz.de/endian/checkddns -O /etc/cron.d/checkddns

0 * * * *     /sbin/checkddns.sh YOUR_HOSTNAME.dyndns.org
1

wget http://dl.panticz.de/endian/checkddns.sh -O /sbin/checkddns.sh

#!/bin/bash

if [ ! -z $1 ]; then
	URL=$1
else
	echo "Hostname missing"
	echo "Usage: $0 YOUR_HOSTNAME.dyndns.org"
	exit 1
fi

IP_DNS=$(ping -c 1 YOUR_HOSTNAME.dyndns.org | head -1 | cut -d"(" -f2 | cut -d")" -f1)
IP_LOCAL=$(ifconfig | grep inet | tail -2 | head -1 | cut -d":" -f2 | cut -d" " -f1)

ping -c 1 ${URL} > /dev/null
if [ $? -gt 0 -o "${IP_DNS}" != "${IP_LOCAL}" ]; then
	echo "Update Dynamic DNS..." 
	/usr/local/bin/setddns.pl
fi
1

chmod u+x /sbin/checkddns.sh
/etc/init.d/fcron restart

Toshiba Tegra AC100

# https://github.com/nthchild/ubuntu-ac100

HowTo
https://wiki.ubuntu.com/ARM/TEGRA/AC100

install nvflash (broken, download and install manually)
http://developer.download.nvidia.com/assets/mobile/files/tegra-linux-12.alpha.1.0.tar.gz
wget https://phablet-paz00.googlecode.com/files/nvflash_20110628-2_all.deb -O /tmp/nvflash_20110628-2_all.deb
sudo dpkg -i /tmp/nvflash_20110628-2_all.deb

get bootrom
# wget http://cdimage.ubuntu.com/lubuntu/releases/quantal/release/lubuntu-12.10-preinstalled-desktop-armhf+ac100.bootimg -O /tmp/ac100.bootimg
# wget http://cdimage.ubuntu.com/releases/12.04/release/ubuntu-12.04-preinstalled-desktop-armhf+ac100.bootimg -O /tmp/ac100.bootimg
wget http://cdimage.ubuntu.com/lubuntu/daily-preinstalled/pending/trusty-preinstalled-desktop-armhf+ac100.bootimg -O /tmp/ac100.bootimg

flash bootrom
# Connect the USB cable between your AC100 and the host PC
# Press CTRL and ESC keys and power on your AC100
sudo nvflash --bl /usr/lib/nvflash/fastboot.bin --download 6 /tmp/ac100.bootimg
# poweroff
# poweron

download image
sudo mount /dev/sdb1 /mnt

# wget http://cdimage.ubuntu.com/lubuntu/releases/quantal/release/lubuntu-12.10-preinstalled-desktop-armhf+ac100.tar.gz -P /mnt/
# wget http://cdimage.ubuntu.com/releases/12.04/release/ubuntu-12.04-preinstalled-desktop-armhf+ac100.tar.gz -P /mnt/
wget http://cdimage.ubuntu.com/lubuntu/daily-preinstalled/pending/trusty-preinstalled-desktop-armhf+ac100.tar.gz -O /tmp/trusty-preinstalled-desktop-armhf+ac100.tar.gz

sudo umount /mnt

# OPTIONAL configuration
wget https://raw.githubusercontent.com/panticz/installit/master/hardware/ac100.postinstall.sh -O - | sudo bash -

#!/bin/bash

# update packages
sudo apt-get update
sudo apt-get -y dist-upgrade

# configure german keyboard
sudo sed -i 's|XKBLAYOUT="us"|XKBLAYOUT="de"|g' /etc/default/keyboard



# disable unnececery services 
sudo update-rc.d -f avahi-daemon remove
sudo update-rc.d -f bluetooth remove

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


# remove unnecessary apps
sudo apt-get remove -y gnome-screensaver
sudo apt-get remove -y gnome-orca onboard
sudo apt-get remove -y brasero
sudo apt-get remove -y zeitgeist
sudo apt-get remove -y rhythmbox
sudo apt-get remove -y unity
sudo apt-get remove -y totem

# install extra apps
sudo apt-get install -y language-pack-de language-pack-gnome-de
sudo apt-get install -y thunderbird-locale-de thunderbird-locale-en hunspell-de-de hunspell-en-us
sudo apt-get install -y openvpn network-manager-openvpn
sudo apt-get install -y language-pack-de-base
sudo apt-get install -y sshfs vlc 




#
# ubuntu 12.04 (gnome)
#
# configure repository
cat < /etc/apt/sources.list
deb http://ports.ubuntu.com/ubuntu-ports/ precise main restricted universe multiverse
deb http://ports.ubuntu.com/ubuntu-ports/ precise-security main restricted universe multiverse
deb http://ports.ubuntu.com/ubuntu-ports/ precise-updates main restricted universe multiverse
#deb http://ports.ubuntu.com/ubuntu-ports/ precise-proposed main restricted universe multiverse
EOF

# install gnome classic
wget http://installit.googlecode.com/hg/install.gnome-fallback.sh -O - | bash -

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 -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'

# configure nautilus (broken ?)
sudo gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults/ -t string -s /apps/nautilus/preferences/default_folder_viewer 'list_view'
sudo gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults/ -t string -s /apps/nautilus/list_view/default_zoom_level smallest
sudo gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults/ -t string -s /apps/nautilus/preferences/show_directory_item_counts never


#
# ubuntu 12.10 (lxdm)
#
# install nvidia driver
if [ $(lsb_release -rs | tr -d ".") -ge 1210 ]; then
    wget http://flie.no-ip.org:7080/ac100/deb/nvidia-tegra-ventana-codecs_16.0.0-0ubuntu1_armhf.deb
    wget https://launchpad.net/ubuntu/+source/nvidia-graphics-drivers-tegra/16.2.0-0ubuntu3/+build/3907865/+files/nvidia-tegra_16.2.0-0ubuntu3_armhf.deb
    sudo dpkg -i nvidia-tegra_16.2.0-0ubuntu3_armhf.deb nvidia-tegra-ventana-codecs_16.0.0-0ubuntu1_armhf.deb
fi

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

echo "*** ac100 postinstall done, reboot in 30 sec ***"
sleep 30

sudo reboot


# todo
# autologin
# remove screen lock
# nvidia tegra graphic
#dpkg -i Downloads/nvidia-tegra_12~beta1-0ubuntu1_armel.deb
1

Ubuntu images for AC100
http://cdimage.ubuntu.com/releases/11.10/release/
http://cdimage.ubuntu.com/releases/12.04/beta-2/
http://cdimage.ubuntu.com/daily-preinstalled/current/

Links
http://cdimage.ubuntu.com/lubuntu/daily-preinstalled/current/
http://ac100.grandou.net/hw_accelerated_video_playback - Ubuntu 12.10 / 12.04 Nvidia graphic driver for Toshiba AC100
http://wiki.informatik.hu-berlin.de/nomads/index.php/Erfahrungsbericht_Toshiba_AC100#Nvidia_Grafiktreiber_f.C3.BCr_Tegra_2
http://ac100.grandou.net/
http://ac100.grandou.net/nvflash#debian_ubuntu_package - NvFlash
http://ac100.grandou.net/ubuntu_deubuntuization
http://developer.nvidia.com/content/linux-tegra-release-12-alpha-1-released
http://ac100.grandou.net/apps

Accelated Video
wget http://launchpadlibrarian.net/118260107/linux-image-3.1.10-6-ac100_3.1.10-6.9_armhf.deb
wget http://flie.no-ip.org:7080/ac100/deb/nvidia-tegra_16.1.0-0ubuntu3~fly2_armhf.deb
sudo dpkg -i linux-image-3.1.10-6-ac100_3.1.10-6.9_armhf.deb nvidia-tegra_16.1.0-0ubuntu3~fly2_armhf.deb

http://ac100.grandou.net/hw_accelerated_video_playback
nvgstplayer -i "file://$1" --svs="nvxvimagesink" --sas="nv_omx_audiosink"

Java Linux ARM v6/v7 VFP
http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html

# axis
http://ports.ubuntu.com/pool/multiverse/a/axe/axe_6.1.2-16.2_armhf.deb
http://ports.ubuntu.com/ubuntu-ports/pool/universe/t/tk8.6/tk8.6-lib_8.6.0-1ubuntu1_armhf.deb

# kali
http://cdimage.kali.org/kali-latest/armhf/

# old
sudo echo "deb http://people.debian.org/~jak/ac100/ unreleased main non-free" > /etc/apt/sources.list.d/people.debian.org.jak.ac100.list
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys AC2A5FFE00823EC2
sudo apt-get update
sudo apt-get -y --force-yes install xserver-xorg-video-tegra

wget https://launchpad.net/~canonical-arm-dev/+archive/ppa/+build/2610299/+files/nvidia-tegra_12-0ubuntu1~alpha1monson6_armel.deb -O /tmp/nvidia-tegra_12-0ubuntu1~alpha1monson6_armel.deb
sudo dpkg -i /tmp/nvidia-tegra_12-0ubuntu1~alpha1monson6_armel.deb

Install Handbrake

wget https://raw.githubusercontent.com/panticz/installit/master/install.handbrake.sh -O - | bash -

#!/bin/bash

sudo apt-add-repository -y ppa:stebbins/handbrake-snapshots
sudo apt-get update -qq
sudo apt-get install -y handbrake-cli handbrake-gtk

Install Kodi

Install stable version
wget https://raw.githubusercontent.com/panticz/installit/master/install.xbmc.sh -O - | bash -

#!/bin/bash

sudo apt-get install -qq -y python-software-properties pkg-config

if [ "$1" == "-u" ]; then
    # add unstable repository
    sudo add-apt-repository -y ppa:team-xbmc/unstable
    
    RELEASE=$(lsb_release -rs | tr -d ".")
    if [ ${RELEASE} -gt 1110 ]; then
        # downgrade to oneiric (lastest available release)
        sudo sed -i "s|$(lsb_release -cs)|oneiric|g" /etc/apt/sources.list.d/team-xbmc-unstable-*.list
    fi
else
    # add stable repository
    sudo add-apt-repository -y ppa:team-xbmc/ppa

    RELEASE=$(lsb_release -rs | cut -d"." -f1)
    if [ ${RELEASE} -gt 10 ]; then
        # downgrade to maverick (lastest available release)
        sudo sed -i "s|$(lsb_release -cs)|maverick|g" /etc/apt/sources.list.d/team-xbmc-ppa-*.list
    fi
fi

# update
sudo apt-get update -qq

# install xbmc
sudo apt-get install -qq -y xbmc

# install required libraries
sudo apt-get install -qq -y libmad0 libmpeg2-4

install unstable version
wget http://installit.googlecode.com/hg/install.xbmc.sh -O /tmp/install.xbmc.sh
bash /tmp/install.xbmc.sh -u

Unofficial PVR repository
sudo add-apt-repository ppa:lars-opdenkamp/xbmc-pvr

XBMC standalone
sudo apt-get install -y xbmc xbmc-standalone

Configuring a Wii Remote
http://www.mini-itx.com/projects/xbmc-ion/module/6

Ubuntu: Install Nero Linux

Nero Download
http://www.nero.com/enu/downloads-linux4-trial.php

wget https://raw.githubusercontent.com/panticz/installit/master/install.nero.sh -O - | bash -

#!/bin/bash

if [ ! -z $1 ] {
  URL=$1
  FILE=${URL##*/}
} else {
  # get download URL
  if [ "$(uname -m)" == "x86_64" ]; then
    # 64 bit OS found
    OS="_64"
  fi
  URL=$(wget -q http://www.nero.com/deu/downloads/previous-versions/download-linux4-update.php -O - | egrep "^.*dlLink.*http.*x86${OS}.deb" | cut -d'"' -f2)

  # set file name
  FILE=nerolinux-x86${OS}.deb
}

# get file
if [ ${URL:0:4} == "http" ]; then
  wget ${URL} -O /tmp/${FILE}
else
  cp ${URL} /tmp/${FILE}
fi

# install file
sudo dpkg -i /tmp/${FILE}

# clean up
rm /tmp/${FILE}

Extract Nero DOS bootimage
mkdir /tmp/nero
dpkg -x /tmp/nerolinux-x86_64.deb /tmp/nero
ls -l /tmp/nero/usr/share/nero/DosBootImage.ima

Ubuntu: Install NVIDIA proprietary video drivers

wget https://raw.githubusercontent.com/panticz/installit/master/install.nvidia-graphic.sh -O - | bash -

#/bin/bash

# nvidia graphic driver
sudo apt-get install -y nvidia-current-updates

# configure driver
sudo nvidia-xconfig --no-logo --cool-bits=1

# TODO: options
#--registry-dwords="PowerMizerEnable=0x1; PerfLevelSrc=0x2222; PowerMizerLevel=0x3; PowerMizerDefault=0x3; PowerMizerDefaultAC=0x3"

Ubuntu Medion MD 95400 WLAN

wget https://raw.githubusercontent.com/panticz/installit/master/hardware/wlan.medion-md-95400.sh -O - | bash -

#!/bin/bash

# Links
# http://wiki.ubuntuusers.de/Acer_Hotkeys

# NEW

# download source
apt-get install -y acerhk-source linux-headers-generic

# extract
cd /usr/src
sudo tar -xjf acerhk.tar.bz2

# patch
sed -i '561s|KBUILD_CFLAGS|#KBUILD_CFLAGS|g' /usr/src/linux-headers-2.6.32-24-generic/Makefile

# compile and install
cd /usr/src/modules/acerhk
make install



echo "acerhk force_series=95400 autowlan=1" > /etc/modprobe.d/acerhk.conf

echo "options radeon modeset=1 dynpm=1 dynclks=1" > /etc/modprobe.d/radeon.conf

sudo update-initramfs -u



# OLD

# fix audio
echo "acerhk force_series=95400 autowlan=1" >> /etc/modules

# fix wlan
cat < /etc/init.d/wirelessled
#!/bin/sh -e
echo 1 > /proc/driver/acerhk/wirelessled
exit 0
EOF
 
chmod 755 /etc/init.d/wirelessled
 
update-rc.d wirelessled defaults 90
1

Install Skype from repository

wget https://raw.githubusercontent.com/panticz/installit/master/install.skype.sh -O - | bash -

#!/bin/bash

# add partner repository
sudo add-apt-repository -y "deb http://archive.canonical.com/ $(lsb_release -sc) partner"

# update
sudo apt-get update -qq

# install
sudo apt-get install -y skype

Fix upside down webcam
wget https://raw.githubusercontent.com/panticz/scripts/master/fix_skype_upsidedown_webcam.sh -O - | bash -

#!/bin/bash

# install video4linux libraries 
sudo apt-get install libv4l-0:i386

# fix lib path
if [ ! -f /usr/lib/libv4l/v4l1compat.so ]; then
  sudo mkdir /usr/lib/libv4l
    if [ "$(uname -m)" == "x86_64" ]; then
      # 64 bit
      sudo ln -s /usr/lib/x86_64-linux-gnu/libv4l/v4l1compat.so /usr/lib/libv4l/v4l1compat.so
    else
      # 32 bit
      sudo ln -s /usr/lib/i386-linux-gnu/libv4l/v4l1compat.so /usr/lib/libv4l/v4l1compat.so
  fi
fi

# modify Skype launcher
sudo sed -i 's|env PULSE_LATENCY_MSEC=60 skype %U|env PULSE_LATENCY_MSEC=60 LD_PRELOAD=/usr/lib/i386-linux-gnu/libv4l/v4l1compat.so skype %U|g' /usr/share/applications/skype.desktop

Disable "contacts comes online" notification
# Notify
sed -i 's|1|0|g' /home/${USER}/.Skype/*/config.xml
sed -i 's|1|0|g' /home/${USER}/.Skype/*/config.xml

# Sound
sed -i 's|1|0|g' /home/${USER}/.Skype/*/config.xml
sed -i 's|1|0|g' /home/${USER}/.Skype/*/config.xml

Links
http://wiki.ubuntuusers.de/Canonical_Partner - Ubuntu partner repository
http://www.semanticpool.de/hidden-skype-emoticons/ - hidden skype emoticons
https://help.ubuntu.com/community/SkypeTroubleshooting
https://wiki.ubuntu.com/SkypeWebCams

Syndicate content