Skip to content

Instantly share code, notes, and snippets.

@arnobroekhof
arnobroekhof / tar2rpm
Last active October 11, 2023 08:34
Script for converting tar.gz files to rpm
#!/bin/bash
ARCH=''
DESCRIPTION=''
GROUP='Applications'
LICENSE='Restricted'
NAME=''
PRINTSPEC=false
RELEASE=$(date +%Y.%m.%d+%S)
SUMMARY=''
@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 / pre-commit
Last active May 9, 2022 13:41
Maven pre commit hook
#!/bin/bash
# save the file as <git_directory>/.git/hooks/pre-commit
echo "Running Maven clean test for errors"
# retrieving current working directory
CWD=`pwd`
MAIN_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# go to main project dir
cd $MAIN_DIR/../../
@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 / sample.java
Created October 19, 2016 21:38
Change kerberos password using java
/*
<dependency>
<groupId>org.apache.directory.server</groupId>
<artifactId>kerberos-client</artifactId>
<version>2.0.0-M20</version>
</dependency>
*/
public static void main(String[] args) {
KdcConfig config = KdcConfig.getDefaultConfig();
@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

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 / models.py
Created May 3, 2015 20:12
PowerDNS Djano Model
# This is an auto-generated Django model module.
# You'll have to do the following manually to clean this up:
# * Rearrange models' order
# * Make sure each model has one field with primary_key=True
# * Remove `managed = False` lines if you wish to allow Django to create, modify, and delete the table
# Feel free to rename the models, but don't rename db_table values or field names.
#
# Also note: You'll have to insert the output of 'django-admin sqlcustom [app_label]'
# into your database.
from __future__ import unicode_literals
@arnobroekhof
arnobroekhof / EmbeddedADS.java
Created September 2, 2013 20:01
Embedded Apache Directory Server
package nl.techop.frontdoor.ldap;
import org.apache.directory.server.core.DefaultDirectoryService;
import org.apache.directory.server.core.DirectoryService;
import org.apache.directory.server.core.entry.ServerEntry;
import org.apache.directory.server.core.partition.Partition;
import org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmIndex;
import org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmPartition;
import org.apache.directory.server.ldap.LdapServer;
import org.apache.directory.server.protocol.shared.transport.TcpTransport;