Skip to content

Instantly share code, notes, and snippets.

View leodc's full-sized avatar

Leonel Castañeda leodc

View GitHub Profile

Keybase proof

I hereby claim:

  • I am leodc on github.
  • I am imleodc (https://keybase.io/imleodc) on keybase.
  • I have a public key ASBUvklYgJR0mE2brxwERmeNnn2Bsz_10KQMrFVWYn6Z1Qo

To claim this, I am signing this object:

# get bin
sudo curl -L "https://github.com/docker/compose/releases/download/1.25.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
# set executable
sudo chmod +x /usr/local/bin/docker-compose
@leodc
leodc / download_csv.conf
Created November 21, 2019 00:17
NGINX config to download files
server {
listen 80;
server_name default_server;
location ~ ^.*/(?P<request_basename>[^/]+\.(csv))$ {
root /www/data/;
add_header Content-Disposition 'attachment; filename="$request_basename"';
}
}
f7da72c9_a10c_4d89_9cc0_8e3e83ce93a6__curva_nivel50_l
eb2327a4_d059_4c53_9832_9251f9708c42__linea_com50_l
78ffe6d6_bfe9_49e5_9e7f_11c9516ccdd5__camino50_l
413900e1_3ea6_4500_bd29_5fc5c33b50e4__calle50_l
d02f3ac7_75ba_4671_9837_4ecb8ee607d0__pozo_explot50_p
a936e80b_8a09_4580_a6e7_d631ecf272a5__linea_com50_l
0f04b76a_4be7_4f82_9fba_764297f73ec9__camino50_l
412f2057_f1c4_46ff_8e15_c701a65059e3__tanque_agua50_p
27ba4211_3dd2_4526_96d5_75e97d8b9acc__edificacion50_p
1afb8e4a_504b_4c59_8902_66f217394d95__carretera50_l
<!DOCTYPE html>
<html>
<head>
<title>Repubikla - rutas</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" type="image/x-icon" href="docs/images/favicon.ico" />
<?xml version="1.0" encoding="UTF-8"?>
<StyledLayerDescriptor version="1.0.0" xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/sld http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd">
<NamedLayer>
<UserStyle>
<Title>Default point</Title>
<Abstract>A sample style that just prints out a 6px wide red square</Abstract>
<FeatureTypeStyle>
<Rule>
<Title>Red square</Title>
@leodc
leodc / conaguaCompilado.py
Last active March 26, 2018 23:40
script para generar compilados de los datos abiertos de conagua: https://datos.gob.mx/busca/dataset/precipitacion-actual-y-acumulada-por-estacion
#!/usr/bin/python3
#coding=utf-8
import json
import time
from xmljson import parker, Parker
from xml.etree.ElementTree import fromstring
from suds.client import Client
@leodc
leodc / addLayersToGeoserver.py
Last active June 26, 2018 16:53
Help script to publish postgis tables to geoserver
#!/usr/bin/python3
import os
import sys
import psycopg2
import subprocess
import urllib.request
import json
POSTGRES_DBNAME = os.getenv("POSTGRES_DBNAME")
#!/bin/bash
# install dependencies
sudo apt install -y apt-transport-https ca-certificates curl software-properties-common
# add repo
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
# update