export LC_ALL=C.UTF-8
export LANG=C.UTF-8
export CC=clang-11
export CXX=clang++-11
export PATH=/usr/lib/linux-tools-4.15.0-66:$PATH
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Producer | |
Setup | |
bin/kafka-topics.sh --zookeeper esv4-hcl197.grid.linkedin.com:2181 --create --topic test-rep-one --partitions 6 --replication-factor 1 | |
bin/kafka-topics.sh --zookeeper esv4-hcl197.grid.linkedin.com:2181 --create --topic test --partitions 6 --replication-factor 3 | |
Single thread, no replication | |
bin/kafka-run-class.sh org.apache.kafka.clients.tools.ProducerPerformance test7 50000000 100 -1 acks=1 bootstrap.servers=esv4-hcl198.grid.linkedin.com:9092 buffer.memory=67108864 batch.size=8196 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Check if required commands are installed | |
for cmd in jq yq gh; do | |
if ! command -v $cmd &> /dev/null; then | |
echo "Error: $cmd is not installed. Please install $cmd to run this script." | |
exit 1 | |
fi | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
To the extent possible under law, Konstantin Olkhovskiy has waived | |
all copyright and related or neighboring rights to this snippet. | |
CC0 license: http://creativecommons.org/publicdomain/zero/1.0/ | |
*/ | |
package main | |
import ( | |
"crypto/x509" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Builds protoc executable into target/<OS>/<ARCH>/protoc.exe; optionally builds | |
# protoc plugins into target/<OS>/<ARCH>/protoc-gen-*.exe | |
# | |
# Usage: ./build-protoc.sh <OS> <ARCH> <TARGET> | |
# | |
# <TARGET> can be "protoc" or "protoc-gen-javalite". Supported <OS> <ARCH> | |
# combinations: | |
# HOST <OS> <ARCH> <COMMENT> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html | |
METADATA_TOKEN="$(curl -s -X PUT 'http://169.254.169.254/latest/api/token' -H 'X-aws-ec2-metadata-token-ttl-seconds: 21600')" | |
AVAILABILITY_ZONE="$(curl -s -H "X-aws-ec2-metadata-token: $METADATA_TOKEN" http://169.254.169.254/latest/meta-data/placement/availability-zone)" | |
export AWS_REGION="$(echo "$AVAILABILITY_ZONE" | rev | cut -c 2- | rev)" | |
export AWS_DEFAULT_REGION="$AWS_REGION" | |
export INSTANCE_ID="$(curl -s -H "X-aws-ec2-metadata-token: $METADATA_TOKEN" http://169.254.169.254/latest/meta-data/instance-id)" | |
# Instance identity documents is another very useful interface with many key value pairs in json format | |
# https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-identity-documents.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Allows copying of job files to local after execution. Example copy command: | |
# | |
# kubectl apply -f ./export-file-job.yaml | |
# POD=$(kubectl get pod --selector=job-name=export-files -o jsonpath='{.items[0].metadata.name}') | |
# kubectl wait pod/$POD --for=condition=ready | |
# until kubectl logs $POD | grep 'Ready for download'; do sleep 2; done | |
# kubectl cp $POD:files.zip ./job-files-$(date +"%Y%m%d%H%M").zip | |
# | |
# Another option would be for the `export-files` container to be a webserver to | |
# serve of the artifact files to be downloaded with `kubectl port-forward ...`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.guilherme.miguel; | |
import io.vavr.control.Try; | |
import lombok.extern.slf4j.Slf4j; | |
import org.springframework.boot.CommandLineRunner; | |
import org.springframework.boot.SpringApplication; | |
import org.springframework.boot.autoconfigure.SpringBootApplication; | |
import org.springframework.context.annotation.Bean; | |
import org.springframework.core.task.AsyncTaskExecutor; | |
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:: Windows 10 Hardening Script | |
:: This is based mostly on my own personal research and testing. My objective is to secure/harden Windows 10 as much as possible while not impacting usability at all. (Think being able to run on this computer's of family members so secure them but not increase the chances of them having to call you to troubleshoot something related to it later on). References for virtually all settings can be found at the bottom. Just before the references section, you will always find several security settings commented out as they could lead to compatibility issues in common consumer setups but they're worth considering. | |
:: Thank you @jaredhaight for the Win Firewall config recommendations! | |
:: Thank you @ricardojba for the DLL Safe Order Search reg key! | |
:: Best script I've found for Debloating Windows 10: https://github.com/Sycnex/Windows10Debloater | |
:: | |
::####################################################################### | |
:: | |
:: Change file associations to protect against common ransomware |
I hereby claim:
- I am slachiewicz on github.
- I am slachiewicz (https://keybase.io/slachiewicz) on keybase.
- I have a public key ASBl8NimUbKIctTlePSoE9y-Hv4LQYDqP6ccLp7wpiZ9Xwo
To claim this, I am signing this object:
NewerOlder