Skip to content

Instantly share code, notes, and snippets.

@ozskywalker
ozskywalker / Get-NVIDIATemp.ps1
Last active December 21, 2021 16:40
Get NVIDIA GeForce GTX/RTX GPU Temp & Utilization
nvidia-smi --query-gpu=name,temperature.gpu,utilization.gpu,utilization.memory --format=csv,nounits | ConvertFrom-CSV | ForEach-Object -Process { [PSCustomObject]@{ name=$_.name; temperature_gpu=[int]$_."temperature.gpu"; utilization_gpu=[int]$_."utilization.gpu [%]"; utilization_memory=[int]$_."utilization.memory [%]" } } | ConvertTo-Json
@ozskywalker
ozskywalker / ses-forwarder.py
Created February 18, 2021 03:27
quick mod of a SES forwarder Lambda function
"""
This code is a Python 3.6 port of [aws-lambda-ses-forwarder](https://github.com/arithmetric/aws-lambda-ses-forwarder). Follow instructions there for setting up SES and AWS Lambda. It was ported to py2.7 by [skylander86](https://gist.github.com/skylander86/d75bf010c7685bd3f951d2b6c5a32e7b), and then I added the following:
- py3 compatability, obviously.
- MSG_TARGET and MSG_TO_LIST: move the distribution list out of code.
- SUBJECT_PREFIX: add something like `[listname]` to the subject line.
- S3_PREFIX: an optional prefix for the key used to fetch a mail message. Useful if you put your incoming mail in an s3 'directory'.
- Commented out 'from rewriting', instead using 'reply-to' to redirect replies back to the list.
The original was MIT licensed; skylander86's gist doesn't have a license, so it is presumed to still be MIT. This version is copyright 2018 tedder, MIT license.
"""
import React from 'react';
import { Pane, Paragraph, Tablist, SidebarTab, Alert, Avatar, Button, LogOutIcon, IconButton, Heading } from 'evergreen-ui';
class AppMainPage extends React.Component {
state = {
selectedIndex: 0,
tabs: ['Traits', 'Event History', 'Identities'],
showAlert: true
}
version: '3'
services:
elasticsearch:
image: elasticsearch:7.6.0
environment:
- cluster.name=docker-cluster
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms2g -Xmx2g"
- discovery.type=single-node
@ozskywalker
ozskywalker / grey-static.html
Last active May 27, 2020 03:44
Simple TV Static Generator
<html>
<head>
<style>
/* for browsers wo/2d alpha disable support */
#c {background:#000}
html, body {
margin: 0 !important;
padding: 0 !important;
}
@ozskywalker
ozskywalker / installcheck.ps1
Last active February 18, 2021 05:17
MSI Installer
# TODO: change variable expansion method for newer approach ({0}, etc.)
# Exitcodes ($lastexitcode)
# 0: Success
# 1: MSI doesn't exist
# 2: Not our first time
# All other codes (=>13): see https://docs.microsoft.com/en-us/windows/win32/msi/error-codes
# Vars
$workingdir = "C:\\working"