Skip to content

Instantly share code, notes, and snippets.

@brunnels
brunnels / diff.py
Created September 7, 2023 13:25
unified diff
import difflib
import io
def generate_unified_diff(file1_path, file2_path, output_path):
with open(file1_path, 'r') as file1, open(file2_path, 'r') as file2:
lines1 = file1.readlines()
lines2 = file2.readlines()
diff = difflib.unified_diff(lines1, lines2, fromfile='config_old.txt', tofile='config_new.txt')
string_buffer = io.StringIO()
apiVersion: v1
kind: ConfigMap
metadata:
name: pulse-audio-config
namespace: gow
data:
default.pa: |-
.fail
load-module module-null-sink sink_name=sunshine
set-default-sink sunshine
@brunnels
brunnels / cf-ddns-cron.yaml
Created April 13, 2021 21:08
kubernetes cron to update cloudflare ddns
---
apiVersion: v1
kind: ConfigMap
metadata:
name: cf-ddns-updater
namespace: kube-system
labels:
app.kubernetes.io/name: cf-ddns-updater
app.kubernetes.io/instance: cf-ddns-updater
data:
@brunnels
brunnels / tinyfilemanager.png
Last active April 28, 2022 10:38
tinyfilemanager icon
tinyfilemanager.png
@brunnels
brunnels / bootstrapwindows10.ps1
Last active December 2, 2020 17:58 — forked from zloeber/bootstrapwindows10.ps1
Boxstarter Windows 10 Configuration
<#
The command to run, built from the raw link of this gist
Win+R
iexplore http://boxstarter.org/package/url?<RAW GIST LINK>
OR (if you don't like the way the web launcher force re-installs everything)
@brunnels
brunnels / Rclone Prometheus memory stats
Created March 17, 2019 11:50 — forked from B4dM4n/Rclone Prometheus memory stats
A shell script to collect rclone memory stats that can be read by the prometheus node_exporter textfile module
Rclone Prometheus memory stats
@brunnels
brunnels / Dockerfile
Created January 19, 2019 17:21
docker devenv container for digitial rebar provision
FROM phusion/baseimage:latest
ARG GO_SHA256=fb26c30e6a04ad937bbc657a1b5bba92f80096af1e8ee6da6430c045a8db3a5b
ENV GOLANG_VERSION=1.11.4 \
GOPATH=/root/go \
GOROOT=/usr/local/go
RUN apt-get update \
&& apt-get install -y build-essential git-core wget curl zip vim ca-certificates
@brunnels
brunnels / il8n.js
Created October 27, 2016 14:49
Gulp tasks to update il8n json files in jhipster
'use strict';
var gulp = require('gulp'),
argv = require('yargs').argv,
tap = require('gulp-tap');
var config = require('./config');
module.exports = {
setProperty: setProperty,
@brunnels
brunnels / DeviceDataRepository.java
Last active November 9, 2021 05:10
Generic REST Query Language with RSQL for Spring Data JPA
package org.kraven.repository;
import org.kraven.domain.DeviceData;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
/**
* Spring Data JPA repository for the DeviceData entity.
*/
@SuppressWarnings("unused")
public interface DeviceDataRepository extends JpaRepository<DeviceData,Long>, JpaSpecificationExecutor<DeviceData> {
'use strict';
var gulp = require('gulp'),
util = require('./utils'),
url = require('url'),
browserSync = require('browser-sync'),
proxy = require('proxy-middleware');
var config = require('./config');