Skip to content

Instantly share code, notes, and snippets.

@mgraupner
mgraupner / create_caddy_http_basic_auth_passwd.txt
Last active February 13, 2023 10:26
How to create a Caddy HTTP-BasicAuth password with docker
Replace "test" with your actual password:
docker run --rm caddy caddy hash-password --plaintext test
Afterwards the hashed password has to be base64 encoded (example for MacOS/Linux command line):
echo -n '$2a$14$IKXcpbxxxxxxxxViGObuL7TffDIl5Wxxxxxxxr3o4De4QNu' | base64
@mgraupner
mgraupner / gist:e061079e96669b7b4ff2d1e64619f15a
Last active September 28, 2021 10:22
Create a Caddy 2 server HTTP Basic Authentication password
As there are no clear instructions on the Caddy Homepage on how to create a password
(without their own caddy tool, which might not be available) in the needed format,
I compiled a short list on how to do it the right way:
Replace password with your own password!
Create a BCrypt encrypted password in 10 rounds
htpasswd -bnBC 10 "" password
->
:$2y$10$ow7UC86yXaSoZSr0mcGxeOYK9DfqsnKnA9RoKR.nxUUXVbXqOibgm
@mgraupner
mgraupner / ddclient
Created June 4, 2019 09:05
Cloudflare as DynDNS (DynamicDNS) Provider in 2019 for Ubuntu
# Configuration for ddclient scripts
# generated from debconf on Mon Jun 3 17:01:32 UTC 2019
#
# /etc/default/ddclient
# Set to "true" if ddclient should be run every time DHCP client ('dhclient'
# from package isc-dhcp-client) updates the systems IP address.
run_dhclient="false"
# Set to "true" if ddclient should be run every time a new ppp connection is
#!/usr/bin/env ruby
# encoding: UTF-8
require 'uri'
require 'open-uri'
require 'json'
require 'nokogiri'
class PodcastGrabber
@mgraupner
mgraupner / gist:5224456
Last active December 15, 2015 07:38
MacOS X Mountain Lion 10.8: Installing Ruby 2.0 and Gems with rbenv
As an update to my former gist: https://gist.github.com/michaelsd/1859298
I tried updating to ruby 2.0 and again there were some obstacles to overcome:
After using my previous tutorial i got the following error when updating gems
cannot load such file -- openssl
I found many sites with possible solutions, but the ultimate tip i found here
http://apple.stackexchange.com/questions/83722/ruby-2-0-0-fails-to-install-because-of-openssl
"The configure script will say that --with-openssl-dir is an invalid option. It's lying."
@mgraupner
mgraupner / gist:1859298
Last active September 30, 2015 20:47
MacOS X 10.7.3 and XCode 4.3: Installing Ruby, Gem and Rails
Made an update covering Macos 10.8 and ruby 2.0: https://gist.github.com/michaelsd/5224456
- Install "Command Line Tools for XCode" (Get it from Apple Developer Program) or Install XCode via Appstore
where option one is the faster one, 170MB vs 1.xGB
- Install https://github.com/sstephenson/rbenv
git clone into your home folder;
set environment variables, see install docs of rbenv;
- Get libyaml