Skip to content

Instantly share code, notes, and snippets.

View Panthro's full-sized avatar

Rafael Roman Panthro

  • N26
  • Barcelona, Catalonia
View GitHub Profile
@Panthro
Panthro / README.md
Last active March 2, 2021 14:56
Ktlint format that uses maven or gradle
  • Add this to your ~/.bash_profile or ~/.zshrc.
  • Then regardles if the project is setup with maven or gradle when you execute kf the right task is going to be executed
@Panthro
Panthro / rancher-backup.sh
Created May 21, 2019 11:02
Rancher2 backup on Google Drive
#!/bin/bash
#RANCHER_SERVER_NAME=$(docker ps -a --format "{{.Image}} {{.Names}}" | grep -i "rancher/rancher" | cut -d' ' -f2)
RANCHER_SERVER_NAME=rancher-server
TODAY_DATE=$(date +%Y%m%d)
RANCHER_COPY_NAME=rancher-data-${TODAY_DATE}
CREDENTIALS_PATH=~/secrets
BACKUP_PATH=~/backup
RANCHER_BACKUP_FILE_BASE=rancher-data-backup
RANCHER_BACKUP_FILE=${RANCHER_BACKUP_FILE_BASE}-${TODAY_DATE}.tar.gz
USE_GDRIVE=0
@Panthro
Panthro / answers-traefik-helm.yml
Last active March 12, 2019 14:44
traefik-k8s-rancher-helm-config
---
acme:
challengeType: "dns-01"
dnsProvider:
cloudflare:
CLOUDFLARE_API_KEY: <CF_API_KEY>
CLOUDFLARE_EMAIL: EMAIL
name: "cloudflare"
email: EMAIL
enabled: "true"
@Panthro
Panthro / bg-psd2.yaml
Created January 18, 2019 12:03 — forked from amilos/bg-psd2.yaml
Berlin Group PSD2 API specified in Openapi v3 format
openapi: 3.0.1
info:
title: BG PSD2 API
version: "1.2"
description: |
# Summary
The **NextGenPSD2** *Framework Version 1.2* offers a modern, open, harmonised and interoperable set of
Application Programming Interfaces (APIs) as the safest and most efficient way to provide data securely.
The NextGenPSD2 Framework reduces XS2A complexity and costs, addresses the problem of multiple competing standards
in Europe and, aligned with the goals of the Euro Retail Payments Board,
@Panthro
Panthro / Dockerfile
Last active April 16, 2018 11:04
Docker-compose for rancher with java8 and newrelic
FROM openjdk:8-alpine
VOLUME /tmp
RUN apk add --update curl && \
rm -rf /var/cache/apk/*
VOLUME /tmp
ENV SERVER_PORT=8761
EXPOSE 8761
ADD *.jar app.jar
RUN sh -c 'touch /app.jar'
ENV DEFAULT_OPTIONS="-XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -XX:MaxRAMFraction=1"
@Panthro
Panthro / keybase.md
Created August 16, 2016 17:31
keybase.md

Keybase proof

I hereby claim:

  • I am Panthro on github.
  • I am panthro (https://keybase.io/panthro) on keybase.
  • I have a public key whose fingerprint is 21C9 894F ABF4 85BB 6CF0 403A BF9B 8DB7 6559 788C

To claim this, I am signing this object:

location / {
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Max-Age' 1728000;
add_header 'Content-Type' 'text/plain charset=UTF-8';
add_header 'Content-Length' 0;
return 204;
}
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
#
@Panthro
Panthro / jhipster-move-angular-to-admin.sh
Last active September 23, 2016 06:29
Move jhipster dafault angular to admin and enable thymeleaf as view resolver
#Move all content from the root angular app to admin folder
mv src/main/webapp/ src/main/webapp_admin
mkdir -p src/main/webapp/
mv src/main/webapp_admin/ src/main/webapp/admin
#find and replace webapp
#couldnt build a sed command for now, so here's the list of files to change
# modified: .bowerrc
# modified: .gitignore
# modified: Gruntfile.js
apt-get -y update && apt-get -y upgrade && apt-get -y dist-upgrade && apt-get -y autoremove
@Panthro
Panthro / enable-swap.sh
Last active March 14, 2019 15:39
enable swap (4GB) and tweak it for a server
#Allocate the file
fallocate -l 4G /swapfile
#Give right permissions
chmod 600 /swapfile
#make it a swap file
mkswap /swapfile
#turn swap on
swapon /swapfile
#mount it at every boot
echo "/swapfile none swap sw 0 0" >> /etc/fstab