JetBrains/intellij-community / .agents/skills/notebook-for-experiment
notebook-for-experiment
FlaggedCreate reproducible Jupyter notebooks for performance experiments.
| File | Kind | Size |
|---|---|---|
| OWNERSHIP | other | 19 B |
| SKILL.md | skill md | 17.2 KB |
| reference/log-files.md | markdown | 2.8 KB |
| reference/machine-info.md | markdown | 2.5 KB |
| scripts/nb.py | script | 18.6 KB |
reference/machine-info.md
View on GitHub# Machine info cell
Stdlib-only (no psutil), works on Windows, macOS, and Linux:
```python
import platform, subprocess
def _cpu_name() -> str:
s = platform.system()
try:
if s == 'Windows':
# wmic is deprecated on Windows 11; use PowerShell CIM instead.
return subprocess.check_output(
['powershell', '-NoProfile', '-Command',
'(Get-CimInstance Win32_Processor).Name'],
stderr=subprocess.DEVNULL,
).decode().strip()
if s == 'Darwin':
return subprocess.check_output(
['sysctl', '-n', 'machdep.cpu.brand_string'], stderr=subprocess.DEVNULL
).decode().strip()
# Linux
for line in open('/proc/cpuinfo'):
if line.startswith('model name'):
return line.split(':', 1)[1].strip()
except Exception:
pass
return platform.processor() or 'unknown'
def _ram_gb() -> float:
s = platform.system()
try:
if s == 'Windows':
import ctypes
class _M(ctypes.Structure):
_fields_ = [
('dwLength', ctypes.c_ulong),
('dwMemoryLoad', ctypes.c_ulong),
('ullTotalPhys', ctypes.c_ulonglong),
('ullAvailPhys', ctypes.c_ulonglong),
('ullTotalPageFile', ctypes.c_ulonglong),
('ullAvailPageFile', ctypes.c_ulonglong),
('ullTotalVirtual', ctypes.c_ulonglong),
('ullAvailVirtual', ctypes.c_ulonglong),
('sullAvailExtendedVirtual',ctypes.c_ulonglong),
]
m = _M()
m.dwLength = ctypes.sizeof(m)
ctypes.windll.kernel32.GlobalMemoryStatusEx(ctypes.byref(m))
return m.ullTotalPhys / 1024**3
if s == 'Darwin':
out = subprocess.check_output(
['sysctl', '-n', 'hw.memsize'], stderr=subprocess.DEVNULL
).decode().strip()
return int(out) / 1024**3
# Linux
for line in open('/proc/meminfo'):
if line.startswith('MemTotal'):
return int(line.split()[1]) / 1024**2
except Exception:
pass
return float('nan')
print(f"Host : {platform.node()}")
print(f"OS : {platform.system()} {platform.release()} ({platform.version()})")
print(f"CPU : {_cpu_name()}")
print(f"RAM : {_ram_gb():.0f} GB")
```
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| deprecation-and-migrationaddyosmani/agent-skillsManages deprecation and migration. Use when removing old systems, APIs, or features. Use when migrating users from one implementation to another. Use when migrating a database schema in production, such as renaming or dropping a column without downtime (expand/contract). Use when deciding whether to maintain or sunset existing code. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| performance-optimizationaddyosmani/agent-skillsOptimizes application performance across frontend, backend, queries, and databases. Use when performance requirements exist, when you suspect performance regressions, when Core Web Vitals or load times need improvement, when N+1 query patterns need fixing, or when profiling reveals bottlenecks. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| agent-cost-reportthedotmack/claude-memBelievable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude Code transcripts priced at OpenRouter list prices (ESTIMATED), measured provider spend when a sanctioned source exists, note-taker cost separate, Timing-style HTML/PDF plus report.json, line-items.csv, evidence.json. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |
| agent-cost-reportthedotmack/claude-memBelievable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude Code transcripts priced at OpenRouter list prices (ESTIMATED), measured provider spend when a sanctioned source exists, note-taker cost separate, Timing-style HTML/PDF plus report.json, line-items.csv, evidence.json. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |