Skip to content

Instantly share code, notes, and snippets.

@ethzero
ethzero / vlc_hdmiusb_rpi.md
Last active April 27, 2024 14:31
Parameters for Raspberry Pi Desktop using VLC and an HDMI USB Capture Adapter

Open Capture Device > Capture Device

Show more options > Edit Options

:dshow-vdev=USB Video :dshow-adev=Digital Audio Interface (2- USB Digital Audio) :dshow-size=1280×720 :dshow-aspect-ratio=16\:9 :dshow-chroma= :dshow-fps=25 :no-dshow-config :no-dshow-tuner :dshow-tuner-channel=0 :dshow-tuner-frequency=0 :dshow-tuner-country=0 :dshow-tuner-standard=0 :dshow-tuner-input=0 :dshow-video-input=-1 :dshow-video-output=-1 :dshow-audio-input=-1 :dshow-audio-output=-1 :dshow-amtuner-mode=1 :dshow-audio-channels=0 :dshow-audio-samplerate=0 :dshow-audio-bitspersample=0 :live-caching=300
@ethzero
ethzero / ApacheLogParser.psm1
Last active March 17, 2024 23:44 — forked from sunnyone/ApacheLogParser.psm1
Apache Log Parser for PowerShell
function Read-ApacheLog
{
param(
[Parameter(Mandatory=$true)]
[string]
$Path
)
Get-Content -Path $Path | Foreach-Object {
# combined format
@ethzero
ethzero / Restart-iCue.ps1
Last active October 31, 2023 22:47
Restart PowerShell Script for when the Corsair iCUE software occassionally stop animating RAM LEDs
#requires -version 2
<#
.SYNOPSIS
A PowerShell restart script for when the Corsair iCUE software occassionally stops animating the RAM LEDs
.DESCRIPTION
The script first terminates the iCUE desktop application, then restarts the CorsairLLAService (which acts as data proxy between iCUE and the hardware), then finally relaunches iCUE
.PARAMETER <Parameter_Name>
<Brief description of parameter input required. Repeat this attribute if required>
.INPUTS
@ethzero
ethzero / SQL-Version.sql
Last active June 22, 2023 00:37
SQL Version and Stats Dump
SELECT
@@VERSION AS '@@VERSION',
CASE
WHEN CONVERT(sysname, SERVERPROPERTY('ProductVersion')) LIKE '8%' THEN 'SQL Server 2000'
WHEN CONVERT(sysname, SERVERPROPERTY('ProductVersion')) LIKE '9%' THEN 'SQL Server 2005'
WHEN CONVERT(sysname, SERVERPROPERTY('ProductVersion')) LIKE '10.0%' THEN 'SQL Server 2008'
WHEN CONVERT(sysname, SERVERPROPERTY('ProductVersion')) LIKE '10.5%' THEN 'SQL Server 2008 R2'
WHEN CONVERT(sysname, SERVERPROPERTY('ProductVersion')) LIKE '11%' THEN 'SQL Server 2012'
WHEN CONVERT(sysname, SERVERPROPERTY('ProductVersion')) LIKE '12%' THEN 'SQL Server 2014'
WHEN CONVERT(sysname, SERVERPROPERTY('ProductVersion')) LIKE '13%' THEN 'SQL Server 2016'
@ethzero
ethzero / geoserver
Last active September 26, 2022 22:25 — forked from dancingfrog/geoserver
Sample /etc/init.d script for running GeoServer as a service
#!/bin/sh
### BEGIN INIT INFO
# Provides: GeoServer
# Required-Start: $local_fs $network $named $time $syslog
# Required-Stop: $local_fs $network $named $time $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Description: GeoServer OGC server
### END INIT INFO
@ethzero
ethzero / shutdown-notification.service
Created May 16, 2022 20:07
/etc/systemd/system/shutdown-notification.service
# Installation:
# sudo wget "<this file>" -O /etc/systemd/system/shutdown-notification.service
# sudo systemctl daemon-reload
# sudo systemctl enable shutdown-notification.service
# sudo systemctl list-unit-files | grep 'shutdown-notification.service'
[Unit]
Description=Shutdown Notification
DefaultDependencies=no
Before=shutdown.target
@ethzero
ethzero / boot-notification.service
Last active May 16, 2022 20:09
/etc/systemd/system/boot-notification.service
# Installation:
# sudo wget "<this file>" -O /etc/systemd/system/boot-notification.service
# sudo systemctl daemon-reload
# sudo systemctl enable boot-notification.service
# sudo systemctl list-unit-files | grep 'boot-notification.service'
[Unit]
Description=Boot Notification
After=network-online.target
Wants=network-online.target
@ethzero
ethzero / logitech-c922-settings.sh
Last active November 1, 2023 16:34
Logitech C922 v4l2-ctl settings. Tuned for 3D Printing timelapse photograph in OctoPrint.
# Logitech C922 v4l2-ctl settings. Tuned for 3D Printing timelapse photography in OctoPrint.
# Copyright (C) 2022 <ethzero@ethzero.uk>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@ethzero
ethzero / pistatus.sh
Last active July 1, 2021 14:37
Get power, ARM frequency, CPU throttle, and temperature status of a Raspberry Pi 4
#!/bin/bash
# Source/credit: https://www.raspberrypi.org/forums/viewtopic.php?t=254024
STATUS=$(vcgencmd get_throttled | sed -n 's|^throttled=\(.*\)|\1|p')
if [[ ${STATUS} -ne 0 ]]; then
echo ""
if [ $((${STATUS} & 0x00001)) -ne 0 ]; then
echo "Power is currently Under Voltage"
elif [ $((${STATUS} & 0x10000)) -ne 0 ]; then
# Copyright 2019, Alexander Hass
# https://www.hass.de/content/setup-microsoft-windows-or-iis-ssl-perfect-forward-secrecy-and-tls-12
#
# After running this script the computer only supports:
# - TLS 1.2
#
# Version 3.0.1, see CHANGELOG.txt for changes.
Write-Host 'Configuring IIS with SSL/TLS Deployment Best Practices...'
Write-Host '--------------------------------------------------------------------------------'