Skip to content

Instantly share code, notes, and snippets.

View flaviocarmo's full-sized avatar
🖖
Boldly going

Flávio Carmo flaviocarmo

🖖
Boldly going
View GitHub Profile
@flaviocarmo
flaviocarmo / printing_python_qgis.py
Created October 25, 2016 21:07 — forked from alexanno/printing_python_qgis.py
Printing with Python and QGIS
#http://kartoza.com/how-to-create-a-qgis-pdf-report-with-a-few-lines-of-python/
# coding=utf-8
# A simple demonstration of to generate a PDF using a QGIS project
# and a QGIS layout template.
#
# This code is public domain, use if for any purpose you see fit.
# Tim Sutton 2015
@flaviocarmo
flaviocarmo / notes.md
Created September 5, 2018 18:29 — forked from matthewjberger/notes.md
How to make an electron app using Create-React-App and Electron with Electron-Builder.
@flaviocarmo
flaviocarmo / export_db_structure.sh
Created September 13, 2019 20:46 — forked from dantheman213/export_db_structure.sh
Batch backup and export your Postgres or PostgreSQL table schemas and stored functions or procedures into individual *.sql files --the easy way!
#!/bin/sh
# AUTHOR
# DANIEL E. GILLESPIE (2016)
# https://github.com/dantheman213
# DESCRIPTION
# Export your app's table schemas and stored functions from a PostgreSQL
# database into individual *.sql files for easy management and source control.
@flaviocarmo
flaviocarmo / script.sh
Created September 13, 2019 20:47 — forked from vielhuber/script.sh
PostgreSQL: Backup and restore pg_dump with password on command line #sql
# best practice: linux
nano ~/.pgpass
*:5432:*:username:password
chmod 0600 ~/.pgpass
# best practice: windows
edit %APPDATA%\postgresql\pgpass.conf
*:5432:*:username:password
# linux
@flaviocarmo
flaviocarmo / vpnclient
Created October 11, 2019 13:03 — forked from legokichi/vpnclient
softether vpn client for ubuntu /etc/init.d/vpnclient
#! /bin/sh
### BEGIN INIT INFO
# Provides: vpnclient
# Required-Start: $all
# Required-Stop: $network $local_fs $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start VPN Client at boot time
# chkconfig: 345 44 56
# description: Start VPN Client at boot time.
@flaviocarmo
flaviocarmo / nginx-alertmanager-prometheus
Created February 11, 2020 21:56 — forked from albertogviana/nginx-alertmanager-prometheus
Nginx reverse proxy for Prometheus and Alertmanager
upstream @prometheus {
server MY_IP:9090;
}
upstream @alertmanager {
server MY_IP:9093;
}
server {
listen 80;
@flaviocarmo
flaviocarmo / setupiisforsslperfectforwardsecrecy_v17.ps1
Created February 19, 2020 16:00 — forked from jbratu/setupiisforsslperfectforwardsecrecy_v17.ps1
Great powershell script for tightening HTTPS security on IIS and disabling insecure protocols and ciphers. Very useful on core installations.
# Copyright 2019, Alexander Hass
# https://www.hass.de/content/setup-microsoft-windows-or-iis-ssl-perfect-forward-secrecy-and-tls-12
#
# After running this script the computer only supports:
# - TLS 1.2
#
# Version 3.0.1, see CHANGELOG.txt for changes.
Write-Host 'Configuring IIS with SSL/TLS Deployment Best Practices...'
Write-Host '--------------------------------------------------------------------------------'
@flaviocarmo
flaviocarmo / Jenkinsfile
Created March 3, 2020 20:35 — forked from mrhockeymonkey/Jenkinsfile
Jenkins pipeline running a remote ansible playbook
#!groovy
pipeline {
agent any
//These params will be displayed for user input when running a build, They are also accepted by the API
parameters {
string(name: 'BUILD_HOSTNAME', description: 'The name of the server to build (from Mdb)')
string(name: 'ILO_IP', description: 'The IP address for the server ilo')
booleanParam(name: 'skipOneView', description: 'Skip the OneView stage?', defaultValue: false)
@flaviocarmo
flaviocarmo / Jenkinsfile
Created March 3, 2020 21:03 — forked from jonico/Jenkinsfile
Example for a full blown Jenkins pipeline script with multiple stages, kubernetes templates, shared volumes, input steps, injected credentials, heroku deploy, sonarqube and artifactory integration, Docker containers, multiple Git commit statuses, PR merge vs branch build detection, REST API calls to GitHub deployment API, stage timeouts, stage c…
#!groovy
import groovy.json.JsonOutput
import groovy.json.JsonSlurper
def label = "mypod-${UUID.randomUUID().toString()}"
podTemplate(label: label, yaml: """
spec:
containers:
- name: mvn
image: maven:3.3.9-jdk-8-alpine
@flaviocarmo
flaviocarmo / geoserver-install.sh
Created May 8, 2020 14:45
GeoServer 2.16 Ubuntu 19.04 Postgresql 12, Postgis 3
#
apt-get install openjdk-8-jre
# PostgreSQL and PostGIS
apt-get install postgresql postgresql-contrib postgis postgresql-12-postgis-3
# Create "geoserver" database
sudo -u postgres createuser -P geoserver
sudo -u postgres createdb -O geoserver geoserver
sudo -u postgres psql -c "CREATE EXTENSION postgis; CREATE EXTENSION postgis_topology;" geoserver