This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file is part of OpenCV project. | |
// It is subject to the license terms in the LICENSE file found in the top-level directory | |
// of this distribution and at http://opencv.org/license.html | |
// Examples from peopledetect.cpp and from https://learnopencv.com/object-tracking-using-opencv-cpp-python/ | |
#include <opencv2/objdetect.hpp> | |
#include <opencv2/highgui.hpp> | |
#include <opencv2/imgcodecs.hpp> | |
#include <opencv2/imgproc.hpp> | |
#include <opencv2/videoio.hpp> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh -eu | |
# Git fetch git repos in directories recursively | |
usage() | |
{ | |
echo "Usage: $0 <directory>" | |
} | |
if [ -z "${1}" ]; then | |
usage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
An example of webscraping in Python with requests an BeuatifulSoup | |
Scraping lab test data from https://labtestsonline.org.uk/tests-index | |
This script will get a list of the lab tests from the above link and then get | |
more information for each test following the appropriate link. The web page stores | |
the data in Drupal 8. The lab tests are saved in JSON files. | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh -eu | |
# A script to backup a directory | |
usage() { | |
cat << EOF | |
Usage: $(basename "$0") [-d directory] | |
Where: | |
-d The directory to backup. | |
-h This help |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh -eu | |
# A script to mirror a website using wget | |
usage() { | |
cat << EOF | |
Usage: $(basename "$0") [-w website] [-u user_agent] [-b] | |
Where: | |
-w The website to mirror. The website will be like "https://example.com/" | |
-u The User agent to use. If no User agent is specified, | |
a Firefox default one is used. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## https://github.com/github/gitignore/blob/master/Global/Vim.gitignore | |
# Swap | |
[._]*.s[a-v][a-z] | |
!*.svg # comment out if you don't need vector files | |
[._]*.sw[a-p] | |
[._]s[a-rt-v][a-z] | |
[._]ss[a-gi-z] | |
[._]sw[a-p] | |
# Session |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh -eu | |
# shellcheck shell=ash | |
# This script mounts the rootfs partition of a wic.xz image and copy the rootfs | |
# to a directory. The roofs partition is at partition 3. | |
if ! command -v losetup > /dev/null ; then | |
echo "ERROR: losetup is missing" >&2 | |
exit 1 | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create a log for the sessions | |
# Record terminal sessions. | |
# https://unix.stackexchange.com/questions/25639/how-to-automatically-record-all-your-terminal-sessions-with-script-utility | |
# https://www.2daygeek.com/automatically-record-all-users-terminal-sessions-activity-linux-script-command/ | |
# TODO When changing tabs does not keep the directory | |
SESSION_LOGS_DIR="$HOME/.session_logs" | |
if [ ! -d "${SESSION_LOGS_DIR}" ]; then | |
mkdir -p "${SESSION_LOGS_DIR}" | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** @brief Stringify the newline character of a string. | |
* | |
* In detail, the newline character, '\n' is not supported on | |
* json string, so it needs to split in two characters "\n". | |
* | |
* @param [in] src The string to stringify | |
* @return the stringified string on success<br> | |
* NULL otherwise | |
* | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh -ex | |
mkdir -p sysroot | |
PREFIX_DIR=$(readlink -e sysroot) | |
mkdir -p $PREFIX_DIR/include | |
INCLUDE_DIR=$(readlink -e $PREFIX_DIR/include/) | |
mkdir -p $PREFIX_DIR/lib | |
LIB_DIR=$(readlink -e $PREFIX_DIR/lib/) | |
mkdir -p $LIB_DIR/pkgconfig | |
PKG_CONFIG_PATH=$(readlink -e $LIB_DIR/pkgconfig/) |
NewerOlder