Skip to content

Instantly share code, notes, and snippets.

View jmigueldelgado's full-sized avatar

José Miguel Delgado jmigueldelgado

  • UP42 GmbH
  • Berlin
View GitHub Profile
@jmigueldelgado
jmigueldelgado / run_nohup.sh
Last active November 26, 2020 11:08
nohup: run background bash script
### saving output to log file
nohup /path/to/your/script.sh > /path/to/your/log.file 2>&1 &
@jmigueldelgado
jmigueldelgado / tar_untar.sh
Last active September 11, 2017 08:44
tar.gz files in terminal
## create tar.gz file
tar -zcvf tar-archive-name.tar.gz source-folder-name
## unpack tar.gz file
tar -zxvf tar-archive-name.tar.gz

Keybase proof

I hereby claim:

  • I am jmigueldelgado on github.
  • I am jmigueldelgado (https://keybase.io/jmigueldelgado) on keybase.
  • I have a public key ASD1WNIMHZFWDgJVlnanjIrcm6l9HJMPuhRvHkFUx1Gfmgo

To claim this, I am signing this object:

@jmigueldelgado
jmigueldelgado / sed_in_place.sh
Last active February 21, 2019 10:07
replace string in line
sed -i 's/old/new/g' path/to/file
@jmigueldelgado
jmigueldelgado / get_incoming_IPs.sh
Created February 21, 2019 10:04
log incoming IP addresses
# for port 80 (standard port for http)
netstat -tn 2>/dev/null | grep :80 | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -nr | head
# for all ports
netstat -vatn
@jmigueldelgado
jmigueldelgado / create_mock_product.py
Last active May 30, 2022 13:03
Helper script to create an archive with mocked raster and vector files and real XML files out of a DIMAP or similar satellite imagery product
from pathlib import Path
import zipfile
import os
import datetime
import rasterio
from rasterio.io import MemoryFile
import numpy
def create_mock_product(product_path: Path, collection_name: str, product_configuration: str, keep_tifs: bool=True):
local_path = (Path.cwd() / Path(__file__).parent).resolve() / collection_name / product_configuration
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.