Skip to content

Instantly share code, notes, and snippets.

View jerryc05's full-sized avatar
🥇
Experienced bug writer

jerryc05 jerryc05

🥇
Experienced bug writer
  • WA
  • 18:40 (UTC -07:00)
View GitHub Profile
Get-CimInstance -ClassName Win32_Processor | Select-Object -Property Name, NumberOfCores, NumberOfLogicalProcessors | Format-List; (Get-ItemProperty -Path "HKLM:\SYSTEM\ControlSet001\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0*" -Name "HardwareInformation.AdapterString", "HardwareInformation.qwMemorySize" -Exclude PSPath -ErrorAction SilentlyContinue) | ForEach-Object { [PSCustomObject] @{ Model=$_."HardwareInformation.AdapterString"; "VRAM (GB)"=[math]::round($_."HardwareInformation.qwMemorySize"/1GB) } }; Get-CimInstance -ClassName Win32_PhysicalMemory | Select-Object @{Name='Mem (GB)'; Expression={$_.Capacity / 1GB}}, Speed | Sort-Object | Format-Table -AutoSize; Get-CimInstance MSFT_PhysicalDisk -Namespace Root\Microsoft\Windows\Storage | select Model, MediaType, SpindleSpeed
@jerryc05
jerryc05 / ffmpeg.md
Created May 10, 2023 10:30
ffmpeg tldr
ffmpeg -i in.mp4 -ss 00:00 [-to 5:0] -c copy -map 0 out.mp4
ffmpeg -i in.mp4 -ss 00:00 [-t 5:0] -c copy -map 0 out.mp4
#!/usr/bin/env python3
# pip3 install dnspython pythonping
# github.global.ssl.fastly.net
#
# github.com
# gist.github.com
# assets-cdn.github.com
#
@jerryc05
jerryc05 / access_cache.py
Created April 24, 2021 06:09
Timing for accessing cache with TLB
#!usr/bin/env python3
from fractions import Fraction
if __name__ == '__main__':
cols = 60
titles = ('Memory Component', 'Hit Rate (in %)', 'Access Time (cycles)')
mcs = ('TLB', 'Cache', 'Main Mem', 'Disk')
hr_at: 'list[list[Fraction]]' = []
for mc in mcs:
@jerryc05
jerryc05 / 3c_problem.py
Last active January 5, 2022 16:45
3c's Problem
#!usr/bin/env python3
from dataclasses import dataclass
from math import log2, floor
from typing import cast, Set
if __name__ == '__main__':
n_set_, n_blk_, n_sz_, cols = '# of total sets: ', '# of total blocks: ', 'block size in bytes: ', 60
n_set = int(input(n_set_))
n_blk = int(input(n_blk_))
@jerryc05
jerryc05 / rsa.cpp
Last active January 5, 2022 16:45
Stupid EECS 376 RSA Calculator
#include <array>
#include <cassert>
#include <ctgmath>
#include <iostream>
#include <vector>
#define PHI "\u03C6"
#define MUL "\u00D7"
static constexpr