Skip to content

Instantly share code, notes, and snippets.

# Script Name: powerssh
# Version: 1.0.0 (24. June, 2014)
# Author: Sveinn Steinarsson
# Description: Use Powershell to connect to a remote server via SSH and run a shell script/command
# Prerequisite:
# plink.exe in script path (http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html)
# Examples:
# With key file (*.ppk) and script file
@siggibjarna
siggibjarna / TSV-Icelandic-Groovy.tsv.groovy
Created October 21, 2016 11:23
DataGrip extractor to copy tab separated query results to paste into Excel with comma decimal separator
SEPARATOR = "\t"
QUOTE = "\""
NEWLINE = System.getProperty("line.separator")
def record(values, valueToString) {
values.eachWithIndex { value, idx ->
def str = valueToString(value)
def q = str.contains(SEPARATOR) || str.contains(QUOTE) || str.contains(NEWLINE)
def n = str.isNumber()
OUT.append(q ? QUOTE : "")