Skip to content

Instantly share code, notes, and snippets.

@johanvdw
johanvdw / drone_sqlite_s3.py
Created April 21, 2021 16:45
Export drone logs from sqlite to S3
# This simple scripts dumps all logs from drone to a format
# compatible with drone s3 storage (cfr https://docs.drone.io/server/reference/drone-s3-bucket/ )
# MIT license - https://opensource.org/licenses/MIT
import sqlite3
conn = sqlite3.connect("drone_database.sqlite")
select_logs(conn)
cur = conn.cursor()
cur.execute("select * FROM logs")
export LD_LIBRARY_PATH=/home/johan/git/gdal/gdal/.libs:$LD_LIBRARY_PATH
export GDAL_DATA=/home/johan/git/gdal/gdal/data
export PATH=$PATH:/home/johan/git/gdal/gdal/apps
@johanvdw
johanvdw / import_c3nav.py
Created January 24, 2018 20:25
Script to import c3nav data (33c3 to 34c3)
import os
import json
import re
from c3nav.mapdata.models import *
from shapely.geometry import shape
from decimal import Decimal
levels={
Applying mapdata.0085_assign_location_level_room...Traceback (most recent call last):
File "/c3nav/env/lib/python3.6/site-packages/django/db/models/fields/related_descriptors.py", line 178, in __get__
rel_obj = getattr(instance, self.cache_name)
AttributeError: 'Space' object has no attribute '_locationslug_ptr_cache'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
- hosts: c3nav
become: yes
tasks:
- name: Install git
apt:
name: git
update_cache: yes
- name: Install header files for different packages
apt:
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@johanvdw
johanvdw / dijle.ipynb
Last active October 5, 2017 07:44
compare calculation dijle
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@johanvdw
johanvdw / classification-method.ipynb
Created September 13, 2017 10:19
Determine best classification method
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@johanvdw
johanvdw / niche_verkenning_stap1.ipynb
Last active September 12, 2017 08:17 — forked from stijnvanhoey/niche_verkenning_stap1.ipynb
Explorative check of the first step of NICHE implementation
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.