Skip to content

Instantly share code, notes, and snippets.

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

Sylvain POULAIN kikislater

🏄‍♂️
View GitHub Profile
@kikislater
kikislater / comment.sh
Last active January 22, 2020 06:47 — forked from haisum/script.sh
comment and uncomment lines in bash script via sed
sed -i '/<pattern>/s/^/#/g' file #comment
sed -i.bak '/argtypes/s/^/#/' file #comment and backup
sed -i '/<pattern>/s/^#//g' file #uncomment
@kikislater
kikislater / better_surfline.js
Created October 14, 2020 05:02 — forked from samtay/better_surfline.js
Reveal more forecast data
// ==UserScript==
// @name Free Surfline Forecasts
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Unblurr restricted forecast data. They are dumb enough to actually put the real data in the DOM.
// @author samtay
// @match http*://www.surfline.com/*
// @grant none
// ==/UserScript==
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 / 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.
@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 / 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 / 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 / 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