Skip to content

Instantly share code, notes, and snippets.

@vmsp
vmsp / awk_oneliners
Created June 27, 2015 22:45
Handy One-Line Scripts for Awk
HANDY ONE-LINE SCRIPTS FOR AWK 30 April 2008
Compiled by Eric Pement - eric [at] pement.org version 0.27
Latest version of this file (in English) is usually at:
http://www.pement.org/awk/awk1line.txt
This file will also be available in other languages:
Chinese - http://ximix.org/translation/awk1line_zh-CN.txt
USAGE:
@halberom
halberom / extras.py
Last active November 8, 2023 16:23
ansible - example of merging lists of dicts
# ansible_plugins/filter_plugins/extras.py
def merge_dicts(value, dict1):
# return a merged dict
result = {}
result = value
result.update(dict1)
return result
def merge_lists_of_dicts(list1, list2):
# return a merged list
@sheastrickland
sheastrickland / EnableIpSecurityOverride.ps1
Created November 5, 2015 05:26
Powershell DSC for allowing override for system.webserver.security.ipSecurity in applicationHost.config
Script EnableIpSecurityOverride
{
#Allows override for system.webserver.security.ipSecurity in applicationHost.config
DependsOn = "[Script]PreviousStepGoesHere"
SetScript = {
$current = Get-WebConfiguration /system.webServer/security/ipSecurity -Metadata | select -ExpandProperty metadata | select -ExpandProperty effectiveOverrideMode
$expected = "Allow"
$incorrect = $current -ne $expected
if ($incorrect) {
try
@khalwat
khalwat / load-balancer-app.php
Created February 26, 2018 17:25
Keep hashed directories consistent in a load balanced server environment with Craft CMS 3
<?php
/**
* Yii Application Config
*
* Edit this file at your own risk!
*
* The array returned by this file will get merged with
* vendor/craftcms/cms/src/config/app/main.php and [web|console].php, when
* Craft's bootstrap script is defining the configuration for the entire
* application.