Skip to content

Instantly share code, notes, and snippets.

View marklit's full-sized avatar

Mark Litwintschik marklit

View GitHub Profile
@marklit
marklit / hls.py
Last active June 3, 2023 15:40
Video Stream Generator
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
Please see https://tech.marksblogg.com/streaming-video-hls.html for more details on this script.
MIT License
Copyright (c) 2023 Mark Litwintschik
Permission is hereby granted, free of charge, to any person obtaining a copy
@marklit
marklit / error.md
Last active December 6, 2022 10:57
BigQuery WKB reading error
$ vi test.csv
0101000020777F0000B0BFEC9E3C3C52C0A8CFD556ECA74440
0101000020777F0000982A1895D43D53C0100BB5A6796F4340
0101000020777F000038B4C876BE3B53C0F05A423EE8714340
0101000020777F0000842F4CA60A3E53C058423EE8D96C4340
0101000020777F000094F6065F986C56C0D05D4BC8077D4140
@marklit
marklit / run.py
Created August 26, 2021 19:47
prettymaps CLI
import vsketch
from prettymaps import *
import matplotlib.font_manager as fm
from matplotlib import pyplot as plt
import click
@click.command()
@click.option('--location', default='Old Town, Tallinn')
@click.option('--radius', default=1000, type=int)
@marklit
marklit / cmd.sh
Last active November 16, 2017 23:00
World Map in ANSI
wget https://eol.jsc.nasa.gov/videos/crewearthobservationsvideos/World_map_blank_small.png
convert World_map_blank_small.png World_map_blank_small.jpg
jp2a --colors --term-fit -i World_map_blank_small.jpg | sed -r 's/[XM]/ /g'

Keybase proof

I hereby claim:

  • I am marklit on github.
  • I am marklit (https://keybase.io/marklit) on keybase.
  • I have a public key ASARIRAX9pGFl6YOQvWpSrl-DusmWqCP_cFNr002Z29pEwo

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am marklit on github.
  • I am marklit (https://keybase.io/marklit) on keybase.
  • I have a public key ASARIRAX9pGFl6YOQvWpSrl-DusmWqCP_cFNr002Z29pEwo

To claim this, I am signing this object:

@marklit
marklit / install.sh
Last active November 24, 2021 13:26
Bot Detection Script. Works with Apache and Nginx Log Files.
sudo apt-get update
sudo apt-get install \
python-dev \
python-pip \
python-virtualenv
virtualenv findbots
source findbots/bin/activate
curl -O http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz
@marklit
marklit / _run.sh
Created February 25, 2017 19:51
CommonCrawl / AWS EMR / MRJob
git clone https://github.com/Smerity/cc-mrjob.git ~/cc-mrjob && cd ~/cc-mrjob
pip install -r requirements.txt
pip install awscli
aws configure
curl -O https://commoncrawl.s3.amazonaws.com/crawl-data/CC-MAIN-2017-04/wat.paths.gz
gunzip wat.paths.gz
python server_analysis.py \
-r emr \
--conf-path mrjob.conf \
- Inexplicable perversity of human nature.
- The clever machinations of MongoDB's marketing people.
- The AGPL license killed it.
- We spent too long development before monetizing.
- Bad performance.
- Numeric types limited to a 64-bit `float`.
- Great product, but didn't/couldn't translate to revenue.
- Bad business model.
- Failure in timezones/timestamp nuances.
@marklit
marklit / deep fizz buzz.md
Created September 24, 2016 13:58
Perfectly predicted Fizz buzz

See GitHub for the source code and TensorFlow on a GTX 1080 for installation notes.

$ python fizz_buzz.py \
    --hidden_units 500 \
    --iterations 4000 \
    --learning_rate 0.04