Skip to content

Instantly share code, notes, and snippets.

# -------------------------
# Bash stuff
# -------------------------
Never understood arrays in bash (even though they were added in bash2.0 - 2009)
This explains them:
(can you compare bash to perl5?
No, when declaring a data structure in bash, then you cannot nest a map inside an array or map.
Also runs slower - bash interpreted line by line, instead of bytecode translation/execution of perl5
@MoserMichael
MoserMichael / windows_survival_guide.txt
Created June 12, 2026 05:20
windows_survival_guide
# -------------------------
# Windows stuff
# -------------------------
You may find yourself to wonder, why the mouse cursor disappeared on what seems to be your laptop, while you do see a mouse cursor in the windows login screen, prior to login.
after login:
press Windows and I key, simultaneously, to jump to the 'Windows Settings' dialogue
@MoserMichael
MoserMichael / video-audio-manipulation.txt
Created June 12, 2026 05:06
video-audio-manipulation
# --------------------------------------------
# video / audio manipulation with command line
# --------------------------------------------
# downloading youtube videos via command line...
# yt-dlp (best to use it via virtual env)
# installing yt-dl
# - (never do apt-get install - this doesn't work here)
@MoserMichael
MoserMichael / google-gist-and-search.txt
Last active June 12, 2026 05:01
google-gist-and-search
Alternatives:
https://search.brave.com/ - they maintain their own crawlers & index. It is surprisingly good
(some people say that regular (non ai mode) google search is getting worse and worse)
---
Link to google in AI mode, with the option to chat with a LLM.
Probably uses Gemini of various versions, the version can probably vary - according to task.
@MoserMichael
MoserMichael / curl-tcpdump-netstat.txt
Last active June 12, 2026 04:53
curl-tcpdump-netstat
# -------------------------
# tcpdump packet capture
# -------------------------
# capture tcp to and from port 9393 (-n tells not to translate port numbers)
# just logs a message for each packet with tcp flags, sequence number, without the data
# Note! for SYN / SYN-ACK the real sequence number/ack number is shown, all other packets get relative sequence number
# (relative to initial sequence number)
# use brew on the mac, this installs ollama that has been compiled with the metal library
# metal is a library that uses the native GPU on the M3 processor
brew install ollama
# check that metal is in use
# if metal is installed correctly, you will see a line like this on the screen:
# "inference compute" ... library=Metal ...
OLLAMA_DEBUG=1 ollama serve
# next thing we want to do: load the claude model
@MoserMichael
MoserMichael / learning-lama-cpp.md
Last active January 28, 2026 00:48
learning-lama.cpp

llama.cpp - reading the source code

looking through the llama.cpp source code, to learn about language models. Disclaimer: it's january 2026, so things will likely change, at some point.

  • llama.cpp repo link
  • build instructions
    • contains instructions on how to build the debug version
    • default build creates devices: 'libggml-base.so' and 'libggml-cpu.so' - probably need to set up additional requirements for the other backends.
    • if you need additional backends: documentation on each backend includes build instructions
  • looking at main.cpp for llama-simple - a CLI program to continue with a given prompt, specified on the command line. command line: ./llama-simple -m model.gguf [-n n_predict] [-ngl n_gpu_layers] {prompt-text}
@MoserMichael
MoserMichael / readme.md
Last active January 23, 2026 10:13
stupid_slurs_datascience

not very politically correct gist

I am taking the json from the following gist original rsdb gitst - local copy It contains a json with a set of records on racial and ethnical slurs.

Wrote a python script that does the following things

@MoserMichael
MoserMichael / learning_about.md
Last active February 1, 2026 08:09
meditation

Learning about the concept

Wikipedia on Meditation

The objectives of mediation

  • Reach a "mentally clear and emotionally calm and stable state".
  • other objectives:
    • "improve focus by decreasing self-referential chatter"
    • minimize "mind-wandering (aka spontaneous drift, shift of attention to 'something personal')
  • minimize rumination (repetitive thought pattern where the mind becomes "stuck" on negative content) and