Skip to content

Instantly share code, notes, and snippets.

View erick-otenyo's full-sized avatar
🧭
Focusing

Erick Otenyo erick-otenyo

🧭
Focusing
View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@erick-otenyo
erick-otenyo / rsync_backup.py
Created November 4, 2020 13:15 — forked from seebk/rsync_backup.py
Python rsync backup script
#!/usr/bin/python3
#######################################################
# Python rsync Backup script
# Sebastian Kraft, 24.06.2013
#
#######################################################
#-----------------------------------------------------
# Config
@erick-otenyo
erick-otenyo / README.md
Created December 7, 2020 18:22 — forked from mau21mau/README.md
Configure Celery + Supervisor With Django
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@erick-otenyo
erick-otenyo / parse_dotenv.bash
Created January 28, 2021 09:16 — forked from judy2k/parse_dotenv.bash
Parse a .env (dotenv) file directly using BASH
# Pass the env-vars to MYCOMMAND
eval $(egrep -v '^#' .env | xargs) MYCOMMAND
# … or ...
# Export the vars in .env into your shell:
export $(egrep -v '^#' .env | xargs)
@erick-otenyo
erick-otenyo / django_import_shp_zip_to_postgres.py
Last active January 31, 2021 10:12
Import a zipped shapefile to a new postgis table
import pygeoif
import shapefile
from django.db import connection, transaction
from zipfile import ZipFile
from io import BytesIO
def shp_files_sorter(file_name):
"""
:param file_name:
@erick-otenyo
erick-otenyo / .docker-private-registry-with-read-write-control.md
Created April 18, 2021 09:58
Run docker private registry with read/write access control
@erick-otenyo
erick-otenyo / raster-pixels-to-polygons.go
Last active March 30, 2022 10:14
Convert a raster layer to a vector layer, by creating geojson polygon features for each individual pixel's extent in the raster layer. Equivalent to QGIS' Raster pixels to polygons Algorithm
package main
import (
"errors"
"flag"
"math"
"os"
"github.com/lukeroth/gdal"
geojson "github.com/paulmach/go.geojson"
@erick-otenyo
erick-otenyo / index.html
Last active March 3, 2023 09:33 — forked from andrewharvey/index.html
Mapbox GL Draw Rectangle
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title>Mapbox GL Draw Rectangle</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.49.0/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.49.0/mapbox-gl.css' rel='stylesheet' />
<style>
body { margin:0; padding:0; }