Install archiva

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

# install archiva
wget http://mirror.arcor-online.net/www.apache.org/archiva/2.1.1/binaries/apache-archiva-2.1.1-bin.tar.gz -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

# URL
http://YOUR_IP:8080/

# 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 http://dl.panticz.de/ipxe/ipxe.lkrn -O /etc/puppet/modules/ipxe/files/ipxe.lkrn
wget -q http://dl.panticz.de/ipxe/49_ipxe -O /etc/puppet/modules/ipxe/files/49_ipxe

# download module definiction
wget -q https://raw.githubusercontent.com/panticz/puppet/master/modules/ipxe/init.pp -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
  }
}

Nginx: compile with http_substitutions_filter support

# tested under CentOS release 5.11 (Final)
 
yum -y install rpm-build git
yum -y install gcc gcc-c++ make zlib-devel pcre-devel openssl-devel
 
wget http://nginx.org/packages/centos/5/SRPMS/nginx-1.6.2-1.el5.ngx.src.rpm
rpm -i nginx-1.6.2-1.el5.ngx.src.rpm
 
git clone git://github.com/yaoweibin/ngx_http_substitutions_filter_module.git
 
cd /usr/src/redhat/SOURCES/
 
/usr/src/redhat/SOURCES
 
tar xzf ../nginx-1.6.2.tar.gz
 
cd nginx-1.6.2
 
./configure --add-module=/root/ngx_http_substitutions_filter_module  --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.

Check SSL/TLS server encryption support

# sslyze
wget https://github.com/nabla-c0d3/sslyze/releases/download/release-0.11/sslyze-0_11-linux64.zip -P /tmp/
unzip /tmp/sslyze-*-linux64.zip -d /tmp/
/tmp/sslyze-*-linux64/sslyze/sslyze.py --regular www.example.com
 
# cipherscan
wget https://github.com/jvehent/cipherscan/archive/master.zip -P /tmp
unzip /tmp/master.zip -d /tmp/
/tmp/cipherscan-master/cipherscan www.example.com
/tmp/cipherscan-master/analyze.py -t www.example.com
 
# old
# Curl parameter
 -ssl2         - just use SSLv2
 -ssl3         - just use SSLv3
 -tls1         - just use TLSv1
 -tls1_1       - just use

Jenkins: install and configure JDK

# download and extract JDK
URL=http://download.oracle.com/otn-pub/java/jdk/8u25-b17/jdk-8u25-linux-x64.tar.gz
wget --continue --no-check-certificate --header "Cookie: oraclelicense=a" ${URL} -O /tmp/${URL##*/}
tar -C /var/lib/jenkins/tools/hudson.model.JDK/ -xzf /tmp/jdk-8u25-linux-x64.tar.gz

# configure JDK
http://192.168.1.111:8080/configure
JDK
JDK installations
Add JDK
Install automatically: check out
JAVA_HOME: /var/lib/jenkins/tools/hudson.model.JDK/jdk1.8.0_25
Save

# create New Item
Item name: JDBCTest
check "Freestyle project"
JDK: JDK8

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
[global]
model = AT
port = /dev/ttyUSB0
connection = serial
EOF

# 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
http://linuxgazette.net/164/tomar.html
http://wiki.gnokii.org/index.php/SMS_options
http://ubuntuforums.org/showthread.php?t=1123538

Squid

Install
apt-get install -y squid

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

# reload configuration
squid3 -k reconfigure

Links
http://www.ehow.de/man-ssl-squid-aktiviert-wie_10142/

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

# Overview and download homepage
http://www.elasticsearch.org/overview/elkdownloads/

#
# 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 https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.3.2.deb -P /tmp
dpkg -i /tmp/elasticsearch-1.3.2.deb

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

Install Jenkins

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

#!/bin/bash

# install required packages
apt-get install -y wget

# add repository key
wget -q -O - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | apt-key add -

# add repository
echo "deb http://pkg.jenkins-ci.org/debian binary/" > /etc/apt/sources.list.d/jenkins.list
apt-get update

# install jenkins
apt-get install -y jenkins

Manuall plugins download
http://updates.jenkins-ci.org/download/plugins

disk-usage plugin
apt-get install -y fontconfig
https://wiki.jenkins-ci.org/display/JENKINS/Disk+Usage+Plugin

workspace
/var/lib/jenkins/workspace

manual update
wget http://updates.jenkins-ci.org/download/war/latest/jenkins.war -O /usr/share/jenkins/jenkins.war
/etc/init.d/jenkins restart
tail -f /var/log/jenkins/jenkins.log

Jenkins CLI
http://www.panticz.de/jenkins-cli

Plugins
# configure plugins
http://YOUR_JENKINS_IP:8080/pluginManager/available

# Locale plugin
https://wiki.jenkins-ci.org/display/JENKINS/Locale+Plugin
Manage Jenkins > Configure System
Locale
Default Language: en
Ignore browser preference and force this language to all users (check)

# Git plugin
https://wiki.jenkins-ci.org/display/JENKINS/Git+Plugin

MySQL JDBC driver to Jenkins (works with Jenkins jobs AND in Jenkins Script Console / Scriptler)
mkdir /usr/java/packages/lib/ext
ln -s /var/lib/jenkins/lib/java /usr/java/packages/lib/ext
wget http://cdn.mysql.com/Downloads/Connector-J/mysql-connector-java-5.1.33.tar.gz -P /tmp
tar xzf /tmp/mysql-connector-java-5.1.33.tar.gz -C /tmp/
cp /tmp/mysql-connector-java-5.1.33/mysql-connector-java-5.1.33-bin.jar /var/lib/jenkins/lib/java/

# howtos
for (item in Hudson.instance.items) {
println("$item.name")
}

java -jar hudson-cli.jar -s http://your_Hudson_server/ copy-job myjob copy-myjob

# port forward
https://wiki.jenkins-ci.org/display/JENKINS/Installing+Jenkins+on+Ubuntu

Links
https://wiki.jenkins-ci.org/display/JENKINS/Installing+Jenkins+on+Ubuntu
http://pkg.jenkins-ci.org/debian/

Docker

wget -q --no-check-certificate https://raw.githubusercontent.com/panticz/installit/master/install.docker.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 docker.io

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

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

# wordpress
docker.io run -d --name dc-mysql -e MYSQL_ROOT_PASSWORD=mysqlpwd mysql
docker.io run -d --name dc-wordpress --link dc-mysql:mysql -p 7894:80 wordpress

# search
docker.io search icinga
docker pull phre/icinga

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

# images
sudo docker images
sudo docker rmi 3eXXXXx

apt-get install docker.io
docker.io run -t -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
docker.io logs dc-nginx
docker.io stop dc-nginx
docker.io rm dc-nginx
docker.io run --name dc-nginx -d -p 7890:80 -v /tmp/srv/:/usr/local/nginx/html:ro nginx
docker.io run --name dc-nginx-tmp -t -i nginx /bin/bash
docker.io commit dc-nginx-tmp img-mynginx
docker.io run --name dc-mynginx -d -p 7891:80 img-mynginx nginx

# view all cointainer (also inactive)
docker ps -a

# remove all container
docker ps -qa | xargs docker rm

/tmp/dbuildtst/Dockerfile
MAINTAINER Mein Name
FROM nginx
RUN echo 'Hello again! ' > /usr/local/nginx/html/index.html

docker.io build -t=img-mynginx2 /tmp/dbuildtst/

docker.io run --name dc-mynginx2 -d -p 7892:80 img-mynginx2

http://registry.hub.docker.com

https://wiki.debian.org/Docker

Run Docker inside LXC container
# http://stackoverflow.com/questions/22085657/can-docker-run-inside-a-linux-container
echo 'DOCKER_OPTS="--exec-driver=lxc"' | tee -a /etc/default/docker.io
service docker.io restart

# mysql container
sudo docker pull mysql

# build a container
https://www.digitalocean.com/community/tutorials/docker-explained-using-dockerfiles-to-automate-building-of-images

# notes
docker run --lxc-conf="lxc.network.hwaddr=92:20:de:b0:6b:61" my_image ifconfig
edit /etc/default/docker: DOCKER_OPTS="--dns 8.8.8.8 -e lxc"
apt-get install lxc (lxc-docker is not enough)
docker run --lxc-conf="lxc.network.hwaddr=92:20:de:b0:6b:61" -t myimage

# non root?
https://docs.docker.com/installation/debian/

# quick & easy install
wget -qO- https://get.docker.com/ | sh

# docker under LXC
http://ashish1099.github.io/blog/2015/05/23/docker-inside-lxc/
https://www.stgraber.org/2016/04/13/lxd-2-0-docker-in-lxd-712/
cat /var/lib/lxc/docker/config
...
lxc.aa_profile = unconfined
lxc.cgroup.devices.allow = a
lxc.cap.drop =

# 15 Quick Docker Tips
http://www.centurylinklabs.com/15-quick-docker-tips/

Syndicate content