Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am arnobroekhof on github.
  • I am arnobroekhof (https://keybase.io/arnobroekhof) on keybase.
  • I have a public key whose fingerprint is 58C4 60AE 365C B6E6 DF8C 7279 FF78 4CE8 3E0C 65D5

To claim this, I am signing this object:

@arnobroekhof
arnobroekhof / distcp-to-s3.sh
Created June 27, 2019 08:47
Copy files from HDFS to s3 using distcp behind a proxy
#!/bin/sh -e
PROXY_HOST="<XXX.XXX.XXX.XXX>"
PROXY_PORT=3128
HDFS_URI=hdfs://<NAMENODE>
HDFS_PATH="/my/data/path"
S3_ACCESS_KEY="<S3_ACCESS_KEY>"
S3_SECRET_KEY="<S3_SECRET_KEY>"
S3_BUCKET="<S3_BUCKET>"
S3_PATH="<PATH_ON_S3>"
@arnobroekhof
arnobroekhof / starbucks.go
Created April 12, 2019 09:50
starbucks.go --> example
package main
import (
"fmt"
"time"
)
type Barista struct {
name string
@arnobroekhof
arnobroekhof / example_s3_bucket_objects.tf
Created July 12, 2018 19:25
Terraform 0.11.x loop through a map and create a s3 bucket with objects with specific content based on a maps --> key, value
## construct a map with object keys and values
variable "object_list" {
type = "map"
default = {
content1 = "this is example content 1",
content2 = "this is example content 2"
}
}
## construct the bucket name
@arnobroekhof
arnobroekhof / example_local_file.tf
Last active September 30, 2020 14:11
Terraform 0.11.x loop through a map and create files with content based on a maps --> key, value
variable "object_list" {
type = "map"
default = {
content1 = "this is example content 1",
content2 = "this is example content 2"
}
}
resource "local_file" "local_files" {
count = "${length(var.object_list)}" # perform this action based on the amount of items in the map
@arnobroekhof
arnobroekhof / docker-compose-influxdb.yml
Created March 1, 2018 12:02
Docker compose file for influxdb and grafana
version: "3.2"
# run script
# docker swarm init
# docker stack deploy timeseries -c docker-compose.yml
services:
influxdb:
image: influxdb:latest
ports:
- 8086:8086
@arnobroekhof
arnobroekhof / ecpclient.py
Created June 30, 2017 19:20
Python saml Ecp client
"""
This simple client uses standard Python modules
along with the Python lxml toolkit from
http://lxml.de/
to demonstrate how a SAML ECP client works.
Studying this client is not an acceptable replacement
for reading the ECP profile [ECP] available at
<code_scheme name="JavaStyle">
<option name="OTHER_INDENT_OPTIONS">
<value>
<option name="INDENT_SIZE" value="4" />
<option name="CONTINUATION_INDENT_SIZE" value="4" />
<option name="TAB_SIZE" value="4" />
<option name="USE_TAB_CHARACTER" value="false" />
<option name="SMART_TABS" value="false" />
<option name="LABEL_INDENT_SIZE" value="0" />
<option name="LABEL_INDENT_ABSOLUTE" value="false" />
@Service
@ExportMetricWriter
public class MetricsGraphiteExport {
@Autowired
private MetricRepository _metricRepository;
@Value("${graphite.server:'localhost'}")
private String graphiteServer;
@Value("${graphite.port:'2003'}")
package TwitterClient
import com.twitter.hbc.ClientBuilder;
import com.twitter.hbc.core.Client;
import com.twitter.hbc.core.Constants;
import com.twitter.hbc.core.Hosts;
import com.twitter.hbc.core.HttpHosts;
import com.twitter.hbc.core.endpoint.StatusesFilterEndpoint;
import com.twitter.hbc.core.processor.StringDelimitedProcessor;
import com.twitter.hbc.httpclient.auth.Authentication;