Skip to content

Instantly share code, notes, and snippets.

@mackatozis
mackatozis / git-reset-author.bsh
Created November 25, 2022 17:22
Git: reset author for ALL commits
#!/bin/bash
git filter-branch -f --env-filter '
OLD_EMAIL="xxxxxxxxxxxxxxxxxxxxxxxxxx"
CORRECT_NAME="zzzzzzzzzzzzzzzzz"
CORRECT_EMAIL="yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy"
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
then
export GIT_COMMITTER_NAME="$CORRECT_NAME"
export GIT_COMMITTER_EMAIL="$CORRECT_EMAIL"
import java.util.List;
import lombok.Data;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Flux;
@RestController
@RequestMapping(produces = MediaType.APPLICATION_JSON_VALUE)
@mackatozis
mackatozis / maven-settings.xml
Created June 20, 2022 16:58 — forked from cyrille-leclerc/maven-settings.xml
Maven's default settings.xml
<?xml version="1.0" encoding="UTF-8"?>
<!--
file-system-maven-settings
-->
<!--
| This is the configuration file for Maven. It can be specified at two levels:
|
| 1. User Level. This settings.xml file provides configuration for a single user,
@mackatozis
mackatozis / cpu-usage.bsh
Last active January 6, 2023 05:37
A simple script that prints the CPU usage of a process
#!/bin/bash
# A simple script that prints the CPU usage
# of a process with ten (10) decimals points
# (based on this https://stackoverflow.com/a/1424556/1930099).
#
# Usage: bash cpu-usage.bsh {PID_NUM}
PID=$1 # The process id
CLK_TCK=$(getconf CLK_TCK) # CPU clock ticks
import java.util.Comparator;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.stream.Collectors;
import lombok.AllArgsConstructor;
import lombok.Data;
public class SortMapByValueProperty {
public static void main(String[] args) {