Skip to content

Instantly share code, notes, and snippets.

Avatar

Ruggero Marchei rmarchei

View GitHub Profile
@rmarchei
rmarchei / route53.py
Last active Aug 27, 2020
route53 hook for dehydrated - python2 / python3 + boto2 version. Tested on Ubuntu 16.04
View route53.py
#!/usr/bin/env python
# How to use:
#
# Ubuntu 16.04: apt install -y python-boto OR apt install -y python3-boto
#
# Specify the default profile on aws/boto profile files or use the optional AWS_PROFILE env var:
# AWS_PROFILE=example ./dehydrated -c -d example.com -t dns-01 -k /etc/dehydrated/hooks/route53.py
#
# Manually specify hosted zone:
@rmarchei
rmarchei / SolrExporter.groovy
Last active Nov 12, 2016 — forked from ndpar/SolrExporter.groovy
Export documents from Solr core to XML format
View SolrExporter.groovy
#!/usr/bin/env groovy
/**
* Usage: ./SolrExporter.groovy query url [url]
*
* ./SolrExporter.groovy "id:12345" "http://your.solr.host:8983/solr/core/"
*
* ./SolrExporter.groovy "id:12345" "http://old.solr.host:8983/solr/core/" "http://new.solr.host:8983/solr/core/"
*
*
@rmarchei
rmarchei / 99-vagrant.rules
Last active Feb 17, 2017
Ubuntu Xenial on Vagrant: workaround for 'Medium access timeout failure. Offlining disk!'
View 99-vagrant.rules
ACTION=="add", SUBSYSTEM=="scsi" , ATTR{type}=="0|7|14", \
RUN+="/bin/sh -c 'echo 180 > /sys$$DEVPATH/timeout'"
@rmarchei
rmarchei / is_public.rb
Created Jun 17, 2016
Test if an IP is public
View is_public.rb
def is_public?(ip)
["127.0.0.0/8", "192.168.0.0/16", "172.16.0.0/12", "10.0.0.0/8"].map { |net| (IPAddr.new net).include?(IPAddr.new ip) }.none?
end
@rmarchei
rmarchei / import_certs.sh
Created Jun 8, 2016
Import Let's Encrypt certs to JDK
View import_certs.sh
#!/bin/bash
set -e
STOREPASS=changeit
BACKUP=false
function usage {
echo "Usage: $0 [-h] [-b] [-s password] /path/to/java/home"
echo " -h: show usage"
echo " -b: backup keystore file"
You can’t perform that action at this time.