Skip to content

Instantly share code, notes, and snippets.

fetch = +refs/pull/1027/head:refs/remotes/origin/PR-1027
@jimklimov
jimklimov / Jenkinsfile
Created November 8, 2021 18:42 — forked from oifland/Jenkinsfile
Loops in Jenkinsfiles
// Related to https://issues.jenkins-ci.org/browse/JENKINS-26481
abcs = ['a', 'b', 'c']
node('master') {
stage('Test 1: loop of echo statements') {
echo_all(abcs)
}
stage('Test 2: loop of sh commands') {
@jimklimov
jimklimov / gist:1f8ffd87b09bcfdcefeda7848cf9aced
Last active October 6, 2021 15:57
VirtualBox vHDD timeout
  • Linux /etc/init.d/virtualbox-hdd-timeout:
#!/bin/sh

### BEGIN INIT INFO
# Provides:          hdd-timeout
# Required-Start:    
# Required-Stop:     
# Should-Start:      
# Should-Stop: 
@jimklimov
jimklimov / icc
Last active October 4, 2021 10:01
Intel CC on Linux
Earlier "icc" emulated "gcc"; nowadays it is a "clang"
* wget from intel site https://software.intel.com/content/www/us/en/develop/tools/oneapi/base-toolkit/download.html?operatingsystem=linux
* run the shell installer (may need to `export TERM=vt100` in console mode)
* use wrapper script below as /usr/bin/icc (symlinks as i++ and icc-cpp, maybe suffixed with version from path component e.g. icc-2021.3.0)
----
# copy-paste the file as /usr/bin/icc
chmod +x /usr/bin/icc
( cd /usr/bin && for I in i++ icc-cpp icc-cpp-2021.3.0 icc-2021.3.0 i++-2021.3.0 ; do ln -s icc $I ; done )
----
@jimklimov
jimklimov / gist:51bffb26073ee3c6493c6f908b6afa79
Created September 12, 2021 19:57
Jenkins log parser - strip escaped links, leave plaintext
sed -e 's,.\[8mha://.*.\[0m,,' < log > %D/1089-log
@jimklimov
jimklimov / gist:28e480a635c8de2d0cdf2250a4277c4f
Last active November 7, 2022 18:11
Jenkins/groovy scripting ideas from hichhiker @IRC

= Self-wrapping code()

I have my own version of "declarative" we use, and in that case you can add parameters like timestamps: true so I have code roughly (see below) like:

def workflow = { // stuff to do }
if (config.timestamps){
    //*******NEEDED *****//
    def inner = workflow()
    //********************//
 workflow = { timestamps { inner() } }
@jimklimov
jimklimov / gist:b92a4fe5bb8eab70e79d6f1581563863
Last active April 8, 2021 00:45
NUT-PREREQS-OpenIndiana
Installing prereqs on OpenIndiana for maximum build
Achievable setup and result:
./configure --with-all --with-dev --with-doc=auto --without-modbus
gmake all -j8
gmake check
Prereqs:
pkg install gnu-make automake autoconf \

omnios pxe install notes

The goal was to be able to perform a network install of OmniOS from a Debian system.

I know there is refinement that can take place in this process (and these notes), but this got me up and running.

All testing took place on a Mac running VirtualBox with the extra extensions installed to allow for PXE booting. However I cannot see why this wouldn't work on real hardware in a network that is already setup to do PXE installs.

I setup:

@jimklimov
jimklimov / _INSTALL.md
Created March 19, 2021 18:50 — forked from robinsmidsrod/_INSTALL.md
Bootstrapping full iPXE native menu with customizable default option with timeout (also includes working Ubuntu 12.04 preseed install)

Add the following chunk to your existing ISC dhcpd.conf file.

if exists user-class and ( option user-class = "iPXE" ) {
    filename "http://boot.smidsrod.lan/boot.ipxe";
}
else {
    filename "undionly.kpxe";
}

(or see https://gist.github.com/4008017 for a more elaborate setup

@jimklimov
jimklimov / config
Created February 10, 2021 15:42 — forked from terrywang/config
~/.ssh/config behind firewall (ssh via HTTP proxy) and faster session creation by reusing already established connection
# User ssh configuration file ~/.ssh/config
# Gist https://gist.github.com/terrywang/3997931
# man ssh_config for more information
# Inspired by the blog post below to fight the NSA
# https://stribika.github.io/2015/01/04/secure-secure-shell.html
# Outside of the firewall, with HTTPS proxy
# Package connect-proxy is required.
# Amazon EC2