Docker

apt-get install -y docker.io

#docker.io run -i --rm ubuntu bash

docker.io run -i -t --name dc-ubuntu ubuntu bash
docker.io start -i dc-ubuntu

docker.io run --name dc-nginx -d -p 7890:80 nginx
http://localhost:7890/
docker.io logs dc-nginx

https://wiki.debian.org/Docker

Install GitLab

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

#!/bin/bash

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

# download url
URL=https://downloads-packages.s3.amazonaws.com/ubuntu-12.04/gitlab_6.9.2-omnibus-1_amd64.deb

# download gitlab omnibus package
wget -q ${URL} -O /tmp/gitlab_amd64.deb

# install
dpkg -i /tmp/gitlab_amd64.deb

# configure
gitlab-ctl reconfigure

Login
http://YOUR_SERVER_IP
user: root
pass: 5iveL!fe

Links
https://www.gitlab.com/downloads/
https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md#installation
https://www.gitlab.com/2014/02/14/gitlab-is-now-simple-to-install/

rsnapshot

apt-get install -y rsnapshot

mv /etc/rsnapshot.conf /etc/rsnapshot.conf.org

cat < /etc/rsnapshot.conf
config_version 1.2
snapshot_root /media/backup/
logfile /var/log/rsnapshot.log
verbose 2
loglevel 3

cmd_rsync /usr/bin/rsync
cmd_ssh /usr/bin/ssh

interval daily 7
interval weekly 1
interval monthly 1

exclude dev/*
exclude lost+found/*
exclude mnt/*
exclude proc/*
exclude run/*
exclude sys/*
exclude tmp/*

backup root@tomcat:/ tomcat/
backup root@srv:/ srv/ +rsync_long_args=--exclude=export/* --exclude=media/*/.Trash* --exclude=video/*
EOF

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 tomcat7

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

# install authbind
apt-get install -y authbind

# create /etc/authbind/byport/80
touch /etc/authbind/byport/80
chmod 500 /etc/authbind/byport/80
chown tomcat7:tomcat7 /etc/authbind/byport/80

# configure tomcat to port 80
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
/etc/init.d/tomcat7 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

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

Ubuntu: Install Nemo file manager

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

#!/bin/bash

sudo add-apt-repository -y ppa:webupd8team/nemo
sudo apt-get update
sudo apt-get install -y nemo

Links
http://www.webupd8.org/2013/10/install-nemo-with-unity-patches-and.html

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

wget 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/grub/ipxe.lkrn

# create GRUB menu entry
cat <<EOF> /etc/grub.d/49_ipxe 
#!/bin/sh
exec tail -n +3 \$0

menuentry "Network boot (iPXE)" {
  linux16 /boot/grub/ipxe.lkrn
}
EOF

# make executable
sudo chmod a+x /etc/grub.d/49_ipxe

# update GRUB config
update-grub

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

Install LXC (Linux Containers) under Ubuntu

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

#!/bin/bash

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

# install lxc
apt-get install -y lxc

# disable auto configuration for eth0
sed -i 's|auto eth0|#auto eth0|g' /etc/network/interfaces
sed -i 's|iface eth0 inet dhcp|#iface eth0 inet dhcp|g' /etc/network/interfaces

# create network bridge
cat <<EOF>> /etc/network/interfaces
auto lxcbr0
iface lxcbr0 inet dhcp
  bridge_ports eth0
EOF

# disable auto configuration for network bridge by lxc
sed -i 's|USE_LXC_BRIDGE="true"|USE_LXC_BRIDGE="false"|g' /etc/default/lxc-net

OPTIONAL: enable apt-cache
sed -i 's|#MIRROR="http://:3142/archive.ubuntu.com/ubuntu"|MIRROR="http://apt-cacher:3142/archive.ubuntu.com/ubuntu"|g' /etc/default/lxc
echo 'Acquire::http::Proxy "http://apt-cacher:3142/";' >> /etc/apt/apt.conf
apt-get update

OPTIONAL: create volume for lxc containers
lvcreate --name lxc-data --size 128G vg0
mkfs.ext4 /dev/vg0/lxc-data
echo "/dev/vg0/lxc-data /var/lib/lxc/ ext4 defaults 0 0" >> /etc/fstab

create vm
# install debian wheezy
lxc-create -n vm1 -t debian

# create debian squeeze
export MIRROR="http://apt-cacher:3142/ftp.debian.org/debian"
lxc-create -n squeeze1 -t debian -- template-options -r squeeze

# create lvm container
lxc-create -n wheezy -t debian -B lvm --vgname vg0

# create ubuntu precise 32 bit
export MIRROR="http://apt-cacher:3142/archive.ubuntu.com/ubuntu"
sudo lxc-create -t ubuntu -n lpdev4 -- -r precise -a i386

lxc-create -n vm3 -t ubuntu
# lxc-create -n foo -f lxc.conf

# OPTIONAL: enable apt-cache in VM
echo 'Acquire::http::Proxy "http://apt-cacher:3142/";' >> /var/lib/lxc/vm3/rootfs/etc/apt/apt.conf

configure autostart
echo "lxc.start.auto = 1" >> /var/lib/lxc/vm3/config

# vm config
/var/lib/lxc/vm1/config

# start vm
lxc-start -n vm1

# bypass apparmor (LTSP server test)
echo "lxc.aa_profile = unconfined" >> /var/lib/lxc/vm3/config

templates
/usr/share/lxc/templates/

# dep
# apt-get install -y bridge-utils debootstrap
# libvirt-bin

# configure fs
echo "cgroup /sys/fs/cgroup cgroup defaults 0 0" >> /etc/fstab
mount -a

Links
https://www.stgraber.org/2013/12/21/lxc-1-0-your-second-container/
http://askubuntu.com/questions/256304/public-ip-address-for-lxc-container/311003#311003
http://wiki.gentoo.org/wiki/LXC
http://www.linuxcertif.com/man/5/lxc.conf/
https://www.docker.io/
http://wiki.debian.org/LXC
http://blog.bodhizazen.net/linux/lxc-configure-ubuntu-lucid-containers/
http://blog.foaa.de/2010/05/lxc-on-debian-squeeze/
http://www.thomas-krenn.com/de/wiki/Perl_warning_Setting_locale_failed_unter_Debian
https://packages.debian.org/de/jessie/lxc - Debian jessie LXC package

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

Syndicate content