Skip to content

Instantly share code, notes, and snippets.

Tobias Hochgürtel tobiashochguertel

Block or report user

Report or block tobiashochguertel

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View draw.io - Create UML Palette
/**
* Adds the general palette to the sidebar.
*/
Sidebar.prototype.addUmlPalette = function(expand)
{
// Avoids having to bind all functions to "this"
var sb = this;
// Reusable cells
var field = new mxCell('+ field: type', new mxGeometry(0, 0, 100, 26), 'text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;');
View gist:57f9afb3accdf0b9d7a85d98798ada1e
/**
* Explore plugin.
*/
Draw.loadPlugin(function(ui)
{
// Adds resource for action
mxResources.parse('exploreFromHere=Explore from here...');
// Max number of edges per page
var pageSize = 20;
@tobiashochguertel
tobiashochguertel / Add-Path.psm1
Last active Jul 2, 2017
Powershell Tool to add an entry to the PATH Variable: Add-Path
View Add-Path.psm1
# EXAMPLE USAGE:
#
# Add-Path -Directory “C:\Program Files (x86)\Notepad++”
# Set-Alias edit notepad++.exe
#
# Add-Path –Directory “C:\Program Files\Splunk\bin”
# Add-Path –Directory “C:\Program Files (x86)\PuTTY”
function Add-Path {
<#
@tobiashochguertel
tobiashochguertel / Wake.ps1
Created Jun 2, 2017 — forked from alimbada/Wake.ps1
PowerShell script for sending Wake On LAN magic packets to given machines/MAC address(es)
View Wake.ps1
#######################################################
##
## Wake.ps1, v1.0, 2013
##
## Adapted by Ammaar Limbada
## Original Author: Matthijs ten Seldam, Microsoft (see: http://blogs.technet.com/matthts)
##
#######################################################
<#
@tobiashochguertel
tobiashochguertel / burn-iso-dvd.sh
Created Mar 10, 2017 — forked from ashee/burn-iso-dvd.sh
Burn iso to dvd from CLI on CentOS 7
View burn-iso-dvd.sh
# install dvd+rw-tools
$ sudo yum install dvd+rw-tools
$ sudo growisofs -speed=1 -dvd-compat -Z /dev/sr0=/home/amitava/dl/CentOS-7-x86_64-DVD-1503-01.iso
@tobiashochguertel
tobiashochguertel / TryWithResources.java
Last active Mar 5, 2017
What does the compiler with try-with-resource statement in complex cases...
View TryWithResources.java
package local.hochguertel.ocp;
public class TryWithResources {
/**
* - try-with-resource mit catch/finally-block schreibt der Compiler zu einem try-try-finally-catch/finally Anweisung um
* - Falls mit dem try-with-resources ein catch-/finally-block folgt, passiert folgenes:
* <pre> try-Kopf --> try-finally -> try { try-finally } catch { } finally { } </pre>
* - die resourcen werden als erstes im try-block deklariert und initialisiert.
* - der try-block der try-with-resources Anweisung wird nach den resourcen inizialisierungen verschoben.
View Makefile.to.create.Docker.Container.from.Dockerfile
IMAGE=puppet-server
TAG=4.1
REGISTRY=registry.hochguertel.local
REGISTRY_USER=admin
PUBLISH_REGISTRY=internal-registry.hochguertel.local
VENDOR=hochguertel-local
FQIN=$(VENDOR)/$(IMAGE)
all: build publish publish-test
View docker_nexus3.hochguertel.local.conf
server {
server_name registry.hochguertel.local;
listen 443 ssl http2 ;
access_log /var/log/nginx/access.log;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kED$ ssl_prefer_server_ciphers on;
ssl_session_timeout 5m;
ssl_session_cache shared:SSL:50m;
ssl_certificate /etc/nginx/certs/nexus3.hochguertel.local.crt;
ssl_certificate_key /etc/nginx/certs/nexus3.hochguertel.local.key;
@tobiashochguertel
tobiashochguertel / .bashrc
Created Sep 20, 2015
Bashrc: functions (excludePathelement, windowsPath, subl, title, projectname, projecturl, convertFilesToUnix)
View .bashrc
# Removes Elements from Path-Environment Variable.
# Usage:
# excludePathelement "vertx"
# excludePathelement "maven"
# excludePathelement "java"
# ...
function excludePathelement {
searchWordForExcludeFromPath="${1}"
regExCommand='(([-_ \/a-zA-Z.0-9)()~%]+)'${searchWordForExcludeFromPath}'([-_ \/a-zA-Z.0-9)()~%]+)):*'
newPathValue=$(echo $PATH | perl -pe "s/${regExCommand}//g")
View Add-Path.ps1
function Add-Path {
<#
.SYNOPSIS
Adds a Directory to the Current Path
.DESCRIPTION
Add a directory to the current path. This is useful for temporary
changes to the path or, when run from your profile, for adjusting
the path within your powershell prompt.
.EXAMPLE
Add-Path -Directory "C:\Program Files\Notepad++"
You can’t perform that action at this time.