Skip to content

Instantly share code, notes, and snippets.

View asaf400's full-sized avatar

Asaf Levy asaf400

View GitHub Profile
@asaf400
asaf400 / blacklist.txt
Created September 9, 2024 23:03
LG TV WebOS blocking
ad.lgappstv.com
aic-gfts.lge.com
aic-ngfts.lge.com
aic-op-lss.lgthinq.com
aic.api.lgtviot.com
aic.homeprv.lgtvcommon.com
aic.lgtviot.com
aic.nudge.lgtvcommon.com
aic.rdl.lgtvcommon.com
aic.recommend.lgtvcommon.com
@asaf400
asaf400 / Anti-Xeno.ahk
Last active August 17, 2023 23:46
Elite Dangerous Fire Groups keybinding with AutoHotKey
; written by https://github.com/asaf400
; version 0.3
; Settings
gameLocation := "H:\SteamLibrary\steamapps\common\Elite Dangerous"
; Change log file location
global LogFile := "H:\SteamLibrary\steamapps\common\Elite Dangerous\AX.log"
@asaf400
asaf400 / EasyAutoShift.ahk
Last active August 11, 2023 14:51
Mimic the ROCCAT™ Easy-Shift[+]™ feature using AutoHotKey for use with other gaming mice.
; written by https://github.com/asaf400
; well, not really.. Thanks ChatGPT :)
; This is an EasyShift (ROCCAT™ Easy-Shift[+]™) implementation in AHK dubed - EasyAutoShift
; Initialize variables
global awaitingEASButton := false
; List of AHK keys: https://www.autohotkey.com/docs/v1/KeyList.htm
; Define the hotkey for XButton1 (Mouse4) press - EasyAutoShift button
XButton1::
import os.path
import googleapiclient.discovery
import urllib.request
import datetime
# Script Written by LLM
# Set up API credentials - Created here (API Keys): https://console.cloud.google.com/apis/credentials
api_key = '' # Replace with your API key
@asaf400
asaf400 / aws-sso-lib.py
Last active January 14, 2025 09:17
This script is meant to be used as a backup, restore and convertion tool for AWS SSO (Identity Store & Identity Center)
#!/bin/env python
# AUTHOR: github.com/asaf400
# This script is meant to be used as a backup, restore and convertion tool for AWS SSO (Identity Store & Identity Center)
# Currently AWS does not provide any way to backup the following resources:
# Users & Groups in the Identity Store API,
# The Principal Assignment with an AWS Account and PermissionSet in the SSO Admin API
# The Permissions sets and their inline policies
# hench I created this script which allows for a backup in a relatively Human Readble JSON format
# it is able to backup to:
#!/bin/bash
# AUTHOR: github.com/asaf400
# This script iterates over all S3 objects in terraform state,
# in order to import any S3 resource that has been split from the main aws_s3_bucket resource
# following the terraform aws v4 breaking changes which requires existing s3 attributes to exists as 'linked' resources
# The script assumes that the hcl files has already been modifed to reflect the v4 change,
# and it is useful for allowing terraform to import the new resources which already existed in aws.
# SCRIPT IS DISTRIBUTED AS IS, NOT SUPPORT REQUESTS.
# The resources are:
@asaf400
asaf400 / kafka-stats.sh
Created June 15, 2022 16:30
Kafka Topic Statistics
#!/bin/bash
kafkajson='{"bootstrapserver":"kafka-staging-us-east-1..com:9092","sets":[{"name":"abc","topic":"def"}]}'
for topic in $(jq -r '.sets[] | .topic' <<<"$kafkajson" | tr '\n' ' '); do
echo "Working on Topic: $topic"
echo "running: kcat -e -b acid-kafka-staging-us-east-1.isappcloud.com:9092 -t $topic -f '%T %S\n' -o beginning"
#kcat -e -b acid-kafka-staging-us-east-1.isappcloud.com:9092 -t $topic -f '%T %S\n' -o beginning > "$topic"
cut -d' ' -f2 <"$topic" > "$topic""_bytes"
cut -d' ' -f1 <"$topic" > "$topic""_timestamps"
@asaf400
asaf400 / foobar.sh
Created June 15, 2022 16:26
Aerospike security.smd user&password stuff
pip install bcrypt
python3 -c 'import bcrypt; print(bcrypt.hashpw(b"PASSWORD", bcrypt.gensalt(rounds=10)).decode("ascii"))'
htpasswd -bnBC 10 "" password | tr -d ':\n' | sed 's/$2y/$2a/'
aerospike_users=cat security.smd | jq '.[] | select(has("key")? and (.key | contains("|P"))) | .key | sub("\\|P"; "")' -r
import pathlib
import zipfile
from shutil import copyfile
java_classes = ['org/apache/log4j/net/JMSAppender.class']
# from six import string_types # would be better here,
# but I wanted something without external deps
try:
basestring
@asaf400
asaf400 / aerospike_security_ext
Created June 3, 2021 13:24
Aerospike Security Grok patterns
# Aerospike Security GROK Patterns Extensions - author asaf.levy (@asaf400 github)
# Meant to extend the existing patterns: https://github.com/aerospike/aerospike-elk/blob/master/logstash/patterns/aerospike
# And then can be loded within the match stenza of 'aerospike_logstash.conf' file
# grok {
# tag_on_failure => ["patterns_filter_failure"]
# patterns_dir => ["/etc/logstash/conf.d/patterns"]
# match => {
# "message" => ["%{AS_NS}","%{AS_TICK}","%{AS_NSUP}","%{AS_XDR}","%{AS_SINDEX}","%{AS_ERR}","%{AS_SEC}","%{AS_LOG}"]
# }
# }