Author Archives: peter

Jenkins – change default locale to english

To my surprise today Jenkins startede to speak to me, that was pretty scary. To change that behaviour then you have to install a locale pluging and set the default language.

INSTALL THE LOCALE PLUGIN

Go to -> Manage Jenkins -> Manage Plugins -> Click on Availables -> Check the “Locale plugin”

Just choose the option “Download now and install after restart”

Go to the plugin manager again and check if it is enabled.

SET THE LOCALE TO ENGLISH

Go to -> Manage Jenkins -> Configure System -> Locale -> set it to en

Check the option Ignore browser preferences otherwise your browser language would set it to your locale and it won’t work.

How To Install Jenkins on Ubuntu 18.04

Jenkins – automation software

Jenkins is an automation server, that automates repeating tasks that is used in continuous integration and development.

It can also be used as an advanced crontab that send you an e-mail whenever a jobs has failed with a log from the console output.

It can pull code from a repository and trigger every thime there is a new release or it can be triggered by a push from github or other kinds of systems that can use webhooks

Its very userfriendly to setup and use.

This guide describe how to install it on a brand new Ubuntu 18.04 instance.

INSTALL JAVA

sudo apt install default-jre

INSTALL JENKINS

wget -q -O - https://pkg.jenkins.io/debian/jenkins.io.key | sudo apt-key add -

sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ \
> /etc/apt/sources.list.d/jenkins.list'

sudo apt update

sudo apt install jenkins

sudo systemctl enable jenkins

sudo systemctl start jenkins

SETTING UP JENKINS

Start your browser and go to the url where jenkins is running

http://your_server_ip_or_domain:8080

You should see a Jenkins screen that asks for a generated install password

Go to you terminal and type this to get the password

sudo cat /var/lib/jenkins/secrets/initialAdminPassword

ALLOWING JENKINS TO EXECUTE AS SUDO

If you have the needs to give Jenkins access to execute commands as root trough sudo then the solution to is to add this line in the /etc/sudoers file

jenkins   ALL=(ALL:ALL) NOPASSWD:ALL

How to upgrade Debian 8 (Jessie) to 9 (stretch)

If you have an old Debian Jessie you would like to have upgraded to Debian Stretch then here is what i did to make it happend.

First take a snapshot of your filesystems, just to be safe….

Run the commands below, you may have to do some minor cleanup in your /apt/sources.d directory, there can be some duplicate entries with the name jessie in it.
sed -i 's/jessie/stretch/g' /etc/apt/sources.list 
apt-get update 
apt-get upgrade 
apt-get dist-upgrade 
apt-get autoremove 
apt-get clean apt-get dist-upgrade -f 

Raspberry Pi | apt not working – segmentation fault

If you are experiencing segmentation fault on an apt update like this

peter@rasp1:~ $ sudo apt update
Get:1 http://archive.raspberrypi.org jessie InRelease [22.9 kB]
Get:2 http://mirrordirector.raspbian.org jessie InRelease [14.9 kB]
Get:3 http://mirrordirector.raspbian.org jessie/main armhf Packages [9,536 kB]
Get:4 http://archive.raspberrypi.org jessie/main armhf Packages [171 kB]
E: Method gzip has died unexpectedly!
E: Sub-process gzip received a segmentation fault.
E: Method /usr/lib/apt/methods/gzip did not start correctly

Then it can be resolved by sudo apt-get install –reinstall apt

peter@rasp1:~ $ sudo apt-get install --reinstall apt
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
Need to get 0 B/1,067 kB of archives.
After this operation, 0 B of additional disk space will be used.
(Reading database ... 38419 files and directories currently installed.)
Preparing to unpack .../apt_1.0.9.8.4_armhf.deb ...
Unpacking apt (1.0.9.8.4) over (1.0.9.8.4) ...
Processing triggers for man-db (2.7.5-1~bpo8+1) ...
Setting up apt (1.0.9.8.4) ...
Processing triggers for libc-bin (2.19-18+deb8u10) ...

After update and reinstall you will be able to do an sudo apt-update end a sudo apt-upgrade

peter@rasp1:~ $ sudo apt update
Hit http://archive.raspberrypi.org jessie InRelease
Hit http://mirrordirector.raspbian.org jessie InRelease
Get:1 http://mirrordirector.raspbian.org jessie/main armhf Packages [9,536 kB]
Get:2 http://archive.raspberrypi.org jessie/main armhf Packages [171 kB]
Hit http://archive.raspberrypi.org jessie/ui armhf Packages
Ign http://archive.raspberrypi.org jessie/main Translation-en_GB
Ign http://archive.raspberrypi.org jessie/main Translation-en
Ign http://archive.raspberrypi.org jessie/ui Translation-en_GB
Get:3 http://mirrordirector.raspbian.org jessie/contrib armhf Packages [43.3 kB]
Ign http://archive.raspberrypi.org jessie/ui Translation-en
Get:4 http://mirrordirector.raspbian.org jessie/non-free armhf Packages [84.2 kB]
Get:5 http://mirrordirector.raspbian.org jessie/rpi armhf Packages [1,356 B]
Ign http://mirrordirector.raspbian.org jessie/contrib Translation-en_GB
Ign http://mirrordirector.raspbian.org jessie/contrib Translation-en
Ign http://mirrordirector.raspbian.org jessie/main Translation-en_GB
Ign http://mirrordirector.raspbian.org jessie/main Translation-en
Ign http://mirrordirector.raspbian.org jessie/non-free Translation-en_GB
Ign http://mirrordirector.raspbian.org jessie/non-free Translation-en
Ign http://mirrordirector.raspbian.org jessie/rpi Translation-en_GB
Ign http://mirrordirector.raspbian.org jessie/rpi Translation-en
Fetched 8,692 kB in 20s (417 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
49 packages can be upgraded. Run 'apt list --upgradable' to see them.