# topmem Script Setup Notes
**Machine:** Lenovo ThinkPad T14 Gen 2
**OS:** Ubuntu 24.04 LTS (Dual Boot)
**Date:** March 24, 2026
---
## Overview
`topmem` is a shell script that shows memory usage aggregated by process name. Unlike `ps aux` which lists every individual process instance separately, `topmem` collapses multiple instances of the same program (e.g. multiple `node` or `chrome` processes) and shows their combined memory footprint — making it easy to answer "which application is usin# topcpu Script Setup Notes
**Machine:** Lenovo ThinkPad T14 Gen 2
**OS:** Ubuntu 24.04 LTS (Dual Boot)
**Date:** March 24, 2026
---
## Overview
`topcpu` is a shell script that shows CPU usage aggregated by process name. Unlike `ps aux` which lists every individual process instance separately, `topcpu` collapses multiple instances of the same program (e.g. multiple `node` or `chrome` processes) and shows their combined CPU footprint — making it easy to answer "which application is consuming #!/bin/bash
WATCH=false
INTERVAL=30
COUNT=10
if [[ "$1" == "-w" ]]; then
WATCH=true
[[ -n "$2" && "$2" =~ ^[0-9]+$ ]] && INTERVAL="$2"
elif [[ -n "$1" ]]; then
COUNT="$1"
fi
run() {
free -h | awk '/^Mem:/ {printf "Memory: %s used / %s total\n", $3, $2}'
echo "────────────────────────────────────────"
ps aux | awk 'NR>1 {mem[$11]+=$4} END {for (p in mem) printf "%6.2f%% %s\n", mem[p], p}' | sort -nr | head -n "$COUNT"
}
if $WATCH; then
while true; do
clear
#!/bin/bash
WATCH=false
INTERVAL=30
COUNT=10
if [[ "$1" == "-w" ]]; then
WATCH=true
[[ -n "$2" && "$2" =~ ^[0-9]+$ ]] && INTERVAL="$2"
elif [[ -n "$1" ]]; then
COUNT="$1"
fi
run() {
cpu_used=$(top -bn1 | grep '%Cpu' | awk '{printf "%.1f", 100 - $8}')
cores=$(nproc)
printf "CPU: %s%% used / %s cores total\n" "$cpu_used" "$cores"
echo "────────────────────────────────────────"
ps aux | awk 'NR>1 {cpu[$11]+=$3} END {for (p in cpu) printf "%6.2f%% %s\n", cpu[p], p}<script type="application/ld+json">
[
{
"@context": "https://schema.org",
"@type": "BlogPosting",
"headline": {{ article.title | json }},
"description": {% if article.excerpt != blank %}{{ article.excerpt | strip_html | truncate: 300 | json }}{% else %}{{ article.content | strip_html | truncate: 300 | json }}{% endif %},
"image": [
{% if article.image != blank %}{{ article.image | image_url: width: 800 | prepend: 'https:' | json }}{% else %}""{% endif %}
],
"a/**
* Definition for singly-linked list.
* function ListNode(val, next) {
* this.val = (val===undefined ? 0 : val)
* this.next = (next===undefined ? null : next)
* }
*/
/**
* @param {ListNode} head
* @return {ListNode}
*/
var deleteMiddle = function(head) {
// 1. Edge case: only one node
if (!head.next) return null;
// 2. Find the node BEFORE the middle
let slow = head;
let fast = head.next.next;
while (fast && fast.next) {
slow = slow.next;
/bitrix/admin/1c_exchange.php?type=sale&mode=checkauth
/bitrix/admin/1c_exchange.php?type=sale&mode=init&sessid=ID_Сессии
/bitrix/admin/1c_exchange.php?type=sale&mode=query&sessid=ID_СессииB
B
C
C
A
hills
bus
5
picnic
map
B
E
D - A
F
G
D
B
C
I - H
A
D
A
H
E - B
G
sand
lower part
? undercut
? the coastguard
mobile phones
personality
numerous - mean
verbal
psychological
? literacy
extremes
assessment? - interpretation
brain damage
school
reliability
Vocabulary:
red tape
ears popedHere are five distinct iterations of the Chicano tattoo-style theme, each expanding the narrative and scenery while maintaining the fineline black-and-grey aesthetic on vintage parchment.
### 1. The Boulevard Cruise
This scene shifts focus to a late-night cruise down Whittier Boulevard. The **Chevrolet lowrider** is depicted in motion, its front end hopped high in a "three-wheel motion" stance, captured with dynamic motion lines and blurred stippling. The **two skeleton figures** are seated /**
* Definition for singly-linked list.
* function ListNode(val, next) {
* this.val = (val===undefined ? 0 : val)
* this.next = (next===undefined ? null : next)
* }
*/
/**
* @param {ListNode} head
* @return {number}
*/
var pairSum = function(head) {
// 1. Find middle using slow/fast pointers
let slow = head, fast = head;
while (fast && fast.next) {
slow = slow.next;
fast = fast.next.next;
}
// 2. Reverse second half
let prev = null, curr{
"outputStyle": "Explanatory",
"enableAllProjectMcpServers": true,
"permissions": {
"defaultMode": "acceptEdits",
"allow": ["Read", "Skill", "Bash", "Ide*", "WebSearch", "WebFetch", "mcp__*"]
}
}
/**
* @param {string[]} words
* @param {number[]} weights
* @return {string}
*/
var mapWordWeights = function(words, weights) {
let out = "";
for (const w of words) {
let sum = 0;
// Sum weights of characters
for (const ch of w) {
sum += weights[ch.charCodeAt(0) - 97]; // 'a' = 97
}
// Modulo 26
const v = sum % 26;
// Reverse alphabetical mapping: 0→'z', 1→'y', ..., 25→'a'
const mapped = String.fromCharCoJe veux comprendre Fabric en profondeur.
Mon niveau : développeur Python/Django.
Explique-moi d’abord le problème que cette technologie résout,
Puis les concepts clés, puis un exemple simple, puis un cas réel professionnel.
Pose-moi des questions pour vérifier ma compréhension.export PS1="\n\
\[\033[38;2;255;249;143m\] \w\n\
\[\033[38;2;255;90;91m\] ⏹\
\[\033[38;2;250;190;36m\]⏹\
\[\033[38;2;42;197;67m\]⏹\
\[\033[0m\] \
\[\033[38;2;120;150;255m\]ubuntu-clean \
\[\033[38;2;140;170;255m\]❱ \
\[\033[0m\] "SUDO() {
if [ "$(id -u)" -ne 0 ] && command -v sudo >/dev/null 2>&1; then
sudo "$@"
else
"$@"
fi
}
cc() {
if command -v tput >/dev/null 2>&1 && [ -n "${TERM:-}" ] && tput reset 2>/dev/null; then
return
fi
clear
}
alias apti='SUDO apt install -y'
alias aptu='SUDO apt update'
alias aptcc='SUDO apt autoremove -y && SUDO apt-get autoclean'
alias aptc='SUDO apt clean'
alias aptup='SUDO apt update && SUDO apt upgrade -y'
alias mkdir='mkdir -p'
alias/**
* @param {number[][]} edges
* @param {number[][]} queries
* @return {number[]}
*/
var assignEdgeWeights = function(edges, queries) {
const n = edges.length + 1;
const g = Array.from({ length: n + 1 }, () => []);
for (const [u, v] of edges) {
g[u].push(v);
g[v].push(u);
}
// --- 1) BFS to compute depth + parent[0] ---
const LOG = 17; // since n <= 1e5, log2(1e5) < 17
const parent = Array.from({ length: LOG }, () => Array(n + 1).fill(0));
c