Skip to content

Instantly share code, notes, and snippets.

@Postrediori
Postrediori / Ubuntu HowTo.md
Last active March 27, 2025 18:09
Ubuntu Tips&Tricks
@Postrediori
Postrediori / Bash-HowTos.md
Last active March 19, 2023 19:48
Various shell-related info

Bash HowTos

Mutiline prompt

PS1='\[\e[36;1m\]+----\[\e[0m\]\[\e[36m\]\[\e[30;1m\][\[\e[0m\]\$
\[\e[32;1m\]\w\[\e[0m\]\[\e[30;1m\]]\[\e[0m\]\n\$
\[\e[36;1m\]+--\[\e[0m\]\[\e[36m\]\[\e[0m\]\$
\[\e[37;1m\]\$\[\e[0m\] '
@Postrediori
Postrediori / GIMP2-loading-fonts.md
Last active July 17, 2023 16:09
Workaround for GIMP2 long font loading during startup

Workaround for GIMP2 long font loading during startup

Navigate to %localappdata%\fontconfig\cache

Sort the files by date and check the most recent ones. There should be:

  • some-long-hash (usually 1MB or more)
  • some-long-hash.NEW (usually 1MB or more, slightly bigger that the one above if you added fonts)

Rename someverylongname to someverylongname.OLD

@Postrediori
Postrediori / Build-ares-emu-on-Fedora.md
Last active May 21, 2024 20:08
Build ares emulator (https://ares-emu.net/) from a source code on a RedHat-based system (including Fedora and CentOS)

Introduction

This document describes hot to build ares emulator from a source code on a Fedora system. This build uses GTK3 as this is the default version available in modern Fedora systems.

ares is a multi-system emulator that is a descendent of higan and bsnes, and focuses on accuracy and preservation.

@Postrediori
Postrediori / Upgrade-DigitalOcean-Ubuntu-Droplet-LTS.md
Last active March 9, 2025 19:56
Upgrade DigitalOcean Ubuntu Droplet to the Next LTS Version

Description

The instructions here cover upgrading Ubuntu droplet from one LTS release to the next one. This was used to incrementally upgrade from Ubutnu 16.04 to 20.04 via 18.04.

Instructions

Perform standard update

@Postrediori
Postrediori / WinHandles.hpp
Created May 29, 2022 12:47
Windows.h replacement for headers by Sebastian Aaltonen (https://twitter.com/SebAaltonen/status/1530152876655386624)
#ifndef __F_WINHANDLES_HPP__
#define __F_WINHANDLES_HPP__
typedef void* HANDLE;
typedef unsigned long long WPARAM;
typedef long long LPARAM;
typedef long long LRESULT;
#define FORWARD_DECLARE_HANDLE(name) structname##__; typedef struct name##__ *name;
FORWARD_DECLARE_HANDLE(HINSTANCE);
@Postrediori
Postrediori / PythonEmbeddable.md
Last active October 7, 2023 17:38
Configure Python Embeddable package for Windows

Python Embeddable

Introduction

This article describes how to add pip, install custom modules and use an interpreter form the embeddable package via batch files.

Download Python Embeddable

@Postrediori
Postrediori / ZshGitStatus.md
Created May 18, 2022 12:47
Show Git status in zsh prompt

Add the following config to .zshrc:

# Load colors
autoload -U colors && colors

# Load version control information
autoload -Uz vcs_info
precmd() { vcs_info }

ImageMagick HowTo

Resize and crop image

convert input.jpg -resize 100x100^ \
                  -gravity Center  \
                  -crop 100x100+0+0 +repage  \
        output.jpg