Skip to content

Instantly share code, notes, and snippets.

View Daniel15's full-sized avatar

Daniel Lo Nigro Daniel15

View GitHub Profile
@Daniel15
Daniel15 / gist:9f22d46ccc791036a97634b4c573f701
Created February 18, 2024 22:15
HostHatch Black Friday 2020 YABS
# ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## #
# Yet-Another-Bench-Script #
# v2024-01-01 #
# https://github.com/masonr/yet-another-bench-script #
# ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## #
Sun Feb 18 01:52:40 PM PST 2024
Basic System Information:
---------------------------------
@Daniel15
Daniel15 / BlueIrisAI-NodeRedFunctionNode.js
Last active October 13, 2023 18:56
Blue Iris AI alerts in Node-RED
const {img, ...otherPayloadFields} = msg.payload;
const objectsToFilter = new Set([
'ball',
'sports ball',
'horse',
'book',
'suitcase',
]);
let formattedObjectNames = 'Nothing';
zigbee2mqtt:
container_name: zigbee2mqtt
restart: unless-stopped
image: koenkk/zigbee2mqtt:latest
volumes:
- /var/local/docker/zigbee2mqtt:/app/data
- /run/udev:/run/udev:ro
ports:
- 8080:8080
environment:
@Daniel15
Daniel15 / slack-invite-link-security-issue.txt
Last active July 17, 2023 01:16
Slack invite link security issue
@Daniel15
Daniel15 / WithHovercard.tsx
Created October 17, 2021 00:24
React Bootstrap tooltip with Popper.js
import React, {useEffect, useState} from 'react';
import ReactDOM from 'react-dom';
import {Placement} from '@popperjs/core';
import useMouseOver from '../hooks/useMouseOver';
import useLazyRef from '../hooks/useLazyRef';
import {usePopper} from 'react-popper';
type Props = Readonly<{
children: React.ReactNode;
@Daniel15
Daniel15 / _common.conf
Created May 1, 2020 16:33
WordPress config with WP Super Cache for Nginx
# /etc/nginx/snippets/wordpress/common.conf
index index.php;
# Deny all attempts to access hidden files such as .htaccess, .htpasswd, .DS_Store (Mac).
location ~ /\. {
deny all;
}
# Block PHP files in uploads, content, and includes directory.
location ~* /(?:uploads|files|wp-content|wp-includes)/.*\.php$ {
@Daniel15
Daniel15 / gist:27b31f4f223ddeb110226b0f5ce78ce9
Created November 28, 2019 09:28
WireGuard build output
root@it01:/usr/local/src/wireguard-go# make
go build -v -o "wireguard-go"
Fetching https://golang.org/x/text?go-get=1
Fetching https://golang.org/x/sys?go-get=1
Fetching https://golang.org/x/net?go-get=1
Fetching https://golang.org/x/crypto?go-get=1
Parsing meta tags from https://golang.org/x/crypto?go-get=1 (status code 200)
get "golang.org/x/crypto": found meta tag get.metaImport{Prefix:"golang.org/x/crypto", VCS:"git", RepoRoot:"https://go.googlesource.com/crypto"} at https://golang.org/x/crypto?go-get=1
Parsing meta tags from https://golang.org/x/text?go-get=1 (status code 200)
get "golang.org/x/text": found meta tag get.metaImport{Prefix:"golang.org/x/text", VCS:"git", RepoRoot:"https://go.googlesource.com/text"} at https://golang.org/x/text?go-get=1
@Daniel15
Daniel15 / ProcessExtensions.cs
Created October 26, 2019 20:18
C# WaitForExitAsync implementation
using System;
using System.Diagnostics;
using System.Threading;
using System.Threading.Tasks;
namespace Daniel15.Extensions
{
/// <summary>
/// Extensions for <see cref="Process"/>
/// </summary>
@Daniel15
Daniel15 / npm-output.txt
Created March 13, 2019 03:48
npm output - segfault on install
npm info it worked if it ends with ok
npm verb cli [ '/usr/bin/node',
npm verb cli '/usr/local/bin/npm',
npm verb cli 'install',
npm verb cli '--loglevel',
npm verb cli 'verbose' ]
npm info using npm@6.9.0
npm info using node@v10.15.2
npm verb npm-session cad68cd73009e571
npm info lifecycle sitename@0.0.0~preinstall: sitename@0.0.0
@Daniel15
Daniel15 / gist:c8c31b9e46d8c2eea6385d7dd1ba6c40
Created February 8, 2019 06:35
Debugging GPGME with WinDbg
Microsoft (R) Windows Debugger Version 10.0.14321.1024 AMD64
Copyright (c) Microsoft Corporation. All rights reserved.
CommandLine: "C:\Users\danlo\Dropbox (Personal)\src\gpgme-sharp\Examples\PgpEncryptDecrypt\bin\Debug\net40\PgpEncryptDecrypt.exe"
Symbol search path is: srv*
Executable search path is:
ModLoad: 00000000`00070000 00000000`00078000 PgpEncryptDecrypt.exe
ModLoad: 00007ffb`d88c0000 00007ffb`d8aad000 ntdll.dll
ModLoad: 00000000`774a0000 00000000`7763c000 ntdll.dll