Skip to content

Instantly share code, notes, and snippets.

View efrecon's full-sized avatar

Emmanuel Frecon efrecon

View GitHub Profile
@kovachwt
kovachwt / letsencrypt-acme-ps-script.ps1
Last active June 6, 2023 09:15
Let’s Encrypt for Windows and IIS, using the ACME-PS powershell module
import-module 'ACME-PS'
# This is an updated Let's Encrypt script using the ACME-PS module https://github.com/PKISharp/ACME-PS
# The original script (using ACMESharp) is by Marc Durdin https://marc.durdin.net/2017/02/lets-encrypt-on-windows-redux/
# This directory is used to store your account key and service directory urls as well as orders and related data
$acmeStateDir = "C:\Certs\AcmeState";
#
@strongjz
strongjz / docker-credentials.sh
Created September 4, 2020 19:19 — forked from piersharding/docker-credentials.sh
Create Docker config.json file credentials
#!/bin/bash
# This script creates a docker config.json file with the auth section
# as an example of what can be passed into GitLab-CI and used in
# conjunction with DOCKER_CONFIG - the config file directory location.
# command line parameter default values
DOCKER_REGISTRY=""
DOCKER_USER=""
DOCKER_PASSWORD=""
@JeremyTBradshaw
JeremyTBradshaw / ConvertFrom-SecureStringToPlainText.ps1
Last active November 5, 2024 14:23
For PowerShell 5.1 and older, convert secure strings back to plain text
function ConvertFrom-SecureStringToPlainText ([System.Security.SecureString]$SecureString) {
[System.Runtime.InteropServices.Marshal]::PtrToStringAuto(
[System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($SecureString)
)
}
New-Alias -Name s2p -Value ConvertFrom-SecureStringToPlainText
@ictus4u
ictus4u / run.tpl
Last active March 22, 2024 21:50 — forked from efrecon/run.tpl
`docker inspect` template to regenerate the `docker run` command that created a container
docker run \
--name {{printf "%q" .Name}} \
{{- with .HostConfig}}
{{- if .Privileged}}
--privileged \
{{- end}}
{{- if .AutoRemove}}
--rm \
{{- end}}
{{- if .Runtime}}
@crizCraig
crizCraig / bash_boilerplate.sh
Last active October 27, 2022 20:30
bash boilerplate
#!/usr/bin/env bash
set -e # Abort script at first error, when a command exits with non-zero status (except in until or while loops, if-tests, list constructs)
set -u # Attempt to use undefined variable outputs error message, and forces an exit
set -x # Similar to verbose mode (-v), but expands commands
set -o pipefail # Causes a pipeline to return the exit status of the last command in the pipe that returned a non-zero return value.
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# end boilerplate from: https://gist.github.com/crizCraig/f42bc250754bed764ada5f95d101dbea
@cmcconnell1
cmcconnell1 / k8s-service-account-kubeconfig.sh
Last active August 21, 2019 00:58 — forked from ericchiang/k8s-service-account-kubeconfig.sh
dynamic generation of kubeconfig files for ci and cd macos and linux
#!/usr/bin/env bash
# ref: https://gist.github.com/ericchiang/d2a838ddad3f44436ae001a342e1001e
# thanks to ericchiang for the initial gist, just tweaked for macos or linux and dynamic file naming.
# Creates kubeconfig files using tokens.
# Copy these files to where the ci or cd processes/envs run kubectl commands--i.e.: jenkins, etc.
#
# Usage ./k8s-service-account-kubeconfig.sh ( namespace ) ( service account name )
# i.e.: k8-sevice-account-kubeconfig.sh ci ci
# i.e.: k8-sevice-account-kubeconfig.sh cd cd
# this is for the naming the kubeconfig file naming us "kubeconfig-$KUBE_USER"
@steven2358
steven2358 / ffmpeg.md
Last active November 11, 2024 04:45
FFmpeg cheat sheet
@cirocosta
cirocosta / get-image-config.sh
Created November 26, 2017 12:30
Retrieves the configuration of images pushed to Docker registries - see https://ops.tips/blog/inspecting-docker-image-without-pull/ for more information
#!/bin/bash
# Retrieves image configuration using
# private registries without authentication
set -o errexit
# Address of the registry that we'll be
# performing the inspections against.
# This is necessary as the arguments we
@antirez
antirez / lmdb.tcl
Created April 28, 2017 15:40
LMDB -- First version of Redis written in Tcl
# LVDB - LLOOGG Memory DB
# Copyriht (C) 2009 Salvatore Sanfilippo <[email protected]>
# All Rights Reserved
# TODO
# - cron with cleanup of timedout clients, automatic dump
# - the dump should use array startsearch to write it line by line
# and may just use gets to read element by element and load the whole state.
# - 'help','stopserver','saveandstopserver','save','load','reset','keys' commands.
# - ttl with milliseconds resolution 'ttl a 1000'. Check ttl in dump!
@itatabitovski
itatabitovski / docker-registry.sh
Created April 4, 2017 06:37
List and delete tags and repositories from v2 docker registry
#!/bin/bash
set -euo pipefail
CMD=$0
function usage {
cat <<EOU
Usage: