Skip to content

Instantly share code, notes, and snippets.

View aaiezza's full-sized avatar

Alessandro Aiezza aaiezza

View GitHub Profile
@aaiezza
aaiezza / zfsCommands.md
Last active December 1, 2023 17:31
ZFS

Here are some helpful commands for managing ZFS and ZPool on Ubuntu

VDEV

Useful for populating /etc/zfs/vdev_id.conf:

printDisks() {
    for i in /dev/sd[b-i]; do
        fdisk -l $i
@aaiezza
aaiezza / README.md
Last active November 8, 2022 21:54
Loggly Event Delta Calculation

How to use this

Pre-requisites

  • Install R
  • run install.packages('parsedate') in your r shell

Use the script

  1. Get your Loggly results for some event and export the results as a csv.
@aaiezza
aaiezza / Pipfile
Last active April 3, 2023 16:13
Power Up Rewards | The partial pin code problem
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"
[packages]
requests = "*"
[dev-packages]
pytest = "*"
@aaiezza
aaiezza / EmployerRetirementContributionCalculator.java
Last active November 24, 2021 20:06
Calculate 401K employer match based on a tiered-contribution-matching system
package challenge;
import static challenge.EmployerRetirementContributionCalculator.EmployeeContribution.employeeContribution;
import static challenge.EmployerRetirementContributionCalculator.EmployerContribution.Tier.Percentage.REMAINING_AMOUNT;
import challenge.EmployerRetirementContributionCalculator.EmployerContribution.Amount;
import challenge.EmployerRetirementContributionCalculator.EmployerContribution.EmployeeContributionMatched;
import java.util.List;
import java.util.concurrent.atomic.AtomicReference;
@aaiezza
aaiezza / CombinationsOfDice.java
Last active August 22, 2021 15:49
Produce combinations of dice
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class CombinationsOfDice {
public List<int[]> execute(final int numberOfDice, final int numberOfSidesPerDice) {
final List<int[]> list = new ArrayList<>();
final int[] combination = new int[numberOfDice];
int index;
@aaiezza
aaiezza / RandomOptionChooser.java
Created April 21, 2021 14:33
Choose a random option
import static java.util.Collections.shuffle;
import static java.util.stream.Collectors.collectingAndThen;
import static java.util.stream.Collectors.toList;
import java.util.Optional;
import java.util.stream.Collector;
import java.util.stream.Stream;
public class RandomOptionChooser {
public Optional<Option> randomlyChooseAnOption(@lombok.NonNull final String... options) {
@aaiezza
aaiezza / CombinationGetter.java
Created March 7, 2021 21:04
Algorithm for iterating through combinations of numbers
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
public class CombinationGetter {
public List<int[]> getCombinations(final int n, final int min, final int k) {
final List<int[]> list = new ArrayList<>();
@aaiezza
aaiezza / loz_windwaker_checklist.md
Last active July 17, 2024 22:38
The Legend of Zelda: Wind Waker | Game Checklist
-------------------------------------------------------------------------------

                                     POWER
                          THE          ^          THE
                       LEGEND         ^^^         LEGEND
                           OF        ^^^^^        OF
                        ZELDA       ^^^^^^^       ZELDA
                            -      ^       ^      -
 THE ^^^ ^^^ THE
@aaiezza
aaiezza / currentversion.sh
Last active April 20, 2020 13:06
Maven Project | Bump Major, Minor, or Patch Sematic Version
currentversion() {
# If xpath is on your machine (macos will I believe),
# and the project's version is in the path `project.version`,
# then it is nice to use this because it is faster.
# xpath ./pom.xml 'project/version/text()' 2>/dev/null
# Otherwise:
mvn help:evaluate -Dexpression=project.version -q -DforceStdout
}
@aaiezza
aaiezza / findActionsWithType.jq
Last active June 19, 2018 18:19
Retrieve embedded actions with a "type" key
"type" as $filter |
._embedded | to_entries
| map({(if (.value | has($filter)) then .key else empty end): .value|keys})
| add
## Sample command:
# curl --silent https://api.financialwellness.com/task/tasklist/index | jq -Cf findActionsWithType.jq