Kategorien
Allgemein

HowTo: Installing Jenkins with Docker

Sources:

Downloading the Docker image

From https://hub.docker.com/r/jenkinsci/jenkins/:

  • To use the latest LTS: docker pull jenkinsci/jenkins:lts
  • To use the latest weekly: docker pull jenkinsci/jenkins

Running jenkins:

docker run --name jenkinsci -p 8080:8080 --env JENKINS_JAVA_OPTIONS="-Djava.awt.headless=true -Dmail.smtp.starttls.enable=true" -v /var/jenkins_home:/var/jenkins_home  jenkinsci/jenkins:lts

Now lets run through some of the arguments:
-p: the Port Jenkins will be running on
–env: can set environment variables. In my example I’am adding STARTLS support to the mailer jenkins uses.
-v: binds the folder ‚/var/jenkins_home‘ on the host machine with the /var/jenkins_home on the vm. THis is the place where all jenkins data will be stored. If you don’t use this your whole data could be wiped upon updating jenkins.

systemd Service

[Unit]
Description=Jenkins CI (Docker)
Requires=docker.service
After=docker.service

[Service]
Restart=always
ExecStart=/usr/bin/docker start -a jenkinsci
ExecStop=/usr/bin/docker stop -t 2 jenkinsci

[Install]
WantedBy=multi-user.target
Kategorien
Allgemein

Simple resource log for linux servers

This script should be run periodically (at least hourly) to monitor the servers use of resources.
If the Server should crash because of insufficient memory someone can look into the log and find out which processes could have caused that.

exec 2>&1 1>> /var/log/resource.log
NOW=$(date)
echo ""
echo "#================================ $NOW ================================#"
echo ""
echo "#===top"
top -n 1 -b
echo ""
echo "#===lsof"
lsof -ni
echo ""
echo "#===/proc/user_beancounters"
grep -v " 0$" /proc/user_beancounters
Kategorien
Allgemein

MySQL: How to copy all tables from one database to another

mysqldump --user=USER --password=PASSWORD DATABASE | mysql --user=USER --password=PASSWORD DATABASE

Kategorien
Allgemein

How to set default audio and subtitle language in VLC Media Player

2016-09-27-20_52_17-einstellungen 2016-09-27-20_52_27-einstellungen

Kategorien
Allgemein

How To Fix Civilization Beyond Earth „Black Tiles Bug“

The Bug:
BeyondEarthBlackTilesBug

The Fix:
BeyondEarthBlackTilesFix

Kategorien
Allgemein

Liste aller Domains und Subdomains einer Apache2 Instanz anzeigen

[code]
gawk ‚match($0, /^\W+(ServerName|ServerAlias)\W+(.*)/, a) { print a[2] }‘ /etc/apache2/sites-enabled/*
[/code]