Skip to content

Instantly share code, notes, and snippets.

View davidnewhall's full-sized avatar
💭
Pioneering Profit

David Newhall davidnewhall

💭
Pioneering Profit
  • Russian Federation
  • 17:36 (UTC +03:00)
View GitHub Profile
go/src/github.com/Unpackerr/iso9660$ go run ./cmd/isodump/ ./cmd/isodump/din-xbladeshd.iso
2023/05/18 01:52:26 DEBUG: 10 "\x00" "\"\x00\x05\x01\x00\x00\x00\x00\x01\x05\x00\b\x00\x00\x00\x00\b\x00F\x01\x01\x01\x00\x00\x04\x02\x00\x00\x01\x00\x00\x01\x01\x00"
2023/05/18 01:52:26 DEBUG: 10 "\x00" "\"\x00\x0f\x01\x00\x00\x00\x00\x01\x0f\x00\b\x00\x00\x00\x00\b\x00F\x01\x01\x01\x00\x00\x04\x02\x00\x00\x01\x00\x00\x01\x01\x00"
"." age: 467888h52m26s bytes: 2048, me: false
2023/05/18 01:52:26 DEBUG: 10 "\x00" "\"\x00\x05\x01\x00\x00\x00\x00\x01\x05\x00\b\x00\x00\x00\x00\b\x00z\f\x14\b\x15.\x04\x02\x00\x00\x01\x00\x00\x01\x01\x00"
2023/05/18 01:52:26 DEBUG: 10 "\x01" "\"\x00\x05\x01\x00\x00\x00\x00\x01\x05\x00\b\x00\x00\x00\x00\b\x00z\f\x14\b\x15.\x04\x02\x00\x00\x01\x00\x00\x01\x01\x01"
2023/05/18 01:52:26 DEBUG: 10 "ARTBOOK" "(\x00\x06\x01\x00\x00\x00\x00\x01\x06\x00\b\x00\x00\x00\x00\b\x00z\f\x10\b\x14*\x04\x02\x00\x00\x01\x00\x00\x01\aARTBOOK"
2023/05/18 01:52:26 DEBUG: 10 "GUIDE" "&\x00\a\x01\x00\x00\x00\x00\x01
@davidnewhall
davidnewhall / notifiarr.subdomain.conf
Created August 5, 2022 21:19 — forked from TRaSH-/notifiarr.subdomain.conf
notifiarr subdomain conf for swag
## Version 2022/08/05
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name notifiarr.*;
include /config/nginx/ssl.conf;
@davidnewhall
davidnewhall / betteruptime.css
Last active December 22, 2021 08:10
Betteruptime.com CSS, example to make better uptime status page go dark mode.
/* Main background */
.status-page {
background-color: #32363b; /* For browsers that do not support gradients */
background-image: linear-gradient(to bottom right, #252526, #1e1e33);
}
/* System Status announcement (entered on website), text. */
.status-page__overview .status-page__description {
color: #5a83b0;
margin-top:1.5rem
}
@davidnewhall
davidnewhall / delete_conversations.applescript
Created November 29, 2018 02:03
Delete every conversation in Messages.app on Sierra using AppleScript
tell application "Messages"
activate
try
repeat (count of (get every chat)) times
delete item 1 of (get every chat)
tell application "System Events" to tell process "Messages" to keystroke return
end repeat
end try
close every window
end tell
@davidnewhall
davidnewhall / pidfile_snippet.go
Last active October 13, 2023 08:07
How to write a PID file in Golang.
// Write a pid file, but first make sure it doesn't exist with a running pid.
func writePidFile(pidFile string) error {
// Read in the pid file as a slice of bytes.
if piddata, err := ioutil.ReadFile(pidFile); err == nil {
// Convert the file contents to an integer.
if pid, err := strconv.Atoi(string(piddata)); err == nil {
// Look for the pid in the process list.
if process, err := os.FindProcess(pid); err == nil {
// Send the process a signal zero kill.
if err := process.Signal(syscall.Signal(0)); err == nil {
@davidnewhall
davidnewhall / notify-slack.sh
Created September 21, 2017 06:20
Simple Nagios Notification Handler to Send Pretty Slack Notifications
#!/bin/bash
# Send Nagios alert to a Slack Channel.
# Add something like this to Nagios commands.cfg:
#define command {
# command_name notify-host-by-slack
# command_line $USER2$/notify-slack.sh HOST "$CONTACTPAGER$" "$HOSTNAME$" "$TIMET$" "$NOTIFICATIONTYPE$" "$HOSTSTATE$" "$HOSTOUTPUT$" "$LONGHOSTOUTPUT$" "$HOSTNOTESURL$"
# register 1
#}
#define command {
# command_name notify-service-by-slack
@davidnewhall
davidnewhall / check_monit.py
Last active July 31, 2016 04:24 — forked from mzupan/check_monit.py
Nagios check for monit services going unmonitored
#!/usr/bin/env python
# This script will connect to a remove monit instance and report
# CRITICAL if any of the services are currently 'unmonitored'.
import pynagios
import urllib2
import base64
from xml.dom.minidom import parseString
from pynagios import Plugin, make_option, Response