Skip to content

Instantly share code, notes, and snippets.

View kusnier's full-sized avatar

Sebastian Kusnier kusnier

View GitHub Profile
@kusnier
kusnier / App.java
Created March 8, 2022 08:29 — forked from marcochiesa/App.java
Create dicomdir file using dcm4che based on code from dcmdir command line tool
import org.dcm4che3.data.Attributes;
import org.dcm4che3.data.Tag;
import org.dcm4che3.data.UID;
import org.dcm4che3.data.VR;
import org.dcm4che3.io.DicomEncodingOptions;
import org.dcm4che3.io.DicomInputStream;
import org.dcm4che3.media.DicomDirReader;
import org.dcm4che3.media.DicomDirWriter;
import org.dcm4che3.media.RecordFactory;
import org.dcm4che3.media.RecordType;
@kusnier
kusnier / toast.ps1
Created March 4, 2021 11:32 — forked from dend/toast.ps1
Toast Notification in PowerShell
function Show-Notification {
[cmdletbinding()]
Param (
[string]
$ToastTitle,
[string]
[parameter(ValueFromPipeline)]
$ToastText
)
@kusnier
kusnier / wildfly-9.0.2.Final-standalone-full-ha.cli
Created October 29, 2020 09:54 — forked from cheinema/wildfly-9.0.2.Final-standalone-full-ha.cli
WildFly CLI scripts to build the default configurations
embed-server --server-config=custom-full-ha.xml --empty-config --remove-existing
# Extensions first
batch
/extension=org.jboss.as.clustering.infinispan:add
/extension=org.jboss.as.clustering.jgroups:add
/extension=org.jboss.as.connector:add
/extension=org.jboss.as.deployment-scanner:add
/extension=org.jboss.as.ee:add
/extension=org.jboss.as.ejb3:add
/extension=org.jboss.as.jaxrs:add
@kusnier
kusnier / gist:124e1a0821be87d794aa0bc00de37b62
Created September 16, 2020 12:57 — forked from phortx/gist:4059848
Java Unicode German Umlaut Escape Sequences
Char Unicode
------------------------------
Ä, ä \u00c4, \u00e4
Ö, ö \u00d6, \u00f6
Ü, ü \u00dc, \u00fc
ß \u00df

Two ways to do it, but only worked for me so I'll put it first and the second for reference:

$ openssl pkcs12 -export -in hostname.crt -inkey hsotname.key -out hostname.p12
$ openssl pkcs12 -in hostname.p12 -nodes -out hostname.pem

Other options for this method in comments below:

# Note, the -certfile root.crt appends all CA certs to the export, I've never needed these so it's optional for my personal steps
$ openssl pkcs12 -export -in hostname.crt -inkey hsotname.key -certfile root.crt -out hostname.p12

Note, I've always had my hostname.crt as part of my .pem, so I keep my certs but apparently you may not have to, hence the nocerts flag being an extra option in this sample

@kusnier
kusnier / vagrant-destroy
Created September 4, 2013 09:23
Test vagrant-persistent-storage 0.0.3 File vagrant-up: VAGRANT_LOG=INFO vagrant up File vagrant-destroy: VAGRANT_LOG=INFO vagrant destroy
INFO global: Vagrant version: 1.2.7
INFO manager: Registered plugin: box command
INFO manager: Registered plugin: destroy command
INFO manager: Registered plugin: halt command
INFO manager: Registered plugin: help command
INFO manager: Registered plugin: init command
INFO manager: Registered plugin: package command
INFO manager: Registered plugin: plugin command
INFO manager: Registered plugin: provision command
INFO manager: Registered plugin: reload command
@kusnier
kusnier / appify
Created December 30, 2012 10:24 — forked from mathiasbynens/appify
#!/bin/bash
if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF
appify v3.0.1 for Mac OS X - http://mths.be/appify
Creates the simplest possible Mac app from a shell script.
Appify takes a shell script as its first argument:
`basename "$0"` my-script.sh
inoremap <silent> <Bar> <Bar><Esc>:call <SID>align()<CR>a
function! s:align()
let p = '^\s*|\s.*\s|\s*$'
if exists(':Tabularize') && getline('.') =~# '^\s*|' && (getline(line('.')-1) =~# p || getline(line('.')+1) =~# p)
let column = strlen(substitute(getline('.')[0:col('.')],'[^|]','','g'))
let position = strlen(matchstr(getline('.')[0:col('.')],'.*|\s*\zs.*'))
Tabularize/|/l1
normal! 0
call search(repeat('[^|]*|',column).'\s\{-\}'.repeat('.',position),'ce',line('.'))
@kusnier
kusnier / README.md
Created September 30, 2012 12:31 — forked from agnoster/README.md
My ZSH Theme

agnoster.zsh-theme

A ZSH theme optimized for people who use:

  • Solarized
  • Git
  • Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)

For Mac users, I highly recommend iTerm 2 + Solarized Dark

@kusnier
kusnier / Menlo-ForPowerline.ttc.zip
Created September 15, 2012 12:49 — forked from sjl/Menlo-ForPowerline.ttc.zip
Patched Menlo for Powerline. This one includes the bold, italic, etc variants.