Skip to content

Instantly share code, notes, and snippets.

View kerm1t's full-sized avatar
💭
starting up

kerm1t

💭
starting up
View GitHub Profile
@kerm1t
kerm1t / merge-pdf-ghostscript.md
Created August 16, 2025 10:10 — forked from brenopolanski/merge-pdf-ghostscript.md
Merge multiple PDFs using Ghostscript

A simple Ghostscript command to merge two PDFs in a single file is shown below:

gs -dNOPAUSE -sDEVICE=pdfwrite -sOUTPUTFILE=combine.pdf -dBATCH 1.pdf 2.pdf

Install Ghostscript:

Type the command sudo apt-get install ghostscript to download and install the ghostscript package and all of the packages it depends on.

@kerm1t
kerm1t / how to setup Eigen with CMake
Last active May 18, 2025 08:48
how to setup Eigen with CMake
(1) Linux
(2) Windows
- a) download Eigen
- b) build Eigen -> cmake .. --> msbuild .\Eigen3.sln
- c) now add Eigen
i) to CMakeLists
# You have to set these variables as Windows environment variables:
# EIGEN3_INCLUDE_DIR <- %EIGEN3_ROOT%
# EIGEN3_DIR <- %EIGEN3_ROOT%\cmake
#
@kerm1t
kerm1t / git new repo
Created March 3, 2025 05:41
git new repo
now with 2 facotor authentification it is more challenging to checkin (on a new laptop)
using ssh is more easy, as you can create a public and private key and upload the pub key to github
(1) ssh-keygen -t ed25519 -C "[email protected]"
(2) got to ~/home/.ssh and open the pub key (there is 2 keys, private and public)
(3) copy and paste the pub key to github settings
(4) done
@kerm1t
kerm1t / github repo init
Created March 3, 2025 05:11
github repo init
…or create a new repository on the command line
echo "# ecal_2ros" >> README.md
git init
git add README.md
git commit -m "first commit"
git branch -M main
git remote add origin https://github.com/kerm1t/ecal_2ros.git
git push -u origin main
@kerm1t
kerm1t / muPDF Hello world
Created October 4, 2024 14:35
muPDF - minimal Hello world example, without any checks void first_pdf_smallified(int argc, char** argv)
// minimal muPDF Hello world example, without any checks
void first_pdf_smallified(int argc, char** argv)
{
fz_context* ctx;
fz_document_writer* wri;
ctx = fz_new_context(NULL, NULL, FZ_STORE_UNLIMITED);
fz_register_document_handlers(ctx);
char path[255] = ".\\test.pdf";
@kerm1t
kerm1t / run_python_script_in_conda_env.bat
Created April 1, 2024 06:23 — forked from maximlt/run_python_script_in_conda_env.bat
Run a Python script in a conda environment from a batch file
@echo OFF
rem How to run a Python script in a given conda environment from a batch file.
rem It doesn't require:
rem - conda to be in the PATH
rem - cmd.exe to be initialized with conda init
rem Define here the path to your conda installation
set CONDAPATH=C:\ProgramData\Miniconda3
rem Define here the name of the environment
@kerm1t
kerm1t / ffmpg
Created January 8, 2024 13:56
ffmpeg
C:\winapp\ffmpeg-master-latest-win64-gpl\bin\ffmpeg -r 1 -start_number 4696 -i IMG_%04d.JPG -c:v libx264 -vf format=yuv420p out.mp4
@kerm1t
kerm1t / Tucows visualize jpg + lane annotations
Created May 16, 2023 08:32
Tucows visualize jpg + lane annotations
# -*- coding: utf-8 -*-
"""
Spyder Editor
This is a temporary script file.
"""
import matplotlib.pyplot as plt
import numpy as np
from PIL import Image
@kerm1t
kerm1t / ransac_polyfit.py
Created May 16, 2023 08:30 — forked from geohot/ransac_polyfit.py
RANSAC polyfit. Fit polynomials with RANSAC in Python
def ransac_polyfit(x, y, order=3, n=20, k=100, t=0.1, d=100, f=0.8):
# Thanks https://en.wikipedia.org/wiki/Random_sample_consensus
# n – minimum number of data points required to fit the model
# k – maximum number of iterations allowed in the algorithm
# t – threshold value to determine when a data point fits a model
# d – number of close data points required to assert that a model fits well to data
# f – fraction of close data points required
besterr = np.inf
@kerm1t
kerm1t / Sqlite build with C++
Created December 27, 2022 17:28
Sqlite build with C++
How to build SQLite3 .lib file on Windows 10
Download source from source (https://www.sqlite.org/download.html)
For example: source https://www.sqlite.org/2022/sqlite-amalgamation-3390300.zip
Download binary from binary
For example: binary https://www.sqlite.org/2022/sqlite-dll-win64-x64-3390300.zip
Extract both archives to the same directory