Skip to content

Instantly share code, notes, and snippets.

@wojtekadams
wojtekadams / ghost_cms_add_tag.py
Last active October 17, 2025 19:58
This Python script connects to the Ghost Admin API, retrieves all blog posts in batches, and automatically adds a specified tag to each post that doesn’t already have it.
import jwt
import time
import requests
# Instalation
## python3 -m venv ~/python-dev-env
## source ~/python-dev-env/bin/activate
## pip install requests PyJWT
## download ghost_cms_add_tag.py
## edit ghost_cms_add_tag.py -> add url, tag and admin key
@wojtekadams
wojtekadams / stop-all-docker.md
Created September 12, 2025 11:25 — forked from atomkirk/stop-all-docker.md
Stop all Docker containers

I will often run this command to make sure all my docker containers are stopped and removed before running docker-compose up. Sometimes when you restart your system, old containers will start back up automatically in the background.

docker stop $(docker ps -aq) && docker rm $(docker ps -aq)
@wojtekadams
wojtekadams / vnc_xfce.md
Created August 21, 2025 04:38
Installation vnc server xbuntu

Installation

sudo apt install tigervnc-standalone-server tigervnc-commo vncpasswd. vncserver. vncserver -kill :1

$HOME/.vnc/xstartup [*][X] unset SESSION_MANAGER

@wojtekadams
wojtekadams / Cockpit_and_Cloudflare.md
Created August 11, 2025 11:56
Correct configuration to run Cockpit via Cloudflare Zero Trust

/etc/cockpit/cockpit.conf

[WebService]
Origins = https://cloudflare.domain wss://cloudflare.domain http://cockpitIP:9090 wss://cockpitIP:9090
ProtocolHeader = X-Forwarded-Proto
AllowUnencrypted = true

[Session]

Banner = /etc/issue

@wojtekadams
wojtekadams / turis_omnia_router_problems.md
Last active July 15, 2025 12:26
Turis Omnia Router - Problems and solutions

Proxmox - miniDLNA

The miniDLNA service is active, bu serving 0 audio, 0 video and 0 image files.

  1. Login via SSH
  2. Perform command: /etc/init.d/minidlna reload
  3. It is good to add this command to some start scripts -> /etc/rc.local

ZeroTier on OpenWrt

@wojtekadams
wojtekadams / snapshot_turris_omnia.sh
Created July 11, 2025 17:43
Script for Turris Omnia routers creates a schnapps snapshot, exports it, saves it to /srv/backup
#!/bin/bash
set -e
LOGGER_TAG="cron-auto-snapshot"
DESCRIPTION="Auto snapshot $TIMESTAMP by cron"
TIMESTAMP=$(date +"%Y-%m-%d_%H-%M-%S")
BACKUP_DIR="/srv/backups/"
MAX_BACKUPS=5
@wojtekadams
wojtekadams / proxmox_shutdown.sh
Last active July 11, 2025 05:52
Proxmox - script that shuts down VMs and Containers before the hypervisor is shut down
#!/bin/bash
# get list of VMs and LXCs on the node
VMIDs=$(/usr/sbin/qm list | tail -n +2 | awk '/[0-9]/ {print $1}')
LXCs=$(/usr/bin/lxc-ls)
# ask LXCs to stop
for LXC in $LXCs
do
/usr/bin/lxc-stop $LXC
@wojtekadams
wojtekadams / AOC_xrandr_hack.sh
Last active July 13, 2025 18:28
Adding proper resolution in xrandr for AOC monitors
#!/bin/sh
# https://askubuntu.com/questions/377937/how-do-i-set-a-custom-resolution
# cvt 2560 1440
xrandr --newmode "2560x1440_60.00" 312.25 2560 2752 3024 3488 1440 1443 1448 1493 -hsync +vsync
xrandr --addmode HDMI-1-2 "2560x1440"
@wojtekadams
wojtekadams / kde-konsole-tab-colours.css
Last active February 13, 2018 11:46 — forked from codemedic/konsole-with-palette-colours.css
CSS for KDE Konsole minimal, lighter, dark tabs
QTabBar,
QTabBar::tab
{
/* font-size: 11px;*/
/* height: 16px; */
padding: 2px;
border: 0px;
border-bottom: 3px solid palette(dark);
background-color: palette(dark);
color: palette(text);