Skip to content

Instantly share code, notes, and snippets.

View joeypiccola's full-sized avatar
⛰️

Joey Piccola joeypiccola

⛰️
View GitHub Profile
@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
{
"variables": {
"name": "2019-packer",
"guest_os_type": "windows9_64Guest",
"iso_checksum": "7B463563206DCE275F2D3FF77AC36C430052FAE161CD4F8B31F3DC7AF1C3F418",
"iso_url": "file://D:\\ISOs\\en_windows_server_2019_x64_dvd_3c2cf1202.iso",
"iso_path": "[freenas_datastore_0] ISO/en_windows_server_2019_x64_dvd_3c2cf1202.iso",
"iso_checksum_type": "sha256",
"answerfile": "answer_files/2019/vsphere/Autounattend.xml",
"disk_size": "30720",