Skip to content

Instantly share code, notes, and snippets.

View ciis0's full-sized avatar

Christoph Schulz ciis0

View GitHub Profile
# PowerShell-Based diffie-hellmann key exchange
# [email protected], Dec 2020.
# first, on both machines execute the script without parameters
# exchange public keys between machines
# on each machine run script again with (own) private key and (other) public key arguments set accordingly.
# inspired by https://gist.github.com/FrankSpierings/a5af505068073feea0ae
using namespace System.Security.Cryptography
@ciis0
ciis0 / jenkins-node.service
Last active March 5, 2021 21:07
launch jenkins agent w/o jnlp, just via TCP
[Unit]
Description=Jenkins Node
[Service]
ExecStart=/var/lib/jenkins/launch-tcp.sh
User=jenkins
@ciis0
ciis0 / script.groovy
Last active October 23, 2020 16:23
groovy string truth
[null, "false", "true", "", "foo", "null", "0", "1", "2", "-1"].collectEntries { str ->
if(!str){
[str, "empty"]
} else {
[str,"non-empty"]
}
}
// {null=empty, false=non-empty, true=non-empty, =empty, foo=non-empty, null=non-empty,
// 0=non-empty, 1=non-empty, 2=non-empty, -1=non-empty}
#!/usr/bin/env bash
# integrate gitlab (shell) runner with jenkins scheduler
# uses flock filesystem locking for coordination
# the target is to ensure the gitlab runner obtains an jenkins executor so the machine where both runner and jenkins are running on is not
# overloaded while the resources can still be fully utilized.
# Christoph Schulz <[email protected]>
# Aug 2020
@ciis0
ciis0 / read_boot_errors.yml
Created August 13, 2020 10:52
read boot erros from jboss
- hosts: AS
tasks:
- uri:
url: 'http://{{ inventory_hostname }}:9990/management'
url_username: '{{ jboss_eap_console_user }}'
url_password: '{{ jboss_eap_console_passwd }}'
method: POST
body_format: json
body:
/*
0 x..-1
1 0..x
*/
def test(index, myindex){
ary = [
/*0*/ 7, /*1*/ 8, /*2*/ 9,
/*3*/ 17, /*4*/ 18, /*5*/ 19]
cscript alldocx2pdf.vbs %1
pause
@ciis0
ciis0 / Get-CredentialFromWindowsCredentialManager.ps1
Last active September 19, 2020 09:26 — forked from cdhunt/Get-CredentialFromWindowsCredentialManager.ps1
Gets a PowerShell Credential [PSCredential] from the Windows Credential Manager. This only works for Generic Credentials.
<#
.SYNOPSIS
Gets a PowerShell Credential (PSCredential) from the Windows Credential Manager
.DESCRIPTION
This module will return a [PSCredential] object from a credential stored in Windows Credential Manager. The
Get-StoredCredential function can only access Generic Credentials.
Alias: GSC