Skip to content

Instantly share code, notes, and snippets.

@chriswiggins
chriswiggins / README.md
Last active April 8, 2020 02:00
Kubernetes CronJob to automatically create Calico GlobalNetwokSets of specific Amazon AWS IP Ranges for use in Network Policies

Kubernetes Calico GlobalNetworkSets from Amazon AWS IPList

This cronjob updates GlobalNetworkSets hourly from the Amazon IPList.

Edit the REGIONS in the script to the regions of IPLists you'd like to create. Each region specified creates a separate GlobalNetwork set called amazon-services-REGION, with labels as specified in the cronjob

@chriswiggins
chriswiggins / ecr-cred-updater.yaml
Last active November 7, 2018 02:40 — forked from cablespaghetti/ecr-cred-updater.sh
Automatic Updating Amazon ECR Credentials in Kubernetes
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: ecr-cred-updater
rules:
- apiGroups: [""]
resources: ["secrets"]
verbs: ["get", "create", "delete"]
- apiGroups: [""]
resources: ["serviceaccounts"]
@chriswiggins
chriswiggins / snippet.php
Created August 17, 2018 05:19
Snippet to add images to Yoast sitemap from Impreza Wordpress theme
<?php
/* Add impreza images to Yoast sitemap, since Yoast doesn't read impreza's Page
* Builder code - borrowed from (https://github.com/Yoast/wordpress-seo/issues/4808) */
function impreza_filter_wpseo_sitemap_urlimages($images, $post_id)
{
$post = get_post($post_id);
if (is_object($post)) {
$content = $post->post_content;
@chriswiggins
chriswiggins / index.m3u8
Created August 30, 2015 18:37
nginx-rtmp generated live playlist
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-MEDIA-SEQUENCE:84485
#EXT-X-TARGETDURATION:2
#EXTINF:1.467,
84485.ts
#EXTINF:1.467,
84486.ts
#EXTINF:1.466,
84487.ts
diff -u -E -b ZoneMinder-1.24.2.orig/db/zm_create.sql.in ZoneMinder-1.24.2/db/zm_create.sql.in
--- ZoneMinder-1.24.2.orig/db/zm_create.sql.in 2009-05-25 22:08:50.000000000 +0400
+++ ZoneMinder-1.24.2/db/zm_create.sql.in 2010-09-27 16:22:55.000000000 +0400
@@ -190,7 +190,7 @@
`EndTime` datetime default NULL,
`Width` smallint(5) unsigned NOT NULL default '0',
`Height` smallint(5) unsigned NOT NULL default '0',
- `Length` decimal(10,2) NOT NULL default '0.00',
+ `Length` decimal(11,3) NOT NULL default '0.000',
`Frames` int(10) unsigned default NULL,