Skip to content

Instantly share code, notes, and snippets.

View mika's full-sized avatar

Michael Prokop mika

View GitHub Profile
mika /
Created April 13, 2022 16:28 — forked from jkirk/
Access QNAP encrypted HDD with GNU/Linux Debian

QNAP HDD Recovery Test (encrypted)

Removed HDD-2 from NAS (while running) and plugged into a Sharkoon USB-Bay and tried to recover data.

Tried to assemble all existing volumes:

  % sudo mdadm --assemble --scan
  mdadm: /dev/md/9 has been started with 1 drive (out of 24).
  mdadm: /dev/md/256 has been started with 1 drive (out of 2).
mika /
Created May 28, 2021 09:28 — forked from mrpeardotnet/
HP Smart Storage Admin CLI (ssacli) installation and usage on Proxmox PVE (6.x)

HP Smart Storage Admin CLI (ssacli) installation and usage on Proxmox PVE (6.x)

Why use HP Smart Storage Admin CLI?

You can use ssacli (smart storage administrator command line interface) tool to manage any of supported HP Smart Array Controllers in your Proxmox host without need to reboot your server to access Smart Storage Administrator in BIOS. That means no host downtime when managing your storage.

CLI is not as convenient as GUI interface provided by BIOS or desktop utilities, but still allows you to fully manage your controller, physical disks and logical drives on the fly with no Proxmox host downtime.

ssacli replaces older hpssacli, but shares the same syntax and adds support for newer servers and controllers.


mika / docker-cleanup.rst
Created June 25, 2020 12:03
Docker cleanup
View docker-cleanup.rst

DOCS: also refer to

HINT: add the --force option to the cmdlines to not prompt for confirmation (e.g. for usage inside scripts)

Get rid of all stopped containers (list via docker ps --filter status=exited):

% docker container prune

Get rid of all stopped container older than 12 hours:

mika /
Created May 4, 2020 13:29 — forked from timvisee/
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.


  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).
mika /
Last active April 28, 2020 22:12
Bringing Kids to the Computer
mika / debian-10-packer.json
Created April 8, 2020 09:59 — forked from arnaudmorin/debian-10-packer.json
Install new cloud-init on Debian 10 using packer
View debian-10-packer.json
"builders": [
"type": "openstack",
"username": "xxx",
"password": "yyy",
"identity_endpoint": "",
"region": "DE1",
"tenant_id": "zzz",
"image_name": "debian10-arnaud",
View gist:90b9561fd04987b1c63e3ac3e2cf2697
cd bpftrace-0.9.2
dch -l ~bpo10+ -D buster-backports "Rebuild for buster-backports."
dpkg-buildpackage -uc -us -S -d
sudo cowbuilder --build --basepath /var/cache/pbuilder/base-buster-amd64.cow ./bpftrace_0.9.2-2\~bpo10+1.dsc
cd bpftrace-0.9.2
dch -l ~bpo10+ -D buster-backports "Rebuild for buster-backports."
dpkg-buildpackage -uc -us -S -d
mika / zshrc.local
Created August 21, 2019 12:42
grml-zshrc with custom vcs_info
View zshrc.local
## customize vcs_info
zstyle ':vcs_info:git*:*' check-for-changes true
zstyle ':vcs_info:git*:*' unstagedstr '|U'
zstyle ':vcs_info:git*:*' stagedstr '|≠'
# enable hooks, requires Zsh >=4.3.11
if [[ $ZSH_VERSION == 4.3.<11->* || $ZSH_VERSION == 4.<4->* || $ZSH_VERSION == <5->* ]] ; then
# hook for untracked files
+vi-untracked() {
if [[ $(git rev-parse --is-inside-work-tree 2>/dev/null) == 'true' ]] && \
mika / psql_internals_cheatsheet.sql
Created June 15, 2019 10:19 — forked from azet/psql_internals_cheatsheet.sql
PostgreSQL internals SQL collection
View psql_internals_cheatsheet.sql
# long running queries:
now() - pg_stat_activity.query_start AS duration,
FROM pg_stat_activity
WHERE (now() - pg_stat_activity.query_start) > interval '5 minutes';
## active queries and killing them: