Skip to content

Instantly share code, notes, and snippets.

View smellman's full-sized avatar

Taro Matsuzawa aka. btm smellman

View GitHub Profile
@smellman
smellman / gist:3803a106b2acec2b69015066981a32a5
Created April 13, 2024 12:12
linux benchmark 2024/04/13-2
❯ ./diskspd -Zr -b1M -d5 -o8 -t1 -W0 -Sd -w100 -L ./SEQ1M_Q8T1.dat
Command Line: ./diskspd -Zr -b1M -d5 -o8 -t1 -W0 -Sd -w100 -L ./SEQ1M_Q8T1.dat
System info:
processor count: 16
caching options: fua=0
Input parameters:
@smellman
smellman / gist:0f96989282317086afcea8b428cb3943
Created April 13, 2024 12:10
linux benchmark 2024/04/13-1
❯ ./diskspd -c1G -Zr -b1M -d5 -o8 -t1 -W0 -Sd -w0 -L ./SEQ1M_Q8T1.dat
Command Line: ./diskspd -c1G -Zr -b1M -d5 -o8 -t1 -W0 -Sd -w0 -L ./SEQ1M_Q8T1.dat
System info:
processor count: 16
caching options: fua=0
Input parameters:
@smellman
smellman / poly2bbox.py
Created December 3, 2016 09:55
Get BBOX value from poly file
import re
def parse(input_file):
f = open(input_file)
lines = f.readlines()
f.close()
longitudes = []
latitudes = []
for line in lines:
r = re.match("\s+([\w\.\+]+)\s+([\w\.\+]+)", line)
@smellman
smellman / my_postgre.conf
Last active September 20, 2023 22:47
OpenMapTiles 差分アップデート
listen_addresses = '*'
# Tuning at: https://pgtune.leopard.in.ua/
# DB Version: 9.6
# OS Type: linux
# DB Type: dw
# Total Memory (RAM): 16 GB
# CPUs num: 20
# Connections num: 100
# Hard drive type: ssd
@smellman
smellman / geojson_to_epsg3857.rb
Created August 8, 2023 10:54
GeoJSON (FeatureCollection) to EPSG:3857
#!/usr/bin/env ruby
# frozen_string_literal: true
require 'rgeo'
require 'rgeo/geo_json'
require 'rgeo/proj4'
require 'optparse'
OptionParser.new do |opts|
opts.banner = 'Usage: geojson_to_epsg3857.rb [options]'
<!DOCTYPE html>
<html>
<head>
<link href='https://unpkg.com/maplibre-gl@3.0.0/dist/maplibre-gl.css' rel='stylesheet' />
<link
href="https://www.unpkg.com/@watergis/maplibre-gl-legend@latest/dist/maplibre-gl-legend.css"
rel="stylesheet"
/>
<title>WIP</title>
<script src='https://unpkg.com/maplibre-gl@3.0.0/dist/maplibre-gl.js'></script>

SRTM Contour to vector tile

Download SRTM Contour from OpenDEM Project

#!/bin/bash

urls=urls.txt
base_url=http://opendemdata.info/data/srtm_contour
for y in `seq -w 0 85`;
@smellman
smellman / osm_mapbox_gl_example.json
Last active August 30, 2022 19:22
Mapbox GL Style example using OpenStreetMap tile server
{
"version": 8,
"name": "Raster Tiles",
"glyphs": "https://smellman.github.io/creating_tiles_with_global_map_support_files/2015/mapbox_vector_tile_demo/demosites/fonts/{fontstack}/{range}.pbf",
"sprite": "https://smellman.github.io/creating_tiles_with_global_map_support_files/2015/mapbox_vector_tile_demo/demosites/maki-sprites/sprite",
"sources": {
"osm": {
"type": "raster",
"tiles": [
"https://a.tile.openstreetmap.org/{z}/{x}/{y}.png",
#!/bin/bash
ALL_TEXT=all.txt
URL="https://pointcloud.pref.shizuoka.jp/lasmap/ankenmapsrc?request=MarkerSet&Xmax=139.493408203125&Xmin=137.27279663085938&Ymax=35.52775582793653&Ymin=34.42163771567672"
BASE_URL="https://pointcloud.pref.shizuoka.jp/lasmap/ankendetail?ankenno="
RESULT=result.txt
wget -O $ALL_TEXT $URL
records=(`cat $ALL_TEXT | tr -s '?' ' '`)
for record in "${records[@]}"; do
@smellman
smellman / Dockerfile
Created December 16, 2020 05:52
Potree 1.7 Dockerfile
FROM ubuntu:bionic
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends g++-8 git build-essential cmake make ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# gcc-8 is required for new c++17 headers used in Potree Converter
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 800 --slave /usr/bin/g++ g++ /usr/bin/g++-8
RUN mkdir /data