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.

Tomcat configuration

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

#!/bin/bash

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

# install Java JDK
wget -q https://raw.githubusercontent.com/panticz/installit/master/install.java-jdk.sh -O - | bash -

# install tomcat
apt-get install -y tomcat8

# OPTIONAL: configure JAVA_HOME
echo "JAVA_HOME=/usr/lib/jvm/$(ls /usr/lib/jvm | grep oracle | tail -1)" >> /etc/default/tomcat?

# configure tomcat to linsten on port 80 instead of default 8080
sed -i 's|port="8080"|port="80"|g' /etc/tomcat?/server.xml

# bind to a privileged port
sed -i 's|#AUTHBIND=no|AUTHBIND=yes|g' /etc/default/tomcat?

# restart tomcat
service tomcat8 restart

# start
export JAVA_HOME=/usr/lib/jvm/jdk1.6.0
export JAVA_OPTS="$JAVA_OPTS -Xmx256m"
/usr/local/apache-tomcat-5.5.20/bin/startup.sh

# deploy
/opt/SDK2/bin/asadmin deploy /tmp/Intranet.war

# change default port from 8080 to 80

# log directory
/var/log/tomcat6

# redirect by default to a app
mv /var/lib/tomcat6/webapps/ROOT/index.html /var/lib/tomcat6/webapps/ROOT/index.old.html
cat < /var/lib/tomcat6/webapps/ROOT/index.html

EOF

# manager
http://YOUR_TOMCAT_IP/manager/html/

# apache module
mod_jk

# LINKS
http://wiki.ubuntuusers.de/Tomcat
http://linux-sxs.org/internet_serving/c581.html
http://shrubbery.mynetgear.net/c/display/W/Disable+Directory+Listing+in+Tomcat
http://wiki.ubuntuusers.de/Tomcat

# https://intranet.sedo.de.intern/confluence/pages/viewpage.action?title=Enable+SSL+in+Tomcat&spaceKey=SOA
# https://ssl-trust.com/ssl-zertifikat-installieren/tomcat
# http://www.torsten-horn.de/techdocs/ssl.htm

UnixBench

# install required packages for compile
apt-get install -y build-essential
# perl perl-modules make

# download
wget -q http://byte-unixbench.googlecode.com/files/UnixBench5.1.3.tgz -O /tmp/UnixBench.tar.gz
tar -C /tmp/ -xzf /tmp/UnixBench.tar.gz
cd /tmp/UnixBench

# patch > 16 core limitation, https://code.google.com/p/byte-unixbench/issues/detail?id=4
wget --no-check-certificate "https://byte-unixbench.googlecode.com/issues/attachment?aid=-1645413311807741160&name=fix-limitation.patch&token=ABZ6GAfTt_8YARok5-o9WLVQDWrlCoUdQw%3A1399886165120" -O /tmp/fix-limitation.patch

Boot iPXE from harddisc (Network booting from GRUB using iPXE)

wget -q https://raw.githubusercontent.com/panticz/preseed/master/ipxe/scripts/install_grub_ipxe.sh -O - | bash -

#!/bin/bash

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

# download GRUB iPXE boot image
wget -q http://dl.panticz.de/ipxe/ipxe.lkrn -O /boot/ipxe.lkrn

# create GRUB menu entry
wget -q https://raw.githubusercontent.com/panticz/preseed/master/ipxe/scripts/grub/49_ipxe -O /etc/grub.d/49_ipxe 
chmod a+x /etc/grub.d/49_ipxe

# update GRUB config
. /etc/os-release
case ${ID} in
  centos|fedora)
    grub2-mkconfig -o /boot/grub2/grub.cfg
  ;;
  debian|ubuntu)
    update-grub
  ;;
  *)
    echo "Distribution not supported. Please upgrade grub configuration manually"
esac

Links
http://packages.ubuntu.com/de/vivid/grub-ipxe
http://ipxe.org/embed

Create CentOS 6 DomU

wget https://raw.githubusercontent.com/panticz/xen/master/domains/centos.6.sh -O - | bash -

#!/bin/bash

#
# IP    : dhcp
# user  : root
# pass  : t00r
#

#
# TODO
# use separate partitions for root (/dev/vg0/centos6-disk) and swap (/dev/vg0/centos6-swap) instead of harddisk image
#

# create disk
lvcreate --name centos6-disk --size 8G vg0

# download installation kernel and initrd
[ -d /tmp/centos6 ] || mkdir /tmp/centos6
wget -q http://mirror.netcologne.de/centos/6/os/x86_64/images/pxeboot/initrd.img -O /tmp/centos6/initrd.img
wget -q http://mirror.netcologne.de/centos/6/os/x86_64/images/pxeboot/vmlinuz -O /tmp/centos6/vmlinuz

# create installation configuration
cat <<EOF> /tmp/centos6-inst
kernel      = '/tmp/centos6/vmlinuz'
ramdisk     = '/tmp/centos6/initrd.img'
memory      = '512'
disk        = [ 'phy:/dev/vg0/centos6-disk,xvda,w' ]
name        = 'centos6-inst'
dhcp        = 'dhcp'
vif         = [ 'mac=00:00:00:00:ce:ce' ]
on_poweroff = 'destroy'
on_reboot   = 'destroy'
on_crash    = 'destroy'
extra       = "text ip=dhcp ks=http://preseed.panticz.de/preseed/centos6-minimal.cfg"
EOF

# install
xm create -c /tmp/centos6-inst

# create CenOS 6 configuration
cat <<EOF> /etc/xen/centos6
bootloader  = "/usr/lib/xen-4.1/bin/pygrub"
memory      = '512'
disk        = [ 'phy:/dev/vg0/centos6-disk,xvda,w' ]
name        = 'centos6'
dhcp        = 'dhcp'
vif         = [ 'mac=00:00:00:00:ce:ce' ]
on_poweroff = 'destroy'
on_reboot   = 'restart'
on_crash    = 'restart'
EOF

# OPTIONAL: add to autostart
ln -s /etc/xen/centos6 /etc/xen/auto/centos6

# start CenOS 6
xm create -c centos6

Links
http://www.centos.org/docs/5/html/Installation_Guide-en-US/s1-kickstart2-startinginstall.html

Create Debian Wheezy DomU

wget https://raw.githubusercontent.com/panticz/xen/master/domains/debian.wheezy.sh -O - | bash -

#!/bin/bash

# configure domU
DOMAIN_NAME=wheezy
DOMAIN_MAC=00:10:01:01:aa:bb
DOMAIN_RAM=2Gb
DOMAIN_HDD=8Gb
 
# create domU on LVM (for image file use --dir=/root, --pygrub)
xen-create-image \
 --hostname=${DOMAIN_NAME} \
 --dist=wheezy \
 --lvm=vg0 \
 --size=${DOMAIN_HDD} \
 --fs=ext4 \
 --role=udev \
 --memory=${DOMAIN_RAM} \
 --swap=${DOMAIN_RAM} \
 --dhcp \
 --mac=${DOMAIN_MAC} \
 --genpass=0 \
 --password=t00r \
 --apt_proxy=http://apt-cacher:3142/ \
 --vcpus $(cat /proc/cpuinfo | grep processor | wc -l)
 
# rename vm config
mv /etc/xen/${DOMAIN_NAME}.cfg /etc/xen/${DOMAIN_NAME}
 
# OPTIONAL: add to autostart
ln -s /etc/xen/${DOMAIN_NAME} /etc/xen/auto
 
# start domU
xm create -c ${DOMAIN_NAME}

# disable pc speaker
echo 'blacklist snd-pcsp' >> /etc/modprobe.d/blacklist.conf

# check for updates
touch /etc/apt/apt.conf.d/10periodic
if [ $(cat /etc/apt/apt.conf.d/10periodic | grep -c Update-Package-Lists) -eq 0 ]; then
 echo 'APT::Periodic::Update-Package-Lists "1";' >> /etc/apt/apt.conf.d/10periodic
fi

# fix FQDN
sed -i "s|$(hostname) $(hostname)|$(hostname -A)$(hostname)|g" /etc/hosts
 
user: root
password: t00r

OPTIONAL: enable auto updates
http://www.panticz.de/debian-ubuntu-automatic-upgrades

Ubuntu / Debian: Install and configure lm-sensors

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

#!/bin/bash

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

# install lm-sensors
apt-get install -y lm-sensors

# install the latest version
if [ "$1" == "-n" ]; then
  wget http://mirrors.kernel.org/ubuntu/pool/universe/l/lm-sensors/lm-sensors_3.3.3-1ubuntu1_amd64.deb -P /tmp/
  dpkg -i /tmp/lm-sensors_*.deb
  rm /tmp/lm-sensors_*.deb
fi

# auto configure
yes | /usr/sbin/sensors-detect

Search for motherboard configuration
sudo dmidecode -t baseboard | grep "Product Name"
http://www.lm-sensors.org/wiki/Configurations/

Motherboard configurations
# MSI X58 Pro-E (MS-7522) / Fintek f71882fg
echo "f71882fg" >> /etc/modules
echo "#coretemp" >> /etc/modules
modprobe f71882fg
wget http://dl.panticz.de/lm-sensors/ms-7522.conf -O /etc/sensors.d/f71882fg.conf
sensors -s

# ASUS M2N32 WS Professional
cat /etc/sensors.d/asus_m2n.conf
wget http://dl.panticz.de/lm-sensors/m2n32_ws_professional.conf -O /etc/sensors.d/m2n32_ws_professional.conf

# SuperMicro PDSMi-LN4+
wget http://dl.panticz.de/lm-sensors/pdsmi-ln4.conf -O /etc/sensors.d/pdsmi-ln4.conf

View raw sensor data
sensors -u

# default config file
/etc/sensors3.conf

# view hardwired? fan alarm value
cat /sys/class/hwmon/hwmon8/device/fan1_alarm

OPTIONAL: check with icinga
/usr/lib/nagios/plugins/check_sensors

Links
http://www.lm-sensors.org/wiki/Configurations/MSI/X58-Pro-E
http://www.lm-sensors.org/wiki/FAQ/Chapter3#HowdoIsetnewlimits

Install Obnam

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

#!/bin/bash

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

# install the latest version 
if [ "$1" == "-n" ]; then
  # add repository
  echo "deb http://code.liw.fi/debian wheezy main" > /etc/apt/sources.list.d/obnam.list
  wget -q http://code.liw.fi/apt.asc -O - | apt-key add -
  apt-get update
fi

# install obnam
apt-get install -y obnam

# config
cat < /root/.obnam.conf
[config]
repository = sftp://root@itdev/backup/
root = /var/www
log = /var/log/obnam.log
EOF

# add ssh keys
ssh-keygen
ssh-copy-id root@itdev

# backup
obnam backup

# commands
obnam ls
obnam ls --generation=2
obnam diff 2 5

# mount
apt-get install python-fuse #fuse

obnam mount --to /mnt/

Links
http://www.heise.de/artikel-archiv/ct/2013/23/170_Gut-gesichert - Gut gesichert: Verschlüsselte Datensicherung unter Linux mit Obnam

Install pipelight (watch Watchever under Linux / Ubuntu)

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

#!/bin/bash

# add repository
sudo add-apt-repository -y ppa:pipelight/stable

# update repository
sudo apt-get update

# install pipelight
sudo apt-get install -y pipelight-multi

sudo pipelight-plugin --update
sudo pipelight-plugin --accept --enable silverlight
sudo pipelight-plugin --accept --enable flash
sudo pipelight-plugin --create-mozilla-plugins

Start Watchever
chromium-browser https://www.watchever.de/login

Links
https://wiki.ubuntuusers.de/Pipelight/
http://fds-team.de/cms/pipelight-installation.html

TestServer - fully automated test system

  • iPXE netboot
  • Provisioning
  • Inventory
  • Hardware test
  • Monitoring
  • Automated system installation
Syndicate content