Skip to content

Instantly share code, notes, and snippets.

@MaxPeal
MaxPeal / README.md
Created May 11, 2019 18:09 — forked from dragon788/README.md
How to permalink to a gist's raw file

Problem: When linking to the raw version of a gist, the link changes with each revision.

Solution:

To return the first file from a gist: https://gist.github.com/[gist_user]/[gist_id]/raw/

To get a file from multi–file gist: https://gist.github.com/[gist_user]/[gist_id]/raw/[file_name]

@MaxPeal
MaxPeal / codesign.sh
Created June 28, 2022 07:56 — forked from vszakats/codesign.sh
Code-signing PE executables using OpenSSL, osslsigncode (and more)
#!/bin/sh
# To the extent possible under law, Viktor Szakats (vsz.me)
# has waived all copyright and related or neighboring rights to this
# script.
# CC0 - https://creativecommons.org/publicdomain/zero/1.0/
# This script will create a self-signed root certificate, along with a code
# signing certificate in various formats, trying to use the best available
# crypto/practice all along. Then, it will create a test executable and code
@MaxPeal
MaxPeal / .gitattributes
Created March 14, 2022 16:39 — forked from mezcel/.gitattributes
Tiny Core Linux Notes
## win10 line endins
*.bat eol=crlf
*.ps1 eol=crlf
## Linux/Posix line endins
*.go eol=lf
*.sh eol=lf
*.source eol=lf
Makefile eol=lf
@MaxPeal
MaxPeal / Dockerfile
Last active February 24, 2022 10:14 — forked from avishayp/Dockerfile
Add non-root user for alpine linux
# non root user example for alpine
#
# usage:
# $ docker build --build-arg "USER=someuser" --tag test .
# $ docker run --rm test
# or
# docker run --user default --rm -it alpine:latest
# docker run --user nobody --rm -it alpine:latest
FROM alpine
@MaxPeal
MaxPeal / tasmota-configure.sh
Created January 31, 2022 16:44 — forked from ixs/tasmota-configure.sh
Tasmota mass configuration
#!/bin/bash
#
# Do initial configuration of a SP111 plug on your local wifi
#
# Licensed under the GPLv3+
#
TEMPLATE='{"NAME":"SP111 v1.1","GPIO":[56,0,158,0,132,134,0,0,131,17,0,21,0],"FLAG":0,"BASE":45}'
function uriencode {
@MaxPeal
MaxPeal / docker-compose.yml
Last active October 15, 2021 13:05 — forked from pyrou/docker-compose.yml
Use https://traefik.me SSL certificates for local HTTPS without having to touch your /etc/hosts or your certificate CA.
version: '3'
services:
traefik:
restart: unless-stopped
#image: traefik:v2.0.2
image: traefik:v2.2
depends_on:
- "wait"
ports:
- "80:80"
@MaxPeal
MaxPeal / ssh-deploy-key-wrapper.sh
Created October 5, 2021 07:23 — forked from mpdude/ssh-deploy-key-wrapper.sh
Wrapper around `ssh` to pick the right one from several GitHub deploy keys
#!/bin/bash
# The last argument is the command to be executed on the remote end, which is something
# like "git-upload-pack 'webfactory/ssh-agent.git'". We need the repo path only, so we
# loop over this last argument to get the last part of if.
for last in ${!#}; do :; done
# Don't use "exec" to run "ssh" below; then the trap won't work.
key_file=$(mktemp -u)
trap "rm -f $key_file" EXIT
@MaxPeal
MaxPeal / dhcpd.conf
Last active March 22, 2021 08:03 — forked from robinsmidsrod/dhcpd.conf
Trying to chainload iPXE with full feature set from a lesser featured one, whilst still being able to boot non-supported cards with UNDI
ddns-update-style none;
deny bootp; #default
authoritative;
include "/etc/dhcp/ipxe-option-space.conf";
# GREEN
subnet 10.1.1.0 netmask 255.255.255.0 {
range 10.1.1.100 10.1.1.199;
option subnet-mask 255.255.255.0;
@MaxPeal
MaxPeal / multi-arch-docker-ci.sh
Last active September 28, 2020 11:47 — forked from ArturKlauser/multi-arch-docker-ci.sh
Building Multi-Architecture Docker Images With Buildx
#!/bin/bash
# (c) Artur.Klauser@computer.org
#
# This script installs support for building multi-architecture docker images
# with docker buildx on CI/CD pipelines like Github Actions or Travis. It is
# assumed that you start of with a fresh VM every time you run this and have to
# install everything necessary to support 'docker buildx build' from scratch.
#
# Example usage in Travis stage:
#
@MaxPeal
MaxPeal / check-qemu-binfmt.sh
Last active September 28, 2020 11:46 — forked from ArturKlauser/check-qemu-binfmt.sh
Building Multi-Architecture Docker Images With Buildx
#!/bin/bash
# (c) Artur.Klauser@computer.org
#
# This script checks if all software requirements are met in a Linux environment
# in order to use 'docker buildx' to build multi-architecture images.
# For more information see:
# https://nexus.eddiesinentropy.net/2020/01/12/Building-Multi-architecture-Docker-Images-With-Buildx/
set -vx