Skip to content

Instantly share code, notes, and snippets.

View samueljon's full-sized avatar

Samúel Jón Gunnarsson samueljon

View GitHub Profile
@mynameispj
mynameispj / node.tpl.php
Created April 5, 2012 19:45
Drupal 7 - $messages in node.tpl.php
global $global_messages;
print $global_messages;
@petemcw
petemcw / default.vcl
Created May 22, 2011 02:20
Lullabot's Custom Varnish VCL File
#
# Customized VCL file for serving up a Drupal site with multiple back-ends.
#
# For more information on this VCL, visit the Lullabot article:
# http://www.lullabot.com/articles/varnish-multiple-web-servers-drupal
#
# Define the internal network subnet.
# These are used below to allow internal access to certain files while not
# allowing access from the public internet.
WAN addr: 81.167.4.214
eth0 = LAN
$ ipv6calc --action 6rd_local_prefix --6rd_prefix 2a01:79c::/30 --6rd_relay_prefix 213.167.115.92/0 81.167.4.214
2a01:79d:469c:1358::/62
sudo ip tunnel add 6rdtun mode sit local 81.167.4.214 ttl 64
sudo ip tunnel 6rd dev 6rdtun 6rd-prefix 2a01:79c::/30
sudo ip link set 6rdtun up
@gchaix
gchaix / default.vcl
Last active October 3, 2018 01:16
Example Varnish default.vcl for Drupal
#
# Customized VCL file for serving up a Drupal site with multiple back-ends.
#
# Based on this excellent Lullabot article:
# http://www.lullabot.com/articles/varnish-multiple-web-servers-drupal
#
# Hooks for New Relic
C{
#include <sys/time.h>
@geerlingguy
geerlingguy / molecule-3-up.sh
Last active January 15, 2021 13:52
Molecule 3.0 update script with all the little changes I had to make.
#!/bin/bash
#
# Update things to be compatible with Molecule 3.0.
#
# This script is NOT idempotent, and should never be run again.
exit 1
export LINT_STRING="lint: |
set -e
yamllint .
@typhonius
typhonius / seed_derivatives.drush.inc
Last active January 27, 2021 10:01
This script can generate image derivatives for Drupal for warming up the filesystem prior to going live. Image derivative generation puts an amount of load on the servers so it images have been migrated from another server with no derivatives, it may be useful to pre-generate using this script.
<?php
/**
* Implements hook_drush_command().
*/
function seed_derivatives_drush_command() {
$items = array();
$items['seed_derivatives'] = array(
'description' => "Create image derivatives",
@qrkourier
qrkourier / ovirt-private-ca.md
Last active October 11, 2021 07:57
Install a Server Certificate For oVirt Manager UI

Install server certificates issued by a private CA in oVirt4 Manager and Host

  • generate a signing request on the system where oVirt Manager is running (the engine server)
openssl req -new -sha256 -key /etc/pki/ovirt-engine/keys/apache.key.nopass -out /tmp/engine.csr
  • Submit the CSR to the issuer and wait. Or, if you are the issuer and you happen to be using FreeIPA/IdM, you may issue the certificate with ipa-admintools. For example,
@tiernano
tiernano / gist:4344701
Created December 20, 2012 11:08
IPv6 Firewall rules for a MikroTik router to allow outgoing connections, but block incoming, unless they are responses...
/ipv6 firewall filter
add action=accept chain=input comment="Allow established connections" connection-state=established disabled=no
add action=accept chain=input comment="Allow related connections" connection-state=related disabled=no
add action=accept chain=input comment="Allow limited ICMP" disabled=no limit=50/5s,5 protocol=icmpv6
add action=accept chain=input comment="Allow UDP" disabled=no protocol=udp
add action=drop chain=input comment="" disabled=no
add action=accept chain=forward comment="Allow any to internet" disabled=no out-interface=sit1
add action=accept chain=forward comment="Allow established connections" connection-state=established disabled=no
add action=accept chain=forward comment="Allow related connections" connection-state=related disabled=no
add action=drop chain=forward comment="" disabled=no
@abn
abn / rpm-build-workflow.md
Last active May 18, 2022 05:04
RPM build and hosting workflow using github, travis-ci and copr

RPM Build Flow

This document details a simple RPM build flow pattern used to build and host RPM artifacts for open source projects. The below is a visual summary of this flow.

In order to achieve this multiple tools and services are used. The services and their purpose in the flow is as listed below.

Service Purpose
GitHub As is the most common use for GitHub, it holds the build source code. In this case we hold only the spec files and related source files. All other sources, including project binaries/sources are retrieved at build time.