Skip to content

Instantly share code, notes, and snippets.

View joeypiccola's full-sized avatar
⛰️

Joey Piccola joeypiccola

⛰️
View GitHub Profile
esphome:
name: aqi-a-esp
friendly_name: aqi-a-esp
esp8266:
board: d1_mini
# Enable Home Assistant API
api:
encryption:
@joeypiccola
joeypiccola / runme.ps1
Created November 9, 2023 18:28
runme.ps1
whoami
@joeypiccola
joeypiccola / go_json_response.json
Created October 24, 2023 19:17
go api exercise
// this is what main.go returns
{
"main": {
"temp": 296.52,
"pressure": 1002,
"humidity": 23
}
}
# gets a list of all vms
$vms = Get-VM
# creates an empty array
$vmArray = @()
# loops through each vm
foreach ($vm in $vms) {
# creates a custom object
$vmObj = [PSCustomObject]@{
@joeypiccola
joeypiccola / class_example.ps1
Last active June 23, 2021 02:40
Simple class example for an API Get call to thecatapi.com
class cat_breed {
[string]$name
[string]$origin
[string]$id
[String]$alt_names
static [cat_breed[]] Get(
[string]$name,
[string]$token
) {
---
version: "2"
services:
sabnzbd:
image: linuxserver/sabnzbd:latest
mem_limit: 4294967296
container_name: sabnzbd
environment:
- TZ=America/Denver
- PGID=1001
#!/usr/bin/python3
# setup python
import time
import RPi.GPIO as GPIO
from unifi_video import UnifiVideoAPI
import http.client, urllib
import pycurl
import requests
---
profile::base::localaccounts::groups:
Administrators:
members:
- mydomain\myuser
@joeypiccola
joeypiccola / log.pp
Created January 16, 2020 18:48
moving puppet event logs on windows from the app event log to a dedicated puppet event log
# move puppet windows events out of the Application log into a new log named Puppet
if $facts['os']['family'] == 'windows' {
registry_key { 'Application_Puppet':
ensure => absent,
path => 'HKLM\SYSTEM\CurrentControlSet\Services\EventLog\Application\Puppet',
}
registry_key { 'Puppet_Puppet':
ensure => present,
path => 'HKLM\SYSTEM\CurrentControlSet\Services\EventLog\Puppet\Puppet',
require => Registry_key['Application_Puppet'],
@joeypiccola
joeypiccola / main.yml
Created November 19, 2019 02:35
general telegraf config for ras pi
---
- name: Set hostname
become: true
tags: host
hostname:
name: "{{ hostvars[inventory_hostname].hostname }}"
- name: Copy over hosts file
become: true