This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env groovy | |
import java.nio.charset.StandardCharsets | |
String text = "" | |
if ( this.args.size() > 0 ) { | |
text = this.args[0] | |
} | |
else { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env groovy | |
import java.nio.charset.StandardCharsets | |
import org.apache.commons.cli.Option | |
def cli = new CliBuilder( usage:"${this.getClass().getName()} --u <username> -p <password>" ) | |
cli.with { | |
u( longOpt: 'user', 'username', args: 1, required: true ) | |
p( longOpt: 'password', 'password', args: 1, required: true ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env groovy | |
def year = 2018 | |
Calendar.metaClass.yearMonthDay { | |
delegate.format("yyyy-MM-dd") | |
} | |
Calendar.metaClass.weekDay { | |
delegate.format("EEEE") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Defaults / Configuration options for homebridge | |
# The following settings tells homebridge where to find the config.json file and where to persist the data (i.e. pairing and others) | |
HOMEBRIDGE_OPTS=-U /var/lib/homebridge | |
# If you uncomment the following line, homebridge will log more | |
# You can display this via systemd's journalctl: journalctl -f -u homebridge | |
# DEBUG=* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env groovy | |
import java.util.zip.ZipFile | |
def printelnerr = System.err.&println | |
def appName = this.getClass().getName() | |
def cli = new CliBuilder( usage:"${appName} --basedir <path_to_dir> --intersectdir <path_to_dir> " ) | |
cli.with { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env groovy | |
import groovy.io.FileType | |
import java.net.URL | |
import java.net.URLClassLoader | |
import java.nio.file.Paths | |
import java.security.CodeSource | |
import java.security.ProtectionDomain | |
def printelnerr = System.err.&println |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env groovy | |
import static groovy.json.JsonOutput.prettyPrint | |
println prettyPrint( new URL ("http://fw.ota.homesmart.ikea.net/feed/version_info.json").getText() ) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env groovy | |
import groovy.io.FileType | |
def printelnerr = System.err.&println | |
def appName = this.getClass().getName() | |
def cli = new CliBuilder( usage:"${appName} --basedir <path_to_dir> --intersectdir <path_to_dir> " ) | |
cli.with { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env groovy | |
@Grapes([ | |
@Grab(group='org.apache.poi', module='poi', version='3.16'), | |
@Grab(group='net.sf.opencsv', module='opencsv', version='2.3') | |
]) | |
import org.apache.poi.hssf.usermodel.HSSFWorkbook; | |
import org.apache.poi.hssf.usermodel.HSSFSheet; | |
import org.apache.poi.hssf.usermodel.HSSFRow; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env groovy | |
import javax.crypto.SecretKeyFactory | |
import javax.crypto.SecretKey | |
import javax.crypto.Cipher | |
import javax.crypto.spec.PBEParameterSpec | |
import javax.crypto.spec.PBEKeySpec | |
import java.util.Base64 | |
import java.util.Base64.Decoder | |
import static java.nio.charset.StandardCharsets.UTF_8 |