Skip to content

Instantly share code, notes, and snippets.

@DerSchimi
DerSchimi / gist:681349209dafadd37a73
Created November 19, 2014 15:56
Groovy reading spock feature methods
private void checkAllMethods(Class c){
def testmethods = c.methods.findAll {it.getName().startsWith('$spock_feature')}
println "methods: " +testmethods*.getName()
testmethods.each {
Method m = it;
m.getAnnotations().each {
println it
}
}
1. download ojdbc7.jar (http://bugmenot.com/view/oracle.com)
2. script oracle.groovy:
def host = "host"
def port = "1521"
def db = "dbname"
def url = "jdbc:oracle:thin:@"+host+":"+port+":"+db
def username = "username"
def password = "password"
@GrabConfig(systemClassLoader=true)
@Grab("com.gmongo:gmongo:1.0")
import com.gmongo.GMongo
def host = "host"
def port = "port"
def dbName = "dbname"
def gmongo = new GMongo("${host}:${port}")
def db = gmongo.getDB(dbName)
@Grab(group='org.apache.solr', module='solr-solrj', version='4.5.0')
import org.apache.solr.client.solrj.impl.HttpSolrServer
import org.apache.solr.common.SolrInputDocument
import org.apache.solr.common.SolrDocument;
import org.apache.solr.client.solrj.SolrQuery;
import org.apache.solr.client.solrj.response.QueryResponse;
import org.apache.solr.common.SolrDocumentList;
import org.apache.solr.client.solrj.util.ClientUtils;
import org.apache.solr.client.solrj.response.UpdateResponse;
@DerSchimi
DerSchimi / gist:bf6ce23cb3372c3a21c85aa77a507bf2
Created September 4, 2017 15:05
geb basic authentication
1. use a profile for tests, eg:
ChromeOptions options = new ChromeOptions();
options.addArguments("user-data-dir=C:/Users/user_name/AppData/Local/Google/Chrome/User Data");
options.addArguments("--start-maximized");
2. use multipass extension and add host credentials:
https://chrome.google.com/webstore/detail/multipass-for-http-basic/enhldmjbphoeibbpdhmjkchohnidgnah
3. test stuff :)
@DerSchimi
DerSchimi / aws_website_monitor.py
Last active September 12, 2023 05:47
AWS Website Monitor
import json
import requests
import boto3
import os
bucketname='webcrawlertempdata'
urltocheck='https://www.google.com'
s3bucketsrn='arn:aws:sns:eu-central-1:783377464316:WebsiteTracker'