Skip to content

Instantly share code, notes, and snippets.

@dazzag24
dazzag24 / gist:2dcf3c9a3afceb78e44248ee61aad218
Created March 31, 2020 19:44
Find out which packages are taking up the most space you can use the following command
dpkg-query -Wf '${Installed-Size}\t${Package}\n' | sort -n
@dazzag24
dazzag24 / README.TXT
Created March 23, 2020 21:14
influxdb-2.0.0-beta docker command
mkdir $HOME/influxdbv2
docker run -p 9999:9999 --name influxdb --restart=unless-stopped -v $HOME/influxdbv2:/root/.influxdbv2 quay.io/influxdb/influxdb:2.0.0-beta --reporting-disabled
# -*- coding: utf-8 -*-
# https://stackoverflow.com/questions/47113813/using-pyarrow-how-do-you-append-to-parquet-file
# Create a virtualenv or pipenv with pyarrow installed
import pyarrow as pa
import pyarrow.parquet as pq
def append_to_parquet_table(ii, filepath=None, writer=None):
filename = f"/home/user/files/2020-01-09T{ii:02}_00_00Z_PT1H.parquet"
print("Merging: {}".format(filename))
table = pq.read_table(filename)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import requests
from requests.packages.urllib3.util.retry import Retry
from requests.adapters import HTTPAdapter
s = requests.Session()
# https://urllib3.readthedocs.io/en/latest/reference/urllib3.util.html
# backoff_factor (float) –
# A backoff factor to apply between attempts after the second try (most errors are resolved immediately
# by a second try without a delay). urllib3 will sleep for:
@dazzag24
dazzag24 / osm_render_gps_waypoints.py
Created January 30, 2019 20:30
Rendering GPS traces from OSM
import requests
import xml.etree.ElementTree as ET
from PIL import Image
import numpy as np
# Area format is left, bottom, right, top
#AREA = [-1.4853, 53.3730, -1.4557, 53.3893]
AREA = [0.0422, 52.1648, 0.2204, 52.2532]
WIDTH = 1280
@dazzag24
dazzag24 / app.py
Created November 18, 2018 19:44 — forked from mneedham/app.py
Mapping Strava runs using Leaflet and Open Street Map
from flask import Flask
from flask import render_template
import csv
import json
app = Flask(__name__)
@app.route('/')
def my_runs():
runs = []