Skip to content

Instantly share code, notes, and snippets.

@ruisebastiao
ruisebastiao / README.md
Created January 16, 2021 21:20 — forked from taxilian/README.md
Mongodb scripts for incremental backup

Introduction

I can't take credit for much of the work here -- I adapted it from this blog post: https://tech.willhaben.at/mongodb-incremental-backups-dff4c8f54d58

My main contribution was to make it a little easier to use with docker as well as numerous little cleanup tasks. I also made it gzip the oplog backups and added support for SSL connections

Note that I havne't yet tested the point in time restore script; it likely needs work, particularly to make things work with the gzipped oplog files

#!/bin/bash
function initStaticParams
{
MONGODB_SERVER=127.0.0.1
MONOGDB_PORT=27017
MONGODB_USER=
MONGODB_PWD=
OUTPUT_DIRECTORY=/mnt/backups/oplogs
LOG_FILE="/appl/mongo-backup/logs/backup.log"
@ruisebastiao
ruisebastiao / docker-compose.yml
Created October 2, 2020 22:43 — forked from aeimer/docker-compose.yml
Setup OpenVPN with OpenVPN-Monitor and docker-compose
version: "2"
services:
openvpn:
image: kylemanna/openvpn
volumes:
- "./data:/etc/openvpn"
- "/etc/localtime:/etc/localtime:ro"
ports:
- "1194:1194/udp"
expose:
@ruisebastiao
ruisebastiao / 01-README.md
Created June 28, 2020 13:17 — forked from TheJLifeX/00-hand-gesture-recognition.gif
Simple Hand Gesture Recognition Code - Hand tracking - Mediapipe

Simple Hand Gesture Recognition Code - Hand tracking - Mediapipe

Goal of this gist is to recognize ONE, TWO, TREE, FOUR, FIVE, SIX, YEAH, ROCK, SPIDERMAN and OK. We use the LANDMARKS output of the LandmarkLetterboxRemovalCalculator. This output is a landmark list that contains 21 landmark. In the 02-landmarks.jpg picture below you can see the index of each landmark. Each landmark have x, y and z values. But only x, y values are sufficient for our Goal. If you dont want to copy/paste each the code on this gist, you can clone my forked version of mediapipe here: https://github.com/TheJLifeX/mediapipe. I have already commited all code in that repository.

We have five finger states.

  1. thumbIsOpen
@ruisebastiao
ruisebastiao / gist:a84f3d419fba8cba5b7c5b2aa26c953e
Created June 28, 2020 00:33
jetson nano - mediapipe +tensorflow cuda
echo "** Configure and build tensorflow-2.0.0"
export TMP=/tmp
PYTHON_BIN_PATH=$(which python3) \
PYTHON_LIB_PATH=$(python3 -c 'import site; print(site.getsitepackages()[0])') \
TF_CUDA_COMPUTE_CAPABILITIES=${cuda_compute} \
TF_CUDA_VERSION=10.0 \
TF_CUDA_CLANG=0 \
TF_CUDNN_VERSION=7 \
TF_TENSORRT_VERSION=${trt_version} \
CUDA_TOOLKIT_PATH=/usr/local/cuda \
@ruisebastiao
ruisebastiao / tf-rasp.md
Created June 26, 2020 19:50 — forked from EKami/tf-rasp.md
Building TensorFlow for Raspberry Pi: a Step-By-Step Guide

Building TensorFlow 1.3.0-rc1 for Raspberry Pi/Ubuntu 16.04: a Step-By-Step Guide

Here you'll learn how to build Tensorflow for the raspberry pi 3 with either the Python API or as a standalone shared library which can be interfaced from the C++ API and eventually as a library which can be used in other languages.

For the C++ library this tutorial will show you how extract tensorflow library and headers to use in any environment you want.

(This tutorial couldn't be possible without the help of the people from the References section)

What You Need

Set or Get Property from Camera using OpenCV

欲想對視訊操作解析度、白平衡、FPS等可透過VideoCapture.set()實現。

參數

  • CV_CAP_PROP_POS_MSEC 影片播放毫秒
  • CV_CAP_PROP_POS_FRAMES 影片播放幀數
  • CV_CAP_PROP_POS_AVI_RATIO 影片播放百分比
  • CV_CAP_PROP_FRAME_WIDTH 影像解析度(寬)
  • CV_CAP_PROP_FRAME_HEIGHT 影像解析度(高)
@ruisebastiao
ruisebastiao / gist:3f165241263e0bd19cd7093a7dce80cb
Created June 14, 2019 10:37
Get your Private IP Address with the ifconfig Command
ifconfig | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*' | grep -v '127.0.0.1'
-- This is a customization script. It is intended to be used to customize a scene in
-- various ways, mainly when simulation is not running. When simulation is running,
-- do not use customization scripts, but rather child scripts if possible
-- if you wish to execute code contained in an external file instead,
-- use the require-directive, e.g.:
--
-- require 'myExternalFile'
--
-- Above will look for <V-REP executable path>/myExternalFile.lua or
-- This is a customization script. It is intended to be used to customize a scene in
-- various ways, mainly when simulation is not running. When simulation is running,
-- do not use customization scripts, but rather child scripts if possible
-- if you wish to execute code contained in an external file instead,
-- use the require-directive, e.g.:
--
-- require 'myExternalFile'
--
-- Above will look for <V-REP executable path>/myExternalFile.lua or