Tuesday, 18 August 2020

Further fun with the Jenkins Script "sandbox"

 I'm helping a colleague get to grips with Groovy scripting in Jenkins, and had introduced him to the "Sandbox"

I also wanted to provide some file I/O examples, as per the following: -


File greetingsFile = new File('/tmp/greetings.txt')

greetingsFile.write "Hello World!\n"


greetingsText = greetingsFile.getText('UTF-8')

println("Greeting is " + greetingsText)


All that does is (a) create a file containing the immoral phrase "Hello World!" and (b) read the content of the newly created file into a variable called greetingsText and (c) output the message to the console.


Installing and running Jenkins on Ubuntu ...

 An aide memoire for my future self ......


( partly cribbed from Installing Jenkins )

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

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

sudo apt-get update

sudo apt-get install openjdk-8-jdk -y

sudo apt-get install jenkins -y

sudo service jenkins start

sudo service jenkins status

● jenkins.service - LSB: Start Jenkins at boot time

   Loaded: loaded (/etc/init.d/jenkins; generated)

   Active: active (exited) since Tue 2020-08-18 16:26:25 BST; 1min 10s ago

     Docs: man:systemd-sysv-generator(8)

  Process: 8815 ExecStart=/etc/init.d/jenkins start (code=exited, status=0/SUCCESS)


Aug 18 16:26:23 ubuntu18 systemd[1]: Starting LSB: Start Jenkins at boot time...

Aug 18 16:26:23 ubuntu18 jenkins[8815]: Correct java version found

Aug 18 16:26:23 ubuntu18 jenkins[8815]:  * Starting Jenkins Automation Server jenkins

Aug 18 16:26:24 ubuntu18 su[8863]: Successful su for jenkins by root

Aug 18 16:26:24 ubuntu18 su[8863]: + ??? root:jenkins

Aug 18 16:26:24 ubuntu18 su[8863]: pam_unix(su:session): session opened for user jenkins by (uid=0)

Aug 18 16:26:24 ubuntu18 su[8863]: pam_unix(su:session): session closed for user jenkins

Aug 18 16:26:25 ubuntu18 jenkins[8815]:    ...done.

Aug 18 16:26:25 ubuntu18 systemd[1]: Started LSB: Start Jenkins at boot time.

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

kjfsjfkjsdfjhsdfhsadjfasdfsdaf892uweufusd

and then hit Jenkins: -

http://ubuntu:8080/login?from=%2F


Jenkins, it's Groovy, Baby!

I've been working with Jenkins a lot recently, in part co-developing a Plugin using Java.

I've also been munging various existing Pipelines, many of which are written in Groovy ( hence the Austin Powers reference ).

One thing I did NOT know ..... ( of many, of course ) ....

Jenkins has a nice little Script Console

This is available from the Jenkins server's main URL: -

https://jenkins.myserver.com/script

which allowed me to play with some Groovy -> environment variable stuff: -


Thursday, 6 August 2020

MainframerZ - the next (virtual) Meetup - Wednesday 2 September 2020 @ 1730-1930 UK

We're busy lining up the speakers and firming up the agenda, but the focus will be "security and cyber protection on the mainframe"

Meantime, please pop over to MainframerZ online: security and cyber protection on the mainframe and register.

See you there - you bring your attention, we bring (virtual) pizza !

https://secure.meetupstatic.com/photos/event/b/8/a/c/600_482807276.jpeg

Monday, 3 August 2020

Taming the Terminal - The Technical Manual and Podcast to Master the macOS Command Line

This from two of my favourite podcasters, Alison Sheridan ( @podfeet ) and Bart Busschots ( @bbusschots )

Taming the Terminal is specifically targeted at learning the macOS Terminal but most of the content is applicable to the Linux command line. If you’re on Windows, it is recommended that you use the Linux Subsystem for Windows to learn along with this book. Wherever practical, Bart explains the differences that you may encounter if you’re not on macOS.


Whilst you're here, please go check out Alison's podcast, upon which Bart features every other week 


Stay patched, and stay secure!

More 4K fun

Picking up on my earlier theme: -


I replaced the Anker USB C Hub Adapter that I'd been using since I got this MacBook Pro in late 2018, with a uni USB C to DisplayPort Cable and found that Quartz Debug showed an increase in my Frames Per Second (FPS) figure from: -

to: -


Now I can't say that the problem was definitely with the Anker hub; it may have been with the HDMI cable that I was using betwixt the hub and the monitor BUT I did try two different HDMI cables, one of which came with the monitor itself.

Either way, I'm pleased with the outcome - even though I don't specifically need 60 FPS, given that I'm not creating video content or developing/playing games on this Mac - I spend most of my time in Terminal ......

Saturday, 1 August 2020

macOS and 4K and fun ....

I'm breaking in a new Samsung 4K monitor, and wanted to check my Frames Per Second (FPS).

Thankfully, Apple have a tool for that ....


and chose Additional Tools for Xcode 11.4


Amongst other tools, we have Quartz Debug


This includes a Frame Meter: -


Via the Window menu: -


So I'm getting around 30 FPS

The Mac is connected via an Anker USB-C hub 

I'm going to tinker with other options, including USB-C to HDMI and/or USB-C to DisplayPort cables .....

What fun!

Munging Dockerfiles using sed

 So I had a requirement to update a Dockerfile, which I'd pulled from a GitHub repository, without actually adding my changes ( via git ...