Skip to content

Instantly share code, notes, and snippets.

package comma
import (
"fmt"
"strings"
)
func Add(one, two string) string {
return one + "," + two
}
@korylprince
korylprince / test.go
Created December 5, 2015 23:02
uwsgi protocol library test
package main
//run uwsgi command below where test references test.py given below
//uwsgi --plugin python --uwsgi-socket :9090 --wsgi test
import (
"bytes"
"io"
"log"
"net"
@korylprince
korylprince / merge.py
Last active October 31, 2023 02:01
Modify 10.13 (SFL2) Server Favorites list
#!/usr/local/munki/munki-python
# change the above path to your own python if you don't have Munki installed
"""
Merges add_servers into current favorites and removes remove_servers.
Run as root to update all users or as normal user to update just that user.
"""
import os
import getpass
@korylprince
korylprince / onvif_stream.txt
Last active February 12, 2019 18:50
GeoVision Authentication Errors
POST /onvif/device_service HTTP/1.1
Host: 10.192.5.11
User-Agent: gSOAP/2.8
Content-Type: application/soap+xml; charset=utf-8; action="http://www.onvif.org/ver10/device/wsdl/GetDeviceInformation"
Content-Length: 3017
Connection: close
SOAPAction: "http://www.onvif.org/ver10/device/wsdl/GetDeviceInformation"
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope" xmlns:SOAP-ENC="http://www.w3.org/2003/05/soap-encoding" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:chan="http://schemas.microsoft.com/ws/2005/02/duplex" xmlns:wsa5="http://www.w3.org/2005/08/addressing" xmlns:c14n="http://www.w3.org/2001/10/xml-exc-c14n#" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:xenc="http://www.w3.org/2001/04/xmlenc#" xmlns:wsc="http://docs.oasis-open.org/ws-sx/ws-secureconversation/200512" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:wsse="http:/
@korylprince
korylprince / caddy.bin
Created October 1, 2019 15:52
caddy_diagnostics
#!/bin/sh
find /share/caddy
See screenshot here: https://imgur.com/a/zEvyKxx
Dear Administrator,
We’re writing to let you know that due to low usage, the App Maker product will be shut down on January 19, 2021. Google Cloud will continue to invest in providing customers with best-in-class solutions in the low-code/no-code space. While we regret the inconvenience this may cause, we’re committed to helping your organization navigate this change.
What do I need to do?
Review the list of apps for [REDACTED] in the attached CSV file. The list includes application name, creator name, last modified date, and a link to your Admin console with application-specific usage stats and project information.
App creators in your organization will need to review their use cases in the “replacement product” section and take action by the dates listed in the schedule below.
@korylprince
korylprince / cleanup.py
Last active December 9, 2020 17:40
macOS Cleanup Script
#!/usr/bin/python
import os
import shutil
system_folders = [
"/Applications/AVer+.app",
"/Applications/AVerVision 2.app",
"/Applications/Algodoo.app",
"/Applications/GIMP.app",
"/Applications/GarageBand.app",
# usage: python3 verify.py /path/to/request
import base64, plistlib, tempfile, os, subprocess, re, sys
request = sys.argv[1]
# open request
with open(request) as f:
plist = plistlib.loads(base64.b64decode(f.read()))
# write separate chain certificates
@korylprince
korylprince / generate.go
Created May 16, 2022 15:10
Lightspeed Smart Agent localhost certificate generation
package main
import (
"crypto/rand"
"crypto/rsa"
"crypto/sha512"
"crypto/x509"
"crypto/x509/pkix"
"encoding/pem"
"errors"
@korylprince
korylprince / Caddyfile
Created November 3, 2022 03:17
Open Source Cybersecurity Example
vaultwarden.{$DOMAIN}:443 {
tls {$EMAIL}
reverse_proxy vaultwarden:80 {
header_up X-Real-IP {remote_host}
}
reverse_proxy /notifications/hub vaultwarden:3012
}