Skip to content

Instantly share code, notes, and snippets.

@ag88
ag88 / sdimage-u-boot-patcher.py
Last active April 27, 2024 08:38
linux sd image u-boot patcher - e.g. Armbian etc
#!/usr/bin/env python3
#usage: sdimage-u-boot-patcher.py [-h] [--nobak] [--ignimgsize] [--bkname BKNAME] image uboot_bin
#
#patch u-boot binary into image
#
#positional arguments:
# image image file
# uboot_bin u-boot bin file
#
#options:
@ag88
ag88 / pstop.py
Last active May 6, 2024 07:48
Linux check cpu hog processes
#!/usr/bin/env python3
#
# requires psutil (pip3 install psutil)
#
# This script runs ps_util.cpu_percent(interval=0.5) for each process to calc
# the cpu utilization percentage
# It does so concurrently as otherwise each calls sleeps 0.5 secs to sample the data
# to run it faster use more threads in ThreadPoolExecutor(max_worker=x or
# reduce the interval for cpu_percent(interval=x
# To make readings more 'accurate' use a longer interval e.g. 1.0 for 1s.
@ag88
ag88 / DataListPanel.html
Created April 16, 2025 08:45
Apache Wicket reusable Data List
<html xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd">
<body>
<wicket:panel>
<table id="dataitems" class="table table-striped">
<thead class="table-secondary">
<th class="col-md-1" wicket:id="hdrRepeater"></th>
</thead>
<tbody>
<wicket:container wicket:id="dataRepeater"></wicket:container>
</tbody>