Skip to content

Instantly share code, notes, and snippets.

View akwala's full-sized avatar

aslam karachiwala akwala

View GitHub Profile
# Store non-visible GitHub package state.
@akwala
akwala / powerMgmt-haswellDesktop.md
Last active August 29, 2015 14:22
CPU Power Management for Intel Haswell Chips

These notes are for Intel Haswell desktop chips running Linux. YMMV depending on the specific processor and Linux distro/version.

(User's Guide)

The following will generate a snapshot of everything powertop measures in a file called powertop.html, which can then be viewed in a web browser:

> sudo powertop --html
@akwala
akwala / fileLines2Array.sh
Last active October 22, 2019 12:15
Bash function to read the lines of a file into an array using the builtin 'mapfile'.
#!/bin/bash
### Pretty-print dedicated (array) var, MAPFILE.
prettyPrintMAPFILE() {
let i=0
echo "[MAPFILE]"
for l in "${MAPFILE[@]}"
do
echo "$i. |$l|"
let i++
done