Skip to content

Instantly share code, notes, and snippets.

View rbocchinfuso's full-sized avatar

Richard Bocchinfuso rbocchinfuso

View GitHub Profile
@rbocchinfuso
rbocchinfuso / pytorch-gpu-load.py
Created July 26, 2024 00:37
Create GPU load with PyTorch
import multiprocessing
import torch
from torchvision.models import efficientnet_b0
from pytorch_benchmark import benchmark
def gpu(args):
print(f"Starting workload on GPU{args}")
model = efficientnet_b0().to(f"cuda:{args}") # Model device sets benchmarking device
sample = torch.randn(8, 3, 224, 224) # (B, C, H, W)
results = benchmark(model, sample, num_runs=1000)
@rbocchinfuso
rbocchinfuso / gpu-proc.out
Created July 26, 2024 00:26
GPU Process Monitoring Output
Thu Jul 25 20:23:03 2024
CudaDevice(cuda_index=0, nvml_index=0, name="GeForce GTX 1050 Ti", total_memory=4096MiB)
- Fan speed: 45%
- Temperature: 33C
- GPU utilization: 74%
- Total memory: 4096MiB
- Used memory: 1400MiB
- Free memory: 2696MiB
- Processes (5):
PID USERNAME CPU% HOST-MEM TIME GPU-MEM SM% COMMAND
@rbocchinfuso
rbocchinfuso / og2snow.py
Last active May 17, 2023 17:36
OpsGenie to ServiceNow Automated Action
#!/usr/bin/env python
"""inc-create.py: OG2SNOW Incident Creation"""
# owned
__author__ = 'Rich Bocchinfuso'
__copyright__ = 'Copyright 2020, OG2SNOW Incident Creation'
__credits__ = ['Rich Bocchinfuso']
__license__ = 'MIT'
__version__ = '0.1.0'
__maintainer__ = 'Rich Bocchinfuso'
@rbocchinfuso
rbocchinfuso / ipcam.py
Created March 21, 2018 20:59 — forked from shihyuan/ipcam.py
Stream Video with OpenCV in Python from an Android running IP Webcam
# Stream Video with OpenCV from an Android running IP Webcam (https://play.google.com/store/apps/details?id=com.pas.webcam)
# Code Adopted from http://stackoverflow.com/questions/21702477/how-to-parse-mjpeg-http-stream-from-ip-camera
import cv2
import urllib2
import numpy as np
import sys
host = "192.168.0.220:8080"
if len(sys.argv)>1:
@rbocchinfuso
rbocchinfuso / conv2utf8.ps1
Created June 28, 2018 10:18
Convert to UTF8
Get-ChildItem "C:\Users\gerhardl\Documents\My Received Files" -Filter *.log |
Foreach-Object {
$content = Get-Content $_.FullName
Get-Content $content | Set-Content -Encoding utf8 $content
}
@rbocchinfuso
rbocchinfuso / TheRealDeal.md
Last active February 25, 2022 19:38
CC Digital Innovation Developer Roles, The Real Deal

CC Digital Innovation Roles, The Real Deal

This is what you will be doing void of corporate-speak, like excellent written and verbal communication skills. The DNA of this team is such that just writing communication skills as a basic job requirement agitates us, and it should agitate you.

The Digital Innovation Team is always searching for individuals possessing the right DNA, individuals driven by autonomy, mastery, and purpose. We practice Kung fu. Kung fu refers to any study, learning, or practice requiring patience, energy, and time to complete. We believe that excellence is achieved through discipline and the skill achieved through hard work and practice of one's skills.

As a team of practitioners, we subscribe to universal beliefs, philosophies, and principles, we share forms, but our actions are unique to the practitioner. As a member of the Digital Innovation Team, you'll have two distinct ways in which to contribute as a developer:

Path 1:

@rbocchinfuso
rbocchinfuso / win-svc-auth-validate.py
Last active December 1, 2021 19:21
Windows Service and Auth Validator
#!/home/bocchrj/anaconda3/envs/myenv/bin/python
"""win-svc-auth-validate.py: Windows Service and Auth Validator"""
# Owned
__author__ = 'Rich Bocchinfuso'
__copyright__ = 'Copyright 2021, Windows Service and Auth Validator'
__credits__ = ['Rich Bocchinfuso']
__license__ = 'MIT'
__version__ = '0.1.0'
@rbocchinfuso
rbocchinfuso / nw_daily_rpt.ps1
Last active April 7, 2021 15:09
NetWorker Daily Backup Report
<#
NetWorker Daily Status Report
nw_daily_rpt.ps1
Rich Bocchinfuso 2014-10-23
rbocchinfuso@gmail.com
#>
### vars
$ver="0.1"
$date = Get-Date -Format D
@rbocchinfuso
rbocchinfuso / SlackMessage.js
Created August 24, 2018 20:55
Slack Message Script Include
// ServiceNow Slack Message
// Script Include
// SlackMessage.js
// Rich Bocchinfuso - 2017/05/10
var SlackMessage = Class.create();
var iconurl = 'http://www.gb-advisors.com/wp-content/uploads/2016/06/servicenow-sm-icon.png';
var emoji = ':warning:';
var channel = '#tickets';
@rbocchinfuso
rbocchinfuso / cmd.coffee
Created August 24, 2018 22:09
Simple Hubot CoffeeScript to fire other local commands
# Description:
# Runs a command on hubot
# TOTAL VIOLATION of any and all security!
#
# Commands:
# hubot cmd <command> - runs a command on hubot host
module.exports = (robot) ->
robot.respond /CMD (.*)$/i, (msg) ->
# console.log(msg)