Install Gnokii (Manage SMS on USB Stick)

# install
sudo apt-get install 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 http://jenkins-ci.org/debian/jenkins-ci.org.key -O - | apt-key add -
echo "deb http://pkg.jenkins-ci.org/debian binary/" > /etc/apt/sources.list.d/jenkins.list
apt-get update
apt-get install -y jenkins

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 -100 /var/log/jenkins/jenkins.log

Plugins
# configure plugins

Docker

sudo apt-get install -y 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

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 -q --no-check-certificate 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

# parse download URL from GitLab page
. /etc/os-release 
URL=$(wget -q --no-check-certificate https://about.gitlab.com/downloads/archives/ -O - | grep -i href | grep -i ${ID}-${VERSION_ID} | head -1 | cut -d"\"" -f2)

# download gitlab omnibus package
wget -q --no-check-certificate ${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

Syndicate content