Skip to content

Instantly share code, notes, and snippets.

@talaj
talaj / luks.md
Last active May 19, 2022 23:01
Accessing an encrypted full disc image (LUKS;LVM)
xrandr --output HDMI-1 --mode 1920x1080 --same-as eDP-1
@talaj
talaj / readme
Created September 16, 2019 19:32
ffmpeg
ffmpeg -i k00_d.avi -c:v libx265 -crf 28 -c:a aac -b:a 128k -vf bwdif=1:-1:0 output.mp4
@talaj
talaj / 3.0.20.rst
Created August 10, 2018 14:28
api/mapnik/3.0.20.rst

3.0.20

Style

image-filters

@talaj
talaj / spherical-mercator.lisp
Created January 4, 2018 09:10
Envelope of a tile in Spherical Mercator
(defconstant EARTH_RADIUS 6378137.0)
(defconstant HALF_OF_EQUATOR (* PI EARTH_RADIUS))
(defun tile-size (zoom) (/ (* 2 HALF_OF_EQUATOR) (expt 2 zoom)))
(defun tile-envelope (x y z)
(let ((size (tile-size z)))
(list
(+ (- HALF_OF_EQUATOR) (* x size))
(- (+ HALF_OF_EQUATOR) (* (+ y 1) size))
@talaj
talaj / rev-list
Created January 2, 2018 09:18
git - get object hash
git rev-list --abbrev-commit --max-count=1 HEAD -- plugins/input/csv/
@talaj
talaj / libtiff-fork-test.cpp
Last active December 5, 2017 13:20
libtiff fork test
#include <tiffio.h>
#include <unistd.h>
#include <iostream>
#include <memory>
int main()
{
const char * dem = "/home/tlj/sandbox/world_robin_611m_ocean_hss20.tif";
@talaj
talaj / test.py
Last active August 17, 2017 12:49
python async mvt
import mapnik
m=mapnik.Map(256,256)
mapnik.load_map(m, 'style.xml')
t = mapnik.create_mvt_merc(m, 75528, 47928, 17, style_level_filter=True, threading_mode=mapnik.threading_mode.async)
m.layers[-1].datasource.params()['max_size']
@talaj
talaj / gdal-test.cpp
Last active July 28, 2017 10:58
gdal-test
#include <memory>
#include <iostream>
#include <gdal/gdal_priv.h>
main()
{
GDALAllRegister();
const char * dem = "/home/talaj/dev/gdal-leak/world_aster2_srtmgl1_gmerc_38m_dfs40a.tif";
@talaj
talaj / svg2png
Created June 29, 2017 12:07
svg2png
inkscape -z -e zvonice.png -w 128 zvonice.svg