Skip to content

Instantly share code, notes, and snippets.

View PrettySolution's full-sized avatar
☁️
in the cloud

Vasyl Herman PrettySolution

☁️
in the cloud
View GitHub Profile
{
"type": "bundle",
"id": "bundle--601cee35-6b16-4e68-a3e7-9ec7d755b4c3",
"objects": [
{
"type": "threat-actor",
"spec_version": "2.1",
"id": "threat-actor--dfaa8d77-07e2-4e28-b2c8-92e9f7b04428",
"created": "2014-11-19T23:39:03.893Z",
"modified": "2014-11-19T23:39:03.893Z",
@PrettySolution
PrettySolution / sqs to lambda in cdk
Last active March 1, 2024 11:57
sqs to lambda in cdk
import { SQSEvent } from 'aws-lambda'
export const handler = async (event: SQSEvent) => {
const batchItemFailures: { itemIdentifier: string }[] = []
try {
const sqsMessages = event.Records
for (const message of sqsMessages) {
const messageId = message.messageId
try { // your Logic goes here
@PrettySolution
PrettySolution / Windows 11 Bootable USB on a Mac
Last active January 18, 2024 14:20
Windows 11 Bootable USB on a Mac
Erase in MS-DOS FAT https://www.youtube.com/watch?v=qMKDFfmR6NI
rsync -avh --exclude 'sources/install.wim' /Volumes/CCCOMA_X64FRE_EN-US_DV9/* /Volumes/WIN11/
wimlib-imagex split /Volumes/CCCOMA_X64FRE_EN-US_DV9/sources/install.wim /Volumes/WIN11/sources/install.swm 4000
@PrettySolution
PrettySolution / oh-my-zsh-cmd
Last active March 22, 2024 08:28
oh-my-zsh-cmd
sudo apt update -y
echo install zsh
sudo apt install zsh -y
yes | sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
git clone https://github.com/asdf-vm/asdf.git ~/.asdf
@PrettySolution
PrettySolution / WindowsDefenderATPLocalOnboardingScript.cmd
Created September 11, 2023 08:47
WindowsDefenderATPLocalOnboardingScript.cmd
@echo off
echo This script is for onboarding machines to the Microsoft Defender for Endpoint services, including security and compliance products.
echo Once completed, the machine should light up in the portal within 5-30 minutes, depending on this machine's Internet connectivity availability and machine power state (plugged in vs. battery powered).
echo IMPORTANT: This script is optimized for onboarding a single machine and should not be used for large scale deployment.
echo For more information on large scale deployment, please consult the MDE documentation (links available in the MDE portal under the endpoint onboarding section).
echo.
:USER_CONSENT
set /p shouldContinue= "Press (Y) to confirm and continue or (N) to cancel and exit: "
IF /I "%shouldContinue%"=="N" (
@PrettySolution
PrettySolution / m365-generate-security-alert.txt
Last active September 13, 2023 13:43
m365 generate test alert
powershell.exe -NoExit -ExecutionPolicy Bypass -WindowStyle Hidden $ErrorActionPreference= 'silentlycontinue';(New-Object System.Net.WebClient).DownloadFile('http://127.0.0.1/1.exe', 'C:\\test-WDATP-test\\invoice.exe');Start-Process 'C:\\test-WDATP-test\\invoice.exe'
{
"type": "external_account",
"audience": "//iam.googleapis.com/projects/973163340444/locations/global/workloadIdentityPools/dev-best-security-us/providers/dev-best-security-us",
"subject_token_type": "urn:ietf:params:aws:token-type:aws4_request",
"service_account_impersonation_url": "https://iamcredentials.googleapis.com/v1/projects/-/serviceAccounts/pretty-solution-com-12376412364@dev-best-security-us.iam.gserviceaccount.com:generateAccessToken",
"token_url": "https://sts.googleapis.com/v1/token",
"credential_source": {
"environment_id": "aws1",
"region_url": "http://169.254.169.254/latest/meta-data/placement/availability-zone",
"url": "http://169.254.169.254/latest/meta-data/iam/security-credentials",
@PrettySolution
PrettySolution / loki in docker compose example
Last active August 27, 2023 06:13
loki in docker compose example
version: "3"
services:
app:
build:
dockerfile: Dockerfile
ports:
- "8080:3000"
depends_on:
- grafana
@PrettySolution
PrettySolution / install Husky zsh
Last active January 5, 2023 01:28
install Husky and commitizen in non NPM projects zsh
# how to install Husky and commitizen on non NPM projects (zsh + iTerm2)
# install Husky on each opening if folder is a git repository
echo '[ -d .git ] && npx husky install > /dev/null || true' >> ~/.zshrc
# set commitizen to intercept 'git commit -m'
mkdir -p ~/.git-templates/hooks/
echo '#!/bin/bash' > ~/.git-templates/hooks/prepare-commit-msg
echo 'exec < /dev/tty && npx cz --hook || true' >> ~/.git-templates/hooks/prepare-commit-msg
@PrettySolution
PrettySolution / oh-my-zsh
Last active October 20, 2023 08:24
oh-my-zsh
# On MAC
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install zsh
# On Ubuntu
sudo apt install zsh -y
# install ohmyzsh and zsh-syntax-highlighting & zsh-autosuggestions & powerlevel10k plugins
sh -c "$(wget https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k