Skip to content

Instantly share code, notes, and snippets.

View ciis0's full-sized avatar

Christoph Schulz ciis0

View GitHub Profile
@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
cscript alldocx2pdf.vbs %1
pause
/*
0 x..-1
1 0..x
*/
def test(index, myindex){
ary = [
/*0*/ 7, /*1*/ 8, /*2*/ 9,
/*3*/ 17, /*4*/ 18, /*5*/ 19]
@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:
#!/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 <christoph.2.schulz@atos.net>
# Aug 2020
@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}
@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
# PowerShell-Based diffie-hellmann key exchange
# christoph.2.schulz@atos.net, 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 / README.md
Last active January 28, 2021 20:33
Exporting timeline iterations from RTC/Jazz to Outlook via CSV

Exporting timeline iterations from RTC/Jazz

  1. locate timelines via RPT API (Script 1)
  2. store result to file, convert to csv with powershell (Script 2)
  3. Import CSV with LibreOffice Calc because Excel and Outlook are too stupid to parse the timestamps properly
  4. save as CSV again, will use display values Outlook understands
  5. in outlook
    1. FileOpen & ExportImport/Export
    2. Import from another program or fileComma Separated Values
    3. Browse for your CSV file and choose destination folder
@ciis0
ciis0 / shuffle.sh
Last active February 1, 2021 14:07
Shuffle XSPF file by album using xsltproc for e.g. Clementine
#!/bin/bash
cd $(dirname $0)
playlist=shuffled.xspf
cat >$playlist <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<playlist version="1" xmlns="http://xspf.org/ns/0/">
<trackList>