Skip to content

Instantly share code, notes, and snippets.

View neogeogre's full-sized avatar
:electron:
Still alive

Geoffrey Vincent neogeogre

:electron:
Still alive
View GitHub Profile
@neogeogre
neogeogre / matrix_interp.py
Created May 26, 2020 08:51
two dimentional interpolation in matrix values
from scipy.interpolate import interp2d
def matrix_interp():
mat = numpy.array([[70.45, 0, 21.78, 0],
[0, 0, 0, 0],
[105.12, 0, 1000.45, 0],
[0, 0, 0, 0]])
ix = numpy.where(mat != 0)
Install globally a lib with cmake to make it avaiable for C++ project
Easiest way to add a lib to c++ project.
Download source code under `Downloads`:
```sh
cd /home/geoffrey/Downloads/mylib
cmake -DBUILD_SHARED_LIBS=ON .
make install
```
@neogeogre
neogeogre / docker.sh
Last active July 20, 2023 11:40
Docker samples, install without sudo and remove root to generated files
sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io
sudo docker run hello-world
docker pull osgeo/gdal:ubuntu-full-3.1.2
@neogeogre
neogeogre / createFeatureCollection.kt
Last active November 24, 2021 17:11
Sample to create read a geotools FeatureCollection with properties in java / kotlin
package demo
import org.geotools.feature.DefaultFeatureCollection
import org.geotools.feature.simple.SimpleFeatureBuilder
import org.geotools.feature.simple.SimpleFeatureTypeBuilder
import org.geotools.referencing.crs.DefaultGeographicCRS.WGS84
import org.locationtech.jts.geom.Coordinate
import org.locationtech.jts.geom.GeometryFactory
import org.locationtech.jts.geom.Point
@neogeogre
neogeogre / basicKtor.kt
Last active November 24, 2021 22:55
ktor http rest client usage sample in kotlin
import io.ktor.client.*
import io.ktor.client.engine.cio.*
import io.ktor.client.features.*
import io.ktor.client.features.auth.*
import io.ktor.client.features.auth.providers.*
import io.ktor.client.features.json.*
import io.ktor.client.features.logging.*
import io.ktor.client.request.*
import io.ktor.http.*
import io.ktor.http.ContentType.Application.Json
@neogeogre
neogeogre / coroutine.kt
Created November 2, 2021 20:10
wait the end of multiple coroutine
import kotlinx.coroutines.Dispatchers.Default
import kotlinx.coroutines.joinAll
import kotlinx.coroutines.launch
import kotlinx.coroutines.runBlocking
import mu.KotlinLogging
import java.lang.Thread.sleep
private val logger = KotlinLogging.logger {}
fun main() {
@neogeogre
neogeogre / gdal_allign_on_gcp.sh
Last active September 13, 2022 19:40
run gdal and qgis only with docker
gdal_edit.py \
-gcp 10590 5452 -47.6504744 -20.7733625 \ # assign a gcp order is : pix_x pix_y lon lat
-gcp 8120 2911 -47.6513638 -20.7725031 \
-gcp 13985 5237 -47.6492496 -20.7732887 \
-gcp 13352 9067 -47.6494754 -20.7745861 \
-gcp 6626 7356 -47.6518992 -20.7740086 \
orthomosaic.tif # Set GCP pixels and according geographic coordinates
gdalwarp -tps -r bilinear orthomosaic.tif orthomosaic2.tif # do the transfo using the preassigned GCPs
@neogeogre
neogeogre / docker-compose-confluence.yml
Last active November 24, 2021 07:52
Confluence and redmine local instance
version: '3'
services:
confluence:
image: idalko/atlassian-confluence
environment:
- DISABLE_NOTIFICATIONS=TRUE
- CONF_ARGS=-Datlassian.plugins.enable.wait=300
volumes:
@neogeogre
neogeogre / superUser.sh
Last active January 23, 2023 14:11
linux commands
sudo chown -R $(id -u):$(id -g) ~/Desktop/
sudo chown -R $USER:$USER .
sudo chmod a+rwx myFile.sh
# 10 biggest files
du -a -h /path | sort -h -r | head -n 10
ls -1Rhs | sed -e "s/^ *//" | grep "^[0-9]" | sort -hr | head -n20
# See which PID/service is using a certain IP and port:
sudo netstat -nlpt |grep 3306
@neogeogre
neogeogre / windows-image-viewer.reg
Last active December 7, 2021 10:28
restore windows image viewer
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Applications\photoviewer.dll]
[HKEY_CLASSES_ROOT\Applications\photoviewer.dll\shell]
[HKEY_CLASSES_ROOT\Applications\photoviewer.dll\shell\open]
"MuiVerb"="@photoviewer.dll,-3043"
[HKEY_CLASSES_ROOT\Applications\photoviewer.dll\shell\open\command]
@=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,\
00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,72,00,75,00,\
6e,00,64,00,6c,00,6c,00,33,00,32,00,2e,00,65,00,78,00,65,00,20,00,22,00,25,\
00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,46,00,69,00,6c,00,65,00,73,00,\