Skip to content

Instantly share code, notes, and snippets.

View jarryDk's full-sized avatar

Michael Bornholdt Nielsen jarryDk

View GitHub Profile
@jarryDk
jarryDk / readme.md
Created April 24, 2025 12:04
How can I change the commit author for a single commit?

Interactive rebase off of a point earlier in the history than the commit you need to modify (git rebase -i <earliercommit>). In the list of commits being rebased, change the text from pick to edit next to the hash of the one you want to modify. Then when git prompts you to change the commit, use this:

git commit --amend --author="Author Name <[email protected]>" --no-edit

For example, if your commit history is A-B-C-D-E-F with F as HEAD, and you want to change the author of C and D, then you would...

  1. Specify git rebase -i B (here is an example of what you will see after executing the git rebase -i B command)
@jarryDk
jarryDk / script_dir.sh
Created December 17, 2024 07:30
Get the directory where a Bash script is located from within the script itself
#!/usr/bin/env bash
#
# Get the directory where a Bash script is located from within the script itself
#
# https://stackoverflow.com/questions/59895/how-do-i-get-the-directory-where-a-bash-script-is-located-from-within-the-script#246128
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
#!/bin/bash
mkdir -p /run/user/$(id -u)/podman
export DOCKER_HOST="unix:/run/user/$(id -u)/podman/podman.sock"
podman system service --time=0 unix:/run/user/$(id -u)/podman/podman.sock &
#!/bin/bash
#
# Get and array of containers and the network name of the container
#
dnf list jq -y
podman ps --format json | jq '[ .[] | { name: .Names[0], network: .Networks[0] } ]'

Keybase proof

I hereby claim:

  • I am jarrydk on github.
  • I am jarry_dk (https://keybase.io/jarry_dk) on keybase.
  • I have a public key ASCJLrQWFNgf9lvq5k6wUTmWhtcQpf9KjqxqZwiJh2vXogo

To claim this, I am signing this object:

@jarryDk
jarryDk / wksFedora.md
Created May 16, 2022 05:00 — forked from verchalent/wksFedora.md
Installing the Amazon WorkSpaces Linux Client on RPM based Distros

Summary

Amazon released a Linux based client for the WorkSpaces service in Novermber of 2019 (https://aws.amazon.com/about-aws/whats-new/2019/11/amazon-workspaces-introduces-workspaces-client-for-linux/). Unfortunately, for non-Ubuntu users, the offical instructions (https://docs.aws.amazon.com/workspaces/latest/userguide/amazon-workspaces-linux-client.html#linux_setup) only list Ubuntu support and only a Deb package is provided. This guide will show how to install and use the client on RPM based distros like Fedora.

Steps

Install Dependancies

The WorkSpaces client requires the ackages gtk3, libsoup and webkit2gtk3. These should already be installed, but you can install them with the following command if they are now.

sudo dnf install webkit2gtk3 libsoup gtk3
@jarryDk
jarryDk / workspaces-linux-client-rpm.md
Last active May 14, 2022 18:32 — forked from nhira/workspaces-linux-client-rpm.md
How to install Amazon Workspaces Linux Client for Fedora
@jarryDk
jarryDk / start-server-with-pid.sh
Last active January 8, 2022 09:13
Script will restart a Minecraft server after a Crash and in the process remove pid created by the script, remove ./world/session.lock and kill old process if still running.
#!/bin/bash
MINECRAFT_VERSION=1.18.1
set -euo pipefail
cd ${0%/*}
PIDFILE=./minecraft.pid
SESSION_LOCK=./world/session.lock
GREEN='\033[0;32m'
@jarryDk
jarryDk / niceFormatXml.sh
Last active June 22, 2021 09:02
Nice format xml via script
#!/bin/bash
# Link: https://stackoverflow.com/questions/16090869/how-to-pretty-print-xml-from-the-command-line#16090892
#
# This utility comes with libxml2-utils: https://gitlab.gnome.org/GNOME/libxml2
#
echo '<root><foo a="b">lorem</foo><bar value="ipsum" /></root>' |
xmllint --format -
@jarryDk
jarryDk / getReadyToBuildJdk.sh
Last active February 12, 2021 19:48
Get ready to build jdk on Fedora
#!/bin/bash
#
# Get ready to build openjdk/jdk on Fedora
#
# You can easilly forget fontconfig-devel if you follow the builder guide
# https://github.com/openjdk/jdk/blob/master/doc/building.md
#
sudo dnf install \