Skip to content

Instantly share code, notes, and snippets.

View adrianharabula's full-sized avatar

Adrian Harabulă adrianharabula

View GitHub Profile
@Baldinof
Baldinof / Caddyfile
Created July 8, 2021 16:06
PHP-fpm with Caddy web server
{
supervisor {
php-fpm
}
}
:8080
php_fastcgi 127.0.0.1:9000
root * .
@mrcunninghamz
mrcunninghamz / SelfSignedCert.md
Last active June 28, 2024 22:07
Creating a self signed certificate in a pfx format on a mac.

Create Self Signed Certificate using OpenSSL on a Mac

Introduction

Every now and then I need to create a self signed certificate in azure for something. In my particular case its Azure B2C. I am using a mac so its not simply just running something like

New-SelfSignedCertificate `
    -KeyExportPolicy Exportable `
    -Subject "CN=yourappname.yourtenant.onmicrosoft.com" `
 -KeyAlgorithm RSA `
#!/usr/bin/env bash
#
# Quickly encrypt a message or a file for sending to
# your colleagues over unsecure messengers (Slack, etc)...
#
# echo "secret message" | encrypt
#
# Or to encrypt a file:
#
# encrypt ./path/to/file
@huettern
huettern / renew_ssl_synology.md
Last active December 29, 2021 11:43
Wildcard certificate on Synology NAS

Use certbot to create a wildcard certificat with DNS challenge

DOMAIN="example.com"
sudo certbot certonly  --manual --manual-public-ip-logging-ok --preferred-challenges dns-01 --server https://acme-v02.api.letsencrypt.org/directory -d "*.$DOMAIN"

Follow the instructions on the console and create the DNS TXT record.

Copy the generated files to a working directory

First install pyenv.

Afterwards ...

Installing a Python version:

pyenv install 2.7.14
type Callback<A> = (a: A) => void;
/**
* Delays stuff for ensuring fairness.
*/
export function yieldRunLoop(): Promise<void> {
const fn: (cb: (() => void)) => void = typeof setImmediate !== 'undefined'
? setImmediate
: cb => setTimeout(cb, 0)
return new Promise(fn)

How to add a Web Feed (RSS/Atom) to your Jekyll website

If you're generating your website with Jekyll or another static website generator, don't forget to also expose a web feed for us old timer using RSS readers. The format we'll be preferring here is Atom.

Some reasons to expose a web feed:

  1. people using RSS readers regularly are pretty loyal, RSS/Atom subscribers being like a mailing list for some of us
  2. tooling knows RSS/Atom — e.g. the easiest way to build a mailing list is to give Mailchimp your RSS feed

If you're looking for a recommendation on online RSS readers, I personally like Newsblur.

@chrisswanda
chrisswanda / WireGuard_Setup.txt
Last active July 10, 2024 12:03
Stupid simple setting up WireGuard - Server and multiple peers
Install WireGuard via whatever package manager you use. For me, I use apt.
$ sudo add-apt-repository ppa:wireguard/wireguard
$ sudo apt-get update
$ sudo apt-get install wireguard
MacOS
$ brew install wireguard-tools
Generate key your key pairs. The key pairs are just that, key pairs. They can be
@ebal
ebal / cloud-init.sh
Created November 18, 2018 10:10
Cloud-init example using a Generic Cloud CentOS-7 on a libvirtd qmu/kvm lab
#!/bin/sh
if [ "$EUID" -ne 0 ]; then
echo -e "\nPlease run as root\neg. sudo $0 \n"
exit
fi
GITHUB_USERNAME="ebal"
cd `mktemp -d`