Skip to content

Instantly share code, notes, and snippets.

View Ameausoone's full-sized avatar

Antoine Méausoone Ameausoone

View GitHub Profile
#!/usr/bin/env bash
# Check if there is some delete actions in plan, and apply it if not
# In Docker image :
# FROM hashicorp/terraform:0.12.9
# RUN apk add jq
set -eo pipefail
#!/bin/bash
# to run this script just run this with root
# curl -sfL https://gist.github.com/Ameausoone/748ed00a3365405dda2c2d7db7493036/raw/install-k8s-single-node-ubuntu.sh | sh -
set -eux pipefail
# Install Docker CE
## Set up the repository:
### Install packages to allow apt to use a repository over HTTPS
$ terraformer --version
version v0.7.2
$ terraformer import google list
addresses
autoscalers
backendBuckets
backendServices
bigQuery
cloudFunctions
cloudsql
@Ameausoone
Ameausoone / Makefile
Created February 18, 2019 09:17
goal to display help from documentation
help: ## print this message
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-10s\033[0m\t%s\n", $$1, $$2}'
example: ## helm after '##' to automatically print help for a goal
echo "example"
@Ameausoone
Ameausoone / mongodb-ssl.sh
Created April 25, 2018 08:41 — forked from kevinadi/mongodb-ssl.sh
Script to create self-signed CA certificates, server certificates, and client certificates for testing MongoDB with SSL
#!/bin/sh
# Generate self signed root CA cert
openssl req -nodes -x509 -newkey rsa:2048 -keyout ca.key -out ca.crt -subj "/C=AU/ST=NSW/L=Sydney/O=MongoDB/OU=root/CN=`hostname -f`/emailAddress=kevinadi@mongodb.com"
# Generate server cert to be signed
openssl req -nodes -newkey rsa:2048 -keyout server.key -out server.csr -subj "/C=AU/ST=NSW/L=Sydney/O=MongoDB/OU=server/CN=`hostname -f`/emailAddress=kevinadi@mongodb.com"
# Sign the server cert
@Ameausoone
Ameausoone / DateTransformation.java
Created October 31, 2017 13:29
Java Date transformation java8 java.util.Date
public java.util.Date fromAAAAMMDDStringTojava_util_Date_withJava8(){
Stirng dateStr = "20171031";
TemporalAccessor temporalAccessor = java.time.format.DateTimeFormatter.BASIC_ISO_DATE.parse(dateStr);
LocalDate localDate = java.time.LocalDate.from(temporalAccessor);
return Date.from(localDate.atStartOfDay(systemDefault()).toInstant());
}
@Ameausoone
Ameausoone / gist:52b8266b953771778b3f3b711d1059d0
Created October 24, 2017 16:09
Script à ajouter dans .bashrc qui permet de se connecter sur une série de machines, directement en shell.
# Copy list of servers in ~/.servers
function refresh_server_list
{
for ip in $(seq 1 254) ; do nslookup 10.1.2.$ip | grep 'name =' | cut -d ' ' -f 3 | cut -d . -f 1 >> ~/.servers_tmp ; done
mv ~/.servers_tmp ~/.servers
}
(refresh_server_list)
if [ -f ~/.servers ] ; then
<profile>
<id>init-db</id>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>sql-maven-plugin</artifactId>
<version>1.5</version>
<dependencies>
<dependency>
@Ameausoone
Ameausoone / h2 starting
Last active October 14, 2019 12:30
exec-maven-plugin for start H2 database
<profiles>
<profile>
<id>start-h2</id>
<dependencies>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>1.3.162</version>
</dependency>
</dependencies>