Skip to content

Instantly share code, notes, and snippets.

@hugot
hugot / route-to-ip.bash
Created April 30, 2022 13:00
Make a linux system act as a NAT router for another node
#!/bin/bash
if [[ $# -ne 1 ]]; then
echo 'Usage: '"$0"' IP_ADDRESS' >&2
exit 1
fi
ip="$1"
set -x
@hugot
hugot / tree
Last active April 20, 2018 12:26
Little script to build software using basher as dependency manager
#!/bin/bash
##
# Build software with basher.
read -rd '' HELP <<'EOF'
tree - Build software from custom build scripts, into a directory tree of your choosing.
USAGE: tree COMMAND [ AUTHOR/REPO ] [ OPTIONS ]
COMMANDS:
new : Initialize a new tree project. Respects --dir argument if given.
#!/bin/bash
##
# print a SIT banner to a terminal :)
printStuff() {
while read -r line; do
for ((i = 0; i < ${#line}; i++)) ; do
sleep 0.01
echo -n "${line:$i:1}"
done
#! /usr/bin/env bash
#
# replaceslash.sh
# Copyright (C) 2017 hugo <hugo@supersudomachine>
#
# Distributed under terms of the MIT license.
#
[ -f NClass.build ] || (
echo failed to find the build file, execute this script in the root of the NClass project && exit 1
package nl.hva.dmci.ict.se.datastructures.fibonacci;
import java.math.BigInteger;
import java.util.function.Consumer;
import edu.princeton.cs.algs4.Stopwatch;
public class FastFibonacci {
static double timeStart;
// cmd: cat dikkie.json | POST -sS "http://127.0.0.1:5984/dikkie/_bulk_docs" -c "application/json"
{
"docs": [
{
"Voornaam": "Sander",
"id": 7064,
"Achternaam": "Lauridsen",
"Geboortedatum": "1-nov-76",
"Straat": "Taylorweg 70",
"Postcode": "5466AE",
@hugot
hugot / cloudSettings
Created June 3, 2017 21:04
Visual Studio Code Settings Sync Gist
{"lastUpload":"2017-06-03T21:04:31.484Z","extensionVersion":"v2.8.1"}
@hugot
hugot / cloudSettings
Created June 3, 2017 20:54
Visual Studio Code Settings Sync Gist
{"lastUpload":"2017-06-03T20:54:54.028Z","extensionVersion":"v2.8.1"}
#!/usr/bin/env bash
#
# image_sorter.sh
# Copyright (C) 2017 Hugo
#
# Distributed under terms of the MIT license.
#
# This script will sort the image and video files from an android phone by date by placing them in directories
# according to the dates that can be extracted from the filename. The filenames of the images must be structured
# as follows: yyyymmdd_HHMMSS.jpg or yyyymmdd_HHMMSS.mp4 (other extentions can be added easily)
#!/usr/bin/env perl
# This is a short script to play rock paper scissors
use strict;
use warnings;
my @rps = qw(rock paper scissors);
my %weakness = (rock => "paper", paper => "scissors", scissors => "rock");
my $score = 0;
my $npcscore = 0;