Skip to content

Instantly share code, notes, and snippets.

@volcan01010
volcan01010 / terminal_gifs.md
Created January 13, 2022 09:40
Creating animated GIFs of terminal output

There are various ways to create animated GIFs for terminal output. Three methods that can be used on Linux (in this case Ubuntu) are described below.

asciinema + asciicast2gif

This is probably the easiest way. The disadvantage of this method is that when I tried to record an animation of a progress bar created with the Python Rich library, it didn't show up.

Asciinema can be be installed with pip install asciinema

@volcan01010
volcan01010 / README.md
Last active December 21, 2021 10:20
Python script to scan self-hosted Docker registry for the Log4Shell vulnerability (CVE-2021-4228) using Trivy and python-dxf

scan_registry.py

A Python script to scan all accessible containers in a self-hosted Docker registry for the Log4Shell vulnerability (CVE-2021-4228). It uses Trivy and python-dxf.

Dependencies

The script is compatible with Python 3.6+

# Upgrade pip and DXF
@volcan01010
volcan01010 / terminalizer_install.md
Last active March 8, 2023 17:31
Install instructions for terminalizer on Ubuntu 18.04 and 20.04

Terminalizer is tool for recording terminal sessions and turning them into animated gifs. It's a way to demonstrate command line tools or share workflows. Unfortunately, there are a few hoops to jump through to install it on Ubuntu. The issues seem to be with where the global npm installer tries to put the files and the permissions that they have.

asciinema and asciicast2gif produce simpler output but are easier to install.

Here are the steps that worked for me:

Installation

Ubuntu 20.04

@volcan01010
volcan01010 / README.md
Last active August 27, 2023 20:41
Desktop database frontend application in under 100 lines using Python and Flask

A simple, standalone frontend for database editing using Python. It is based on the following libraries:

  • sqlalchemy: database connections and data models
  • Flask: web application framework
  • Flask-Admin: provides ModelView class for data model editing
  • pywebview: uses PyQT to provide webview GUI window containing application

Features

@volcan01010
volcan01010 / minidlna_media_server.yml
Created January 15, 2019 22:32
Ansible playbook to setup minidlna media server e.g. Raspberry Pi to sharing videos from network drive (Samba)
# Ansible playbook to set up minidlna server to serve video from USB drive plugged into router
# Videos are on Samba share at //192.168.1.1/share
---
- hosts: all
become: yes
tasks:
- name: Install minidlna and cifs
apt:
name: [minidlna, cifs-utils]
state: present