Skip to content

Instantly share code, notes, and snippets.

View Max-AR's full-sized avatar
🌏

Max Max-AR

🌏
View GitHub Profile
<?php snippet('header') ?>
<main class="main" role="main">
<div class="text">
<h1><?php echo $page->title()->html() ?></h1>
<?php echo $page->text()->kirbytext() ?>
</div>
</main>
# -*- mode: ruby -*-
# vi: set ft=ruby :
#You can modify these two values as you see fit
vb_memory = '4096'
vb_cpus = '4'
hostname = File.basename(Dir.getwd) + ".lan"
@Max-AR
Max-AR / CompareApp.scala
Created August 31, 2017 06:13
Quick dirty and recursive implementation of contains string function.
object ContainsApp extends App {
def contains(substr: String, string: String): Boolean ={
var bool = false
def impl(letters: List[Char], word: List[Char], firstPass: Boolean = true): List[Char] ={
if(letters.isEmpty || word.isEmpty){
List()
@Max-AR
Max-AR / openssl.sh
Last active March 13, 2018 21:00
Prepare a public/private key pair for deployment in IIS 7 in Windows without CSR - Openssl
#!/bin/bash
# How do I deploy an ssl certificate to an IIS server without a CSR?
# These are the basic commands that will generate a .pfx file for IIS on OSX
# Assuming that we have a .p7b (public key) file, we will need to convert to a .pem file for openssl.
# This can contain your intermediate certs as well.
openssl pkcs7 -print_certs -in ./ssl_certificate.p7b -out ./ssl_certificate.pem
# Double check for consistiency after conversion, the sha numbers should be the same
privatesha1=$(openssl rsa -modulus -noout -in ./private.key | openssl sha1);
@Max-AR
Max-AR / fingerprintcheck.sh
Created July 5, 2018 04:29
Check fingerprint of AWS key pair on CLI without aws cli (Linux)
#!/bin/bash
openssl pkcs8 -in ~/.ssh/your_key.pem -nocrypt -topk8 -outform DER | openssl sha1 -c
FROM node:14
# Dependencies for chrome.
RUN apt-get -qq update -y \
&& apt-get -qq install -y \
gconf-service \
libasound2 \
libatk1.0-0 \
libatk-bridge2.0-0 \
libc6 \
@Max-AR
Max-AR / BasicAuth.scala
Last active September 22, 2021 05:58
Basic auth in play 2.8
// From https://www.rtechservices.io/blog/basic-authentication-play-scala
package filter
import akka.stream.Materializer
import com.google.inject.Inject
import play.api.Logging
import play.api.mvc._
import scala.concurrent.{ExecutionContext, Future}