Skip to content

Instantly share code, notes, and snippets.

View kikislater's full-sized avatar
🏄‍♂️

Sylvain POULAIN kikislater

🏄‍♂️
View GitHub Profile
@kikislater
kikislater / tlp.conf
Last active October 3, 2024 02:19
TLP for Lenovo Thinkpad P14s Gen 5 AMD (Works with T14 Gen 5 as well)
################################################################################
########### 2024 July 03 - TLP P14s Gen 5 AMD by Sylvain POULAIN ###############
################################################################################
# Content of /etc/tlp.d/tlp.conf for P14s Gen 5 AMD
# (Also works with T14 Gen 5 : same hardware, same motherboard)
################################################################################
# Complete harware list => https://linux-hardware.org/?probe=1c547a828f
################################################################################
# /!\ For better performance use "acpi.ec_no_wakeup=1" in Kernel option
# https://patchwork.kernel.org/project/linux-acpi/patch/ZnFYpWHJ5Ml724Nv@ohnotp/
@kikislater
kikislater / huawei_e8372_config.md
Created January 9, 2024 13:35 — forked from aayubkh/huawei_e8372_config.md
Huawei E8372 Linux Configuration and Setup

Dependencies

  1. usb_modeswitch, usb_modeswitch-data
  2. libusb1
  3. libusb-devel(Fedora), libusb-dev(Debian based)

Configuration

By default, your linux box would register your Huawei E8372 as a Mass Storage device and not (somehow) as a modem. First, make sure you have the exace same device we're talking about. This can be confirmed by looking at 2 values. Give the following command (while the dongle is plugged in):

    sudo su
    lsusb | grep Huawei
@kikislater
kikislater / sms-to-telegram.md
Created January 9, 2024 13:34 — forked from ethaniel/sms-to-telegram.md
HOWTO: Receive SMS via 4G/LTE Huawei stick on Raspberry Pi 4 and forward them via Telegram

HOWTO: Receive SMS via 4G/LTE Huawei stick on Raspberry Pi 4 and forward them via Telegram

I live abroad and have only 1 sim card slot in my phone. It holds the SIM card of the country that I am in right now. But I also have another SIM card from my home country which receives my banking SMS codes. I can't afford to lose the "home" SIM card, so I decided to keep it in my house and forward the SMS messages to my main phone and computer via Telegram (just like Whatsapp, but so much better).

I also made a choice to use a 4G/LTE stick instead of 3G, because the 3G signal in my area is getting worse in worse due to operators upgrading their equipment.

Prerequisites

  1. Raspberry Pi 4
  2. Huawei E8372 (but can be any similar)

Step 1 - Get the Huawei card to work properly with Raspberry

@kikislater
kikislater / camera_calculator.py
Created July 25, 2023 17:37 — forked from luipir/camera_calculator.py
Camera Footprint Calculator
"""
***************************************************************************
camera_calculator.py
---------------------
Date : August 2019
Copyright : (C) 2019 by Luigi Pirelli
Email : luipir at gmail dot com
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
@kikislater
kikislater / CompareCompress.py
Created July 20, 2023 13:02 — forked from jevans5489/CompareCompress.py
Compares lossless GDAL Compression on a sample image.
# ----------------------------------------------------------------------------------------------------------------------
# Name: CompareCompression.py
# Py-Version: 3.x.x
# Purpose: Takes a sample GeoTIFF and writes a table to the command line describing the
# file size, read speed, and write speed of each GDAL compression. You can use this
# tool to decide how to best compress a single image, or a collection of images.
#
# Notes: The Python interpreter and GDAL must be accessible by cmd. The easiest way to do
# this by using the python installation included with ArcGIS Pro 2.3.x and later.
# This installation has the GDAL site package and binaries already configured. Add
@kikislater
kikislater / GTiff_compression_benchmark.py
Created July 20, 2023 13:02 — forked from kr-stn/GTiff_compression_benchmark.py
Benchmark filesize and read/ write times for various GeoTiff compression algorithms
__author__ = 'kersten.clauss'
"""Benchmark different GeoTiff compression algorithms.
Usage: GTiff_compression_benchmark.py some_geo.tif
Requires the GDAL tools to be present and executable from the command line of your system.
This script will take a GeoTiff as input and create copies with different compression algorithms from it.
It measures the filesize, compression and decompression times and returns them as a table.
import numpy as np
import cv2
import glob
import yaml
#import pathlib
# termination criteria
criteria = (cv2.TERM_CRITERIA_EPS + cv2.TERM_CRITERIA_MAX_ITER, 30, 0.001)
# prepare object points, like (0,0,0), (1,0,0), (2,0,0) ....,(6,5,0)
objp = np.zeros((7*7,3), np.float32)
@kikislater
kikislater / davfs2.conf
Last active November 25, 2022 14:24
Webdav configuration for Nextcloud
delay_upload 1
use_locks 0 # Unsupported by Nextcloud
cache_size 1024 # MiByte
gui_optimize 1 #
nodeodm.exe --odm_path c:\ODM
#!/bin/bash
##############################################
# Download du fichier IP de BlockList.de : #
##############################################
# Vérifie que l'on est en Root
if [[ $EUID -ne 0 ]];
then
echo "Ce script doit être exécuté avec les privilèges administrateur"