Skip to content

Instantly share code, notes, and snippets.

@dogukancagatay
dogukancagatay / list-remove-repo-gpg-keys.md
Created January 6, 2025 09:43
List and remove repository GPG keys on Fedora

List and Remove Repository GPG Keys

This is especially useful when server GPG keys are updated.

List the repository GPG keys that are currently installed with

sudo rpm -q gpg-pubkey --qf '%{NAME}-%{VERSION}-%{RELEASE}\t%{SUMMARY}\n'
@dogukancagatay
dogukancagatay / TraefikSetup.ps1
Last active December 4, 2024 13:48
Traefik service installer for Windows
# Before running you need to modify the Execution policy from Administrator Powershell console
# Set-ExecutionPolicy -Force -ExecutionPolicy RemoteSigned
# .\TraefikSetup.ps1
$TraefikHome = "C:\Traefik"
$TraefikRelease = "v2.1.4"
$NssmHome = "C:\nssm"
$NssmRelease = "2.24"
@dogukancagatay
dogukancagatay / karabiner-ms-ergonomic.json
Created November 25, 2024 15:12
Karabiner key mapping configuration for Microsoft Ergonomic Keyboard on MacOS
{
"profiles": [
{
"complex_modifications": {
"rules": [
{
"description": "Map Microsoft Ergonomic keyboard lock button",
"manipulators": [
{
"from": {
@dogukancagatay
dogukancagatay / export_import_gpg_keys.md
Created July 30, 2024 08:06
Export and import GPG keys

List your secret keys, and decide which one to export.

gpg --list-secret-keys --keyid-format LONG

Export the secret and public parts of the key.

gpg --export --armor  > gpg-pub.asc
@dogukancagatay
dogukancagatay / prepare-commit-msg.sh
Last active July 16, 2024 10:59
Git hook that prepends Jira issue ID from the branch name to the commit message
#!/usr/bin/env bash
#
# Git hook that appends Jira issue ID from the branch name to the commit message.
#
# e.g. for the branch name `feature/ABC-1234/add-xyz`, the `[ABC-1234]`
# is added to the commit message as well as summary.
#
# Installation:
# $ curl -fsSL -o .git/hooks/prepare-commit-msg \
# 'https://gist.githubusercontent.com/dogukancagatay/38792bf7ace99817555389e043ed954a/raw/prepare-commit-msg.sh'
@dogukancagatay
dogukancagatay / extract_rpm.sh
Last active June 20, 2024 11:50
Extract contents of RPM file
#!/usr/bin/env bash
# Reference: https://stackoverflow.com/questions/18787375/how-do-i-extract-the-contents-of-an-rpm
# cpio flags
# -i = extract
# -d = make directories
# -m = preserve modification time
# -v = verbose
mkdir contents; cd contents
@dogukancagatay
dogukancagatay / rpi4-fedora-boot-fix.md
Created June 8, 2024 21:56
Fix Fedora booting issue on Raspberry Pi 4

When added --args "nomodeset" to arm-image-installer command, booting problem was fixed.

sudo arm-image-installer \
  --image=Fedora-Server-40-1.14.aarch64.raw.xz \
  --target=rpi4 \
  --media=/dev/sda \
  --resizefs \
  --args "nomodeset"
@dogukancagatay
dogukancagatay / first-steps-fedora-40.md
Last active July 31, 2024 09:24
First steps fedora 40

Fedora First Steps

Enable RPMFusion repositories

sudo dnf install -y https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm

Essential Apps

@dogukancagatay
dogukancagatay / trigger-timedatectl-sync.py
Created March 14, 2024 08:27
Python script to force timedatectl NTP time sync
import socket
import struct
import subprocess
import time
REF_TIME_1970 = 2208988800 # Reference time
def get_ntp_time(addr="0.de.pool.ntp.org") -> int | None:
client = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
@dogukancagatay
dogukancagatay / macos_vm_parallels.md
Created February 8, 2024 14:44
Create MacOS VM on Parallels #macos #parallels #vm

Create MacOS VM on Parallels

Download ipsw image for the desired version of the MacOS. Use the following site to get the link.

wget 'https://updates.cdn-apple.com/2024WinterFCS/fullrestores/042-78241/B45074EB-2891-4C05-BCA4-7463F3AC0982/UniversalMac_14.3_23D56_Restore.ipsw'