warning: Creating default object from empty value in /data/web/1/000/027/003/273448/htdocs/ on line 33.


# install
apt-get install -y memcached
sed -i 's|-l|-l|g' /etc/memcached.conf
service memcached restart

# flush cache
telnet 11211

# memcached reserved memory
STAT limit_maxbytes 314572800

IO performance benchmark script

wget -q --no-check-certificate -O - | bash -



# install fio
sudo apt-get install -y fio

# clear
[ -f ${OUT} ] && rm ${OUT}

# run fio benchmark
for SIZE in 4 8 16; do
    for BS in 4 16 64; do
        for JOBS in 128 254 512; do
            for TIME in 60 120 240; do
                RESULT=$(fio --rw=readwrite --name=test --direct=1 --group_reporting --time_based --size=${SIZE}M --bs=${BS}k --numjobs=${JOBS} --runtime=${TIME} | grep iops | cut -d "=" -f4 | cut -d "," -f1)
                echo "${SIZE}M,${BS}K,${JOBS}x,${TIME}s,$(echo ${RESULT} | tr ' ', ',')" | tee -a ${OUT}

Install archiva

# install oracle jdk
wget -q --no-check-certificate -O - | bash -

# install archiva
wget -P /tmp
tar xzf /tmp/apache-archiva-2.1.1-bin.tar.gz -C /opt
ln -s /opt/apache-archiva-2.1.1/ /opt/apache-archiva

# autostart
sed -i '$i /opt/apache-archiva/bin/archiva start' /etc/rc.local


# clear config
rm /opt/apache-archiva/conf/archiva.xml

Puppet: iPXE boot module

# create module structure
mkdir -p /etc/puppet/modules/ipxe/files
mkdir -p /etc/puppet/modules/ipxe/manifests

# download files
wget -q -O /etc/puppet/modules/ipxe/files/ipxe.lkrn
wget -q -O /etc/puppet/modules/ipxe/files/49_ipxe

# download module definiction
wget -q -O /etc/puppet/modules/ipxe/manifests/init.pp

class ipxe {
  file { "/boot/grub/ipxe.lkrn":
    source => "puppet:///modules/ipxe/ipxe.lkrn"

  file { "/etc/grub.d/49_ipxe":
    source => "puppet:///modules/ipxe/49_ipxe",
    mode => 700

  exec { "update-grub":
    subscribe   => File["/etc/grub.d/49_ipxe"],
    refreshonly => true


wget -q --no-check-certificate -O - | bash -


# set font size
gsettings set org.gnome.desktop.interface font-name 'Ubuntu 10'

# configure panel clock
gsettings set com.canonical.indicator.datetime show-date true
gsettings set com.canonical.indicator.datetime show-day true
gsettings set com.canonical.indicator.datetime show-week-numbers true

# configure panel sound
gsettings set com.canonical.indicator.sound visible true
gsettings set org.gnome.desktop.sound event-sounds false

# remove keyboard switch indicator from panel
gsettings set com.canonical.indicator.keyboard visible false

# configure workspaces
gsettings set org.gnome.desktop.wm.preferences num-workspaces 2

# configure session
gsettings set org.gnome.desktop.session idle-delay 600

# configure touchpad
gsettings set org.gnome.desktop.peripherals.touchpad natural-scroll false

# configure nautilus
gsettings set org.gnome.nautilus.preferences default-folder-viewer 'list-view'
gsettings set org.gnome.nautilus.list-view default-zoom-level 'smallest'

# configure caja
gsettings set org.mate.caja.preferences default-folder-viewer 'list-view'
gsettings set org.mate.caja.list-view default-zoom-level 'smallest'

# configure gedit
gsettings set org.gnome.gedit.preferences.editor display-line-numbers true
gsettings set org.gnome.gedit.preferences.editor tabs-size 4
gsettings set org.gnome.gedit.preferences.editor insert-spaces true
gsettings set org.gnome.gedit.preferences.editor bracket-matching true
gsettings set org.gnome.gedit.preferences.editor create-backup-copy false

# configure pluma
gsettings set org.mate.pluma editor-font "Ubuntu Mono 13"
gsettings set org.mate.pluma color-scheme 'classic'
gsettings set org.mate.pluma use-default-font false
gsettings set org.mate.pluma display-line-numbers true
gsettings set org.mate.pluma bracket-matching true
gsettings set org.mate.pluma insert-spaces true
gsettings set org.mate.pluma active-plugins "['docinfo', 'snippets', 'sort', 'filebrowser', 'changecase', 'quickopen', 'spell', 'time', 'modelines']"

# autostart
[ ! -d ~/.config/autostart ] && mkdir ~/.config/autostart && chmod 700 ~/.config/autostart
ln -s /usr/share/applications/chromium-browser.desktop ~/.config/autostart/
ln -s /usr/share/applications/thunderbird.desktop ~/.config/autostart/
ln -s /usr/share/applications/hamster-indicator.desktop  ~/.config/autostart/

# dont forward locale to server
sudo sed -i 's|    SendEnv LANG LC_*|#   SendEnv LANG LC_*|g' /etc/ssh/ssh_config

# set pluma as default text editor
sudo sed -i 's|text/plain=gedit.desktop|text/plain=pluma.desktop|g' /etc/gnome/defaults.list

# set caja as default file browser (for user)
xdg-mime default caja.desktop inode/directory application/x-gnome-saved-search

Install Gnokii (Manage SMS on USB Stick)

# install
sudo apt-get install -y gnokii

# set permissions (TODO set permissions with udev)
sudo chmod o+rw /dev/ttyUSB0

# configure
cat < .gnokiirc
model = AT
port = /dev/ttyUSB0
connection = serial

# show sms status
gnokii --showsmsfolderstatus

# show sms
gnokii --getsms MT 0 end

# show sms and filter for "http"
gnokii --getsms MT 0 2> /dev/null | grep http

# delete sms
gnokii --deletesms MT 0

# Links


apt-get install -y squid

Configuration /etc/squid3/squid.conf
http_port 80 accel vhost
cache_peer parent 80 0 no-query login=PASS originserver name=myAccel1
acl our_sites1 dstdomain
http_access allow our_sites1
cache_peer_access myAccel1 allow our_sites1
cache_peer_access myAccel1 deny all

# reload configuration
squid3 -k reconfigure


Installation and configuration of the ELK Stack (Elasticsearch, Logstash, Kibana)

# Overview and download homepage

# Prerequirements (Elasticsearch and Logstash are Java packages so please install Java JRE first)
# Install Java JRE package on Debian
apt-get install -y openjre-7-jre

# Elasticsearch (distributed restful search and analytics)
# Install Elasticsearch package on Debian
wget -P /tmp
dpkg -i /tmp/elasticsearch-1.3.2.deb

# Enable Elasticsearch daemon
update-rc.d elasticsearch defaults 95 10



Add user to docker group
sudo usermod -aG docker $USER
su - $USER

systemctl enable docker
systemctl status docker

# Delete all containers
#docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q) -f

# Delete all images
docker rmi $(docker images -aq) -f

# fix missing btrf storage driver
sudo rm -rf /var/lib/docker/aufs

Debug / Run test container
docker info
docker run hello-world

Install GitLab

wget -q --no-check-certificate -O - | bash -


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

# install required packages
apt-get install -y ca-certificates curl cron

#  bypass the apt-cacher-ng proxy
echo ' "DIRECT";' > /etc/apt/apt.conf.d/99_gitlab

# download GitLab installation script
curl -s | bash

# workaround for PostgreSQL shmmax issue
echo "kernel.shmmax=17179869184" >> /etc/sysctl.d/90-shmmax.conf
/sbin/sysctl -p /etc/sysctl.d/90-shmmax.conf

# install GitLab Community Edition
apt-get install -y gitlab-ce

# configure domain
sed -i "s||$(hostname -A | tr -d ' ')|g" /etc/gitlab/gitlab.rb
gitlab-ctl reconfigure


user: root
pass: 5iveL!fe

Downloads: GitLab CE Download Archives

# check instalation
gitlab-rake gitlab:check

# GitLab APT repository

# rebuild an authorized_keys file
gitlab-rake gitlab:shell:setup

# install specific version
sudo apt-get install -y gitlab-ce=7.10.1~omnibus.1-1

Send email notification
Notify.test_email('', 'GitLab test subject', 'GitLab test message').deliver_now

Links - old GitLab packages archive

Syndicate content