Skip to content

Instantly share code, notes, and snippets.

View LarsNieuwenhuizen's full-sized avatar
🙏
Meditating

Lars Nieuwenhuizen LarsNieuwenhuizen

🙏
Meditating
View GitHub Profile
@LarsNieuwenhuizen
LarsNieuwenhuizen / vpc-and-peering.tf
Created November 9, 2022 12:35
Two separated AWS VPC's and communication between the private subnets
View vpc-and-peering.tf
module "vpc-1" {
source = "terraform-aws-modules/vpc/aws"
version = "~> 3.0"
name = "VPC1"
cidr = "10.0.0.0/16"
azs = [
"eu-west-1a",
"eu-west-1b",
@LarsNieuwenhuizen
LarsNieuwenhuizen / hosts
Created April 19, 2020 10:23
K3S installation setup with Ansible
View hosts
[cluster]
kubemaster ansible_host=192.168.2.40 ansible_user=pi
worker-1 ansible_host=192.168.2.41 ansible_user=pi
worker-2 ansible_host=192.168.2.42 ansible_user=pi
worker-3 ansible_host=192.168.2.43 ansible_user=pi
[cluster-masters]
kubemaster ansible_host=192.168.2.40 ansible_user=pi
[cluster-workers]
@LarsNieuwenhuizen
LarsNieuwenhuizen / select-double-key-combo.sql
Created August 20, 2018 12:46
Select double key combinations on table
View select-double-key-combo.sql
SELECT CP1.*
FROM table CP1
JOIN table CP2
ON CP1.item1_id = CP2.item1_id AND CP1.item2_id = CP2.item2_id AND CP1.id > CP2.id
@LarsNieuwenhuizen
LarsNieuwenhuizen / docker-compose.yml
Created January 3, 2018 15:16
Traefik & Docker basic example
View docker-compose.yml
version: '3.4'
services:
proxy:
image: traefik:1.4-alpine
command: --web --docker --docker.domain=docker.localhost
networks:
- traefik
ports:
- 80:80
View keybase.md

Keybase proof

I hereby claim:

  • I am larsnieuwenhuizen on github.
  • I am lnieuwenhuizen (https://keybase.io/lnieuwenhuizen) on keybase.
  • I have a public key ASDygemV8LMtmr1V80VJEtuf8r-kDG1wReP2p-MqfZ7qxgo

To claim this, I am signing this object:

@LarsNieuwenhuizen
LarsNieuwenhuizen / Settings.yaml
Last active June 14, 2016 06:42
Flow/Neos Custom ThrowingHandler with bugsnag reporting
View Settings.yaml
TYPO3:
TypoScript:
rendering:
exceptionHandler: 'Vendor\PackageKey\Error\ExceptionHandlers\ThrowingHandler'
Vendor:
PackageKey:
errors:
bugSnag:
apiKey: 'YourApiKeyHere'
@LarsNieuwenhuizen
LarsNieuwenhuizen / EncryptionService.php
Last active August 29, 2015 14:26
Simple service class to encrypt and decrypt string using php5-mcrypt
View EncryptionService.php
<?php
namespace Package\Key\Service;
use TYPO3\Flow\Annotations as Flow;
/**
* Class EncryptionService
*
* @Flow\Scope("singleton")
*/
@LarsNieuwenhuizen
LarsNieuwenhuizen / Test.php
Last active January 3, 2016 21:29
My TYPO3 Surf deployment for a TYPO3 website.Credits for \GrandSlam\Surf\Application\TYPO3\CMS go to Jesper Paardekooper: https://github.com/jp1987/GrandSlam.SurfHere all the functions are found for DB compare, symlinking folders like uploads, typo3temp and fileadmin and clearing the cache.Easy to create, easier to use :)
View Test.php
<?php
use \TYPO3\Surf\Domain\Model\Workflow;
use \TYPO3\Surf\Domain\Model\Node;
use \TYPO3\Surf\Domain\Model\SimpleWorkflow;
$application = new \GrandSlam\Surf\Application\TYPO3\CMS('My Website');
$application->setContext('Test');
$application->setDeploymentPath('/deployment');
$application->setOption('keepReleases', 4);
@LarsNieuwenhuizen
LarsNieuwenhuizen / ReplaceStringViewHelper.php
Created June 8, 2012 12:12
Fluid ViewHelper for str_replace
View ReplaceStringViewHelper.php
<?php
/**
* Replacement viewhelper
*
* @package lars_development
* @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3 or later
*/
class Tx_ExtensionName_ViewHelpers_ReplaceStringViewHelper extends Tx_Fluid_Core_ViewHelper_AbstractViewHelper {
/**
* Replace the $searchFor string with $replaceString in $string