Skip to content

Instantly share code, notes, and snippets.

View kiwiroy's full-sized avatar
🥝
Nom

Roy Storey kiwiroy

🥝
Nom
View GitHub Profile
@umberto10
umberto10 / kc_device_code_flow.sh
Last active September 8, 2022 14:45
Simple keycloak device code flow example with PKCE written in bash with jq, curl and openssl (optional)
#!/usr/bin/bash
CLIENT_ID="" # client id
REALM="" # realm name
KC_URL="" # keycloak url
# PKCE works from keycloak version 17.0.0+
code_verifier=$(openssl rand -hex 96)
code_challenge=$(echo -n "${code_verifier}" | sha256sum | cut -d ' ' -f 1 | xxd -r -p | basenc --base64url | tr -d '=')
#!/usr/bin/env perl
use strict;
use warnings;
use App::cpm::CLI;
use File::Spec;
use Carton::CPANfile;
use Carton::Snapshot;
@s1037989
s1037989 / README.md
Last active January 9, 2024 00:37
ip-discover: Setup a device for discovery on a network using socat

ip-discover

Setup a device for discovery on a network using socat

On the device to be discovered:

  • Copy ip-discovery to /usr/bin and run chmod +x /usr/bin/ip-discovery
  • Copy ip-discovery.service to /etc/systemd/system, adjust the code-word, and run sudo systemctl daemon-reload && sudo systemctl start ip-discovery

On the device wanting to discover the device to be discovered:

  • Copy ip-discover to your home folder and run . ~/ip-discover

SCN-App-Distify

A perl distribution builder for ServerCentral perl projects.

To build a module named SCN-Module-Foo ...

cd SCN-Module-Foo
distify SCN-Module-Foo
@Ovid
Ovid / cor.md
Last active September 12, 2021 08:02
Cor—A minimal object system for the Perl core

NAME

Cor — A minimal OO proposal for the Perl core

VERSION

This is version 0.10 of this document.

AUTHOR

@fskale
fskale / s3-backup.pl
Last active September 4, 2019 10:18
S3 incremental Backup using Mojolicious Non-Blocking I/O (concurrent) (Check Script for required modules) supports Amazon and Hitachi S3 storages (no warranty !)
#!/usr/bin/env perl
package S3::Backup;
use Mojo::Base -base;
use Carp qw(carp croak);
use POSIX qw(strftime ceil floor);
use Fcntl qw(O_WRONLY O_APPEND O_CREAT);
use Fcntl ':mode';
#set utf8 output encoding explicitly
binmode( STDOUT, ":encoding(utf8)" );
@bonzini
bonzini / exec-hook.c
Created August 10, 2017 12:26
An LD_PRELOAD library that waits for a given binary to be exec-ed, and forces it under a gdbserver
/* Copyright (C) 2012-2017 by László Nagy
Copyright (C) 2017 Paolo Bonzini
This file is based on Bear.
It is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

Technical details for https://stackoverflow.com/a/44169445/6730571

Details of investigation:

On a base system, /usr/bin/java is a symlink that points to /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java, which is an Apple wrapper tool that locates and executes the actual java.

(Do not touch anything in those 2 system directories. It should actually be impossible due to "System Integrity Protection" anyway.)

If you don't have Java installed, attempting to execute java will open a dialog that invites you to install it.

@hurrellit
hurrellit / router.conf
Created September 22, 2016 10:26
EdgeRouter Config
firewall {
all-ping enable
broadcast-ping disable
ipv6-receive-redirects disable
ipv6-src-route disable
ip-src-route disable
log-martians enable
name WAN_IN {
default-action drop
description "WAN to internal"
@zg
zg / freebsd-qemu-xhyve-mac-os-x-virtual-machine.md
Last active June 24, 2024 02:16
Create FreeBSD virtual machine using qemu. Run the VM using xhyve.

TL;DR

  • Create 10GB FreeBSD image using QEMU.
  • Run the VM using xhyve.
  • Mount host directory.
  • Resize the image.

Requisites