Skip to content

Instantly share code, notes, and snippets.

View DubiousCactus's full-sized avatar

Théo Morales DubiousCactus

View GitHub Profile
@DubiousCactus
DubiousCactus / merge_yolo_datasets.py
Created July 20, 2020 10:31
Merge a list of YOLO datasets into one, and optionally split it into training & validation sets with a given percentage.
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2020 Théo Morales <theo.morales.fr@gmail.com>
#
"""
Merge several yolo datasets into one, while removing all images
without annotations.
@DubiousCactus
DubiousCactus / deploy.sh
Last active December 4, 2018 13:58
Deploy a (code) folder over SSH either to a specified IP, or by parsing the leases of dnsmasq.
#!/usr/bin/env bash
############A############### DESCRIPTION ###############################
# This script deploys a folder (recursively) to an IP address given as #
# argument, or, if none, to the DHCP leases. #
# #
# DEPENDENCIES: sshpass, scp #
########################################################################
@DubiousCactus
DubiousCactus / 01-usbblockdown.rules
Created January 21, 2018 22:52
UDEV simple USB firewall/whitelist
#Script by Adrian Crenshaw
#With info from Michael Miller, Inaky Perez-Gonzalez and VMWare
#By default, disable it.
#ACTION=="add", SUBSYSTEMS=="usb", RUN+="/bin/sh -c 'echo 0 >/sys$DEVPATH/authorized'"
ACTION=="add", SUBSYSTEMS=="usb", RUN+="/bin/sh -c 'for host in /sys/bus/usb/devices/usb*; do echo 0 > $host/authorized_default; done'"
#Enable hub devices. There may be a better way than this.
ACTION=="add", ATTR{bDeviceClass}=="09", RUN+="/bin/sh -c 'echo 1 >/sys$DEVPATH/authorized'"