Skip to content

Instantly share code, notes, and snippets.

View ak-git's full-sized avatar

ak-git

View GitHub Profile
@ak-git
ak-git / empty_bucket.sh
Created November 16, 2019 08:40
Empty AWS version-based bucket
#!/usr/bin/env bash
bucket_name=rsc-energia
del_s3_bucket_obj()
{
local bucket_name=$1
local obj_type=$2
local query="{Objects: $obj_type[].{Key:Key,VersionId:VersionId}}"
local s3_objects=$(aws s3api list-object-versions --bucket ${bucket_name} --output=json --query="$query")
@ak-git
ak-git / CRCTest.java
Last active October 27, 2022 06:26
Лекция по информационной безопасности и системам распределённого реестра
package com.ak.numbers;
import java.nio.charset.StandardCharsets;
import java.util.BitSet;
import java.util.stream.Collectors;
import javax.annotation.Nonnull;
import com.ak.util.Strings;
import org.assertj.core.api.Assertions;
@ak-git
ak-git / EvenAndOdd.java
Last active September 4, 2021 17:36
A code snippet to print Even and Odd numbers using multi-threading
package com.ak.fx.core;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.logging.Logger;
import java.util.stream.IntStream;
import org.junit.jupiter.api.Test;
package com.ak.util;
import java.time.Duration;
import java.time.Instant;
import java.time.temporal.TemporalAmount;
import java.util.Random;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.DelayQueue;
import java.util.concurrent.Delayed;
import java.util.concurrent.TimeUnit;
@ak-git
ak-git / LongAccumulatorTest.java
Created January 12, 2022 15:52
Параллельные аккумуляторы https://habr.com/ru/post/599603/
package com.ak.util;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.atomic.LongAccumulator;
import java.util.function.UnaryOperator;
import java.util.stream.Stream;
import org.testng.Assert;
import org.testng.annotations.Test;
package com.ak.app;
import javax.annotation.Nonnull;
import java.util.concurrent.ForkJoinPool;
import java.util.logging.Logger;
import java.util.stream.IntStream;
public class CommonPoolTest {
private CommonPoolTest() {
}
@ak-git
ak-git / term.md
Last active March 21, 2024 06:31
MacOS: How can I delete the partition table on a USB flash drive?

find the path to the usb

diskutil list

delete the partition and reformat

diskutil partitionDisk  MBR MS-DOS FAT32 100%
@ak-git
ak-git / CollectionsAndCollectorsTest.java
Last active May 1, 2024 12:29
Collectors and Collections
package com.ak.app;
import org.junit.jupiter.api.Test;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
@ak-git
ak-git / fft.R
Last active December 13, 2023 11:11
Fourier Transform in R
signal <- c(1, 0, 0, 1)
fft_result <- fft(signal)
print(fft_result)