Skip to content

Instantly share code, notes, and snippets.

View dkerkow's full-sized avatar

Daniel Kerkow dkerkow

View GitHub Profile
@springmeyer
springmeyer / install-tilemill-latest.sh
Last active April 7, 2022 20:00
install bleeding edge tilemill, nodejs, and mapnik
# First, clear out any old mapnik or node.js installs that might conflict
sudo apt-get purge libmapnik libmapnik-dev mapnik-utils nodejs
# Also clear out any old ppa's that might conflict
sudo rm /etc/apt/sources.list.d/*mapnik*
sudo rm /etc/apt/sources.list.d/*developmentseed*
sudo rm /etc/apt/sources.list.d/*chris-lea*
# add new ppa's
echo 'yes' | sudo apt-add-repository ppa:chris-lea/node.js
@catawbasam
catawbasam / pandas_dbms.py
Last active May 26, 2024 05:32
Python PANDAS : load and save Dataframes to sqlite, MySQL, Oracle, Postgres
# -*- coding: utf-8 -*-
"""
LICENSE: BSD (same as pandas)
example use of pandas with oracle mysql postgresql sqlite
- updated 9/18/2012 with better column name handling; couple of bug fixes.
- used ~20 times for various ETL jobs. Mostly MySQL, but some Oracle.
to do:
save/restore index (how to check table existence? just do select count(*)?),
finish odbc,
@Stanback
Stanback / nginx.conf
Last active June 14, 2024 10:21 — forked from michiel/cors-nginx.conf
Example Nginx configuration for adding cross-origin resource sharing (CORS) support to reverse proxied APIs
#
# CORS header support
#
# One way to use this is by placing it into a file called "cors_support"
# under your Nginx configuration directory and placing the following
# statement inside your **location** block(s):
#
# include cors_support;
#
# As of Nginx 1.7.5, add_header supports an "always" parameter which
@themiurgo
themiurgo / merge-geojsons.py
Last active September 11, 2022 12:41 — forked from migurski/merge-geojsons.py
Merge two or more geojson files.
#!/usr/bin/env python
from json import load, JSONEncoder
from argparse import ArgumentParser, FileType
from re import compile
import sys
float_pat = compile(r'^-?\d+\.\d+(e-?\d+)?$')
charfloat_pat = compile(r'^[\[,\,]-?\d+\.\d+(e-?\d+)?$')
#! /bin/bash
# Convert Landsat 8 GeoTIFF images into RGB pan-sharpened JPEGs.
#
# Requirements:
# * gdal http://www.mapbox.com/tilemill/docs/guides/gdal/
# * convert (image-magick)
#
# Reference info:
# http://www.mapbox.com/blog/putting-landsat-8-bands-to-work/
@Tronde
Tronde / deploy-blog-playbook.yml
Created March 30, 2018 14:44
Bei diesem Playbook handelt es sich um die tasks/main.yml-Datei, mit deren Hilfe ich meinen Wordpress-Blog auf einem neuen Ubuntu-Server wiederherstelle. Auch wenn der Blog damit erfolgreich ausgebracht werden konnte, kann es sicher noch etwas Feinschliff vertragen.
---
- name: Check for nginx, php-fpm and mysql-server
apt:
name: "{{ item }}"
state: present
with_items:
- nginx
- php-fpm
- mysql-server
- python-mysqldb
@kgjenkins
kgjenkins / README.md
Last active November 30, 2022 09:38
QGIS Python to automatically update layer from data source

The following Python code will, every 30 seconds, automatically update the data from the source for any QGIS layer with 'autoUpdate' in the layer name. Each time it updates, it will put the timestamp in the layer name, although you could leave that part out.

This is particularly useful for remote data sources like json-over-http or even local CSV files that might be changed by another program while the QGIS project is open.

Just paste the code into the QGIS Python console.

import threading
import datetime
@mschmitt
mschmitt / day-night-detection.cron
Last active October 7, 2021 09:44 — forked from webghostx/day-night-detection.py
day/night detection for cron jobs
# Run every minute and do things IF NOT night.
* * * * * (is_night || do_things) >/dev/null 2>&1
# Run every hour and do things IF night.
0 * * * * (is_night && do_things) >/dev/null 2>&1