Skip to content

Instantly share code, notes, and snippets.

@matglas
matglas / flat-pc-merge-sbom.cdx.json
Last active January 7, 2025 10:55 — forked from viveksahu26/flat-pc-merge-sbom.cdx.json
flat merge using primaryCompFile
$ go run main.go assemble --flatMerge --primaryCompFile sbomex-cdx.json sbomgr-cdx.json -o flat-pc-merge-sbom.spdx.json
{
"$schema": "http://cyclonedx.org/schema/bom-1.6.schema.json",
"bomFormat": "CycloneDX",
"specVersion": "1.6",
"serialNumber": "urn:uuid:1cef94a5-0ba6-411e-b8eb-c952dd34f85c",
"version": 1,
"metadata": {
"timestamp": "2025-01-07T09:03:33Z",
@matglas
matglas / daemonset.yaml
Created September 27, 2022 20:04
blog-kyverno-kustomize
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: filebeat-filebeat
labels:
app: filebeat-filebeat
spec:
selector:
matchLabels:
app: filebeat-filebeat
@matglas
matglas / CHANGELOG.md
Last active May 21, 2021 11:15
CHANGELOG.md template based on keepachangelog.com

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

[Unreleased]

@matglas
matglas / purge-mailer-daemon.sh
Last active February 9, 2017 12:57
Purge in mailq with sender MAILER-DEAMON and from address X
#!/bin/bash
# Author: Matthias Glastra
# Purpose: Purge e-mail that are beeing send by the MAILER-DAEMON based on a from address.
# Usage:
# ./purge-mailer-daemon.sh "example.com"
#
# Example:
# When a spam attack happend by example.com and e-mails could not be delivered the daemon starts
# sending e-mails back. You can remove these e-mail through this script.
#
@matglas
matglas / run
Created February 17, 2016 17:47
MailCatcher in docker
docker run --rm -p 1080:1080 -p 1025:1025 --name mailcatcher schickling/mailcatcher
@matglas
matglas / gist:651ef703fac1ad7c6168
Last active January 30, 2016 09:26
Run a docker container with a temporary solr.
Image from: https://github.com/twinbit/docker-drupal-solr
Run a container with a temporary solr.
$ docker run -p=8983:8983 --name=solr --rm twinbit/docker-drupal-solr
@matglas
matglas / panel_context_pane.php
Created September 16, 2015 14:15
Loading a panel with context programaticly
<?php
ctools_include('context');
ctools_include('content');
// Load ctools context from the arguments.
$context = array();
$context_arguments = array(
'identifier' => 'node', // Required: Identifier to the panel.
'name' => 'entity_id:node', // Required: Identifier used by argument plugins.
'title' => 'Node', // Optional.
@matglas
matglas / update-kw-env.sh
Created April 23, 2015 09:57
Update a kw environment to latest version.
#!/bin/bash
# Usage: sh update.sh fase
# fase-1 or empty makes the pull
# fase-2 executes the script
#
# If you want to run a specific version checkout that
# version first in the src folder with git checkout [ref].
# Don't use a branch there because it still does a pull
# on the branch (if it is setup as a tracking branch).
@matglas
matglas / hook_permission.php
Last active August 29, 2015 14:13
Template for drupal permissions.
/**
* Implements hook_permission().
*/
function ZZMODULE_permission() {
$perms = array();
// Allow access to certain pages based on this permissions
$perms['administer XX'] = array(
'title' => t('Administer [ZZMODULE] settings'),
'description' => t('Administer the settings of [ZZMODULE].')
@matglas
matglas / reset.sh
Created September 11, 2014 21:06
Platform reset.sh for kraftwagen skeleton development
#!/bin/bash
# Reset
sudo rm -rf cnf/settings.php
sudo rm -rf cnf/files
sudo rm -rf builds
sudo rm -rf build
sudo rm -rf src
# Create new project.