Skip to content

Instantly share code, notes, and snippets.

View zepinto's full-sized avatar

Jose Pinto zepinto

View GitHub Profile
@zepinto
zepinto / autokeras.ipynb
Created October 26, 2020 01:18
AutoKeras.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@zepinto
zepinto / ReachableCache.java
Created June 4, 2020 13:56
Check if an host is reachable (Java)
import java.net.InetAddress;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.concurrent.*;
/**
* This class is used to check if a remote peer is reachable
*/
public class ReachableCache {
@zepinto
zepinto / dune-mingw.sh
Last active May 21, 2020 15:53
Bash script for compiling DUNE for windows under debian
#!/bin/bash
sudo apt-get update && apt-get install curl git mingw-w64 cmake make nsis
mkdir -p dune/build
git clone --depth=1 https://github.com/LSTS/dune.git dune/source
cd dune/build
curl https://gist.githubusercontent.com/zepinto/dbbe84fa4ca6e7f59954adabc5bc3dcc/raw/1eeb0cd156ed63498bda525d8de5bb0ff764654b/mingw-w64-x86_64.cmake > mingw-w64-toolchain.cmake
cmake -DCMAKE_TOOLCHAIN_FILE=mingw-w64-toolchain.cmake ../source && make package -j8
@zepinto
zepinto / mingw-w64-x86_64.cmake
Last active May 21, 2020 15:35 — forked from peterspackman/mingw-w64-x86_64.cmake
cmake toolchain file for mingw-w64 x86_64 builds on Ubuntu
# Sample toolchain file for creating Windows installer.
#
# Typical usage:
# 1) install cross compiler and packager: `sudo apt-get install mingw-w64 nsis`
# 2) cd <path/to/build/folder>
# 3) cmake -DCMAKE_TOOLCHAIN_FILE=~/mingw-w64-x86_64.cmake <path/to/source/folder>
# 4) make -j<cores>
# 5) make package
set(CMAKE_SYSTEM_NAME Windows)
@zepinto
zepinto / endurance.bash
Last active May 12, 2022 09:39
Start Endurance Simulation
#!/bin/bash
WORKSPACE_DIR=~/workspace
DUNE_DIR=$WORKSPACE_DIR/dune/build
IMC4J_DIR=$WORKSPACE_DIR/imc4j
NEPTUS_DIR=$WORKSPACE_DIR/neptus
# Stop DUNE if already running
while pgrep -x "dune" > /dev/null; do
killall dune
@zepinto
zepinto / ManeuverTimes.java
Created February 21, 2017 14:00
Print starting times of maneuvers inside plans.
package pt.lsts.imc.lsf.batch;
import pt.lsts.imc.IMCDefinition;
import pt.lsts.imc.PlanControlState;
import pt.lsts.imc.PlanControlState.STATE;
import pt.lsts.imc.lsf.UnserializedMessage;
public class ManeuverTimes {
public static void main(String[] args) throws Exception {
@zepinto
zepinto / convert360.bash
Last active April 2, 2019 16:06
Bash script for depolarizing video for AMKOV AMK100s 360 camera
#!/bin/bash
if [ $# -le 0 ]
then
echo "Usage: ./script.bash <video_file>"
exit 1
fi
echo "Extracting matadata"
ffmpeg32 -i "$1" -f ffmetadata metadata.txt
@zepinto
zepinto / KmlImporter.java
Created April 20, 2015 13:54
Translating KML placemarks into Neptus plans
/*
* This class uses KML loading code available from
* http://labs.micromata.de/projects/jak/download.html
*/
package pt.lsts.neptus.plugins.kml;
import java.io.File;
import java.util.List;
import pt.lsts.neptus.mp.ManeuverLocation;
@zepinto
zepinto / lsf2.groovy
Created January 17, 2015 17:17
Groovy script that extracts CTD data from LSF and prints out the result as CSV
import pt.lsts.imc.*
import pt.lsts.imc.lsf.*
import pt.lsts.util.WGS84Utilities
// Obtain an LSF index object
idx = new LsfIndex(new File("/path/to/Data.lsf"))
// Create a scanner
scanner = new IndexScanner(idx);
@zepinto
zepinto / lsf1.groovy
Created January 17, 2015 16:58
Parsing LSF files in Groovy
import pt.lsts.imc.EstimatedState
import pt.lsts.imc.lsf.LsfIndex
import pt.lsts.util.WGS84Utilities;
// Create an LSF index object
idx = new LsfIndex(new File("/path/to/Data.lsf"))
// Get all recorded states with minimum separation of 1000 milliseconds
idx.getIterator(EstimatedState.class, (long)1000).each {
// Print to the screen the location parsed from the state