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
#!/bin/bash | |
# Create an Iframe index from HLS segmented streams | |
# $1: Filename to be created | |
# $2: Location of segmented ts files | |
# Check how many arguments | |
if [ $# != 2 ]; then | |
echo "Usage: $0 [Input filename] [Location of segmented streams]" | |
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
#!/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
all: get-network-interfaces get-gateway-ip | |
get-network-interfaces: get-network-interfaces.c | |
gcc -o get-network-interfaces -ggdb -O1 -Wall -W -ansi -pedantic -std=gnu99 get-network-interfaces.c | |
get-gateway-ip: get-gateway-ip.c | |
gcc -o get-gateway-ip -ggdb -O1 -Wall -W -ansi -pedantic -std=gnu99 get-gateway-ip.c | |
clean: | |
rm -rf get-network-interfaces |
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
## 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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#define TRUE 1 | |
#define FALSE 0 | |
/*The index Base64 table.*/ | |
static const unsigned char indexBase64Tbl[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; |
NewerOlder