Skip to content

Instantly share code, notes, and snippets.

@depuits
depuits / nginx.conf
Created April 28, 2024 18:02
nginx.conf for isp agent dvr revers proxy
server {
server_name ispy.domain.com;
listen 443 ssl http2;
add_header Strict-Transport-Security "max-age=15552000; includeSubDomains" always;
ssl_certificate /etc/nginx/certs/fullchain.pem;
ssl_certificate_key /etc/nginx/certs/privkey.pem;
include /etc/nginx/certs/options-ssl-nginx.conf;
ssl_dhparam /etc/nginx/certs/ssl-dhparams.pem;
@depuits
depuits / upgrade-last-watch-ai.sh
Created November 30, 2020 17:01
script for updating last-watch-ai
#!/bin/bash
# stop the current app
cd last-watch-ai
sudo docker-compose down
cd ..
# move old install
mv last-watch-ai last-watch-ai-old
@depuits
depuits / doodsVisualizer.html
Last active October 7, 2020 06:34
Web page for sending an image to a DOODS server and rendering the output on the image. (Run as local file or make sure its served over the same protocol, http/https)
<!DOCTYPE html>
<html>
<body>
<p>DOODS url:</p>
<input type="text" value="http://127.0.0.1:8080/detect" id="doodsUrlInput" />
<p>Select an image:</p>
<input type="file" onchange="proccessImage(event)" />
@depuits
depuits / PrincipalExtensions.cs
Last active October 6, 2020 11:52
PrincipalExtensions for checking user roles
using System.Linq;
using System.Security.Principal;
public static class PrincipalExtensions
{
public static bool IsInAllRoles (this IPrincipal principal, params string[] roles)
{
return roles.All (r1 => r1.Split (',').All (r2 => principal.IsInRole (r2.Trim())));
}
@depuits
depuits / tClock.vbs
Created July 20, 2016 08:03
Talking clock for windows
'http://www.thewindowsclub.com/make-windows-8-speak-out-the-time-every-hour
Dim speaks, speech
speaks = "it's " & hour(time) & " hours and " & minute(time) & " minutes"
Set speech = CreateObject("sapi.spvoice")
speech.Speak speaks