Skip to content

Instantly share code, notes, and snippets.

View luckylittle's full-sized avatar
:octocat:
Working for @RedHatOfficial

Lucian Maly luckylittle

:octocat:
Working for @RedHatOfficial
View GitHub Profile
@luckylittle
luckylittle / autobrr_backup.zsh
Last active April 11, 2024 01:53
Bash script to backup the main settings & filters from autobrr (until proper db backup exists)
#!/bin/zsh
export AUTOBRR_HOST="127.0.0.1"
export AUTOBRR_API_KEY="abcdefghijklmnopqrstuvwxyz"
# Backup indexers
curl -X GET "http://${AUTOBRR_HOST}:7474/api/indexer" -H "X-API-Token: ${AUTOBRR_API_KEY}" | jq > autobrr_indexers$(date +%Y%m%d).json
# Backup IRCs
curl -X GET "http://${AUTOBRR_HOST}:7474/api/irc" -H "X-API-Token: ${AUTOBRR_API_KEY}" | jq > autobrr_ircs$(date +%Y%m%d).json
# Backup RSS Feeds
@luckylittle
luckylittle / oc_neat.zsh
Last active April 4, 2024 01:49
Clean up unnecessary metadata from Openshift YAML files
# wget https://github.com/itaysk/kubectl-neat/releases/download/v2.0.3/kubectl-neat_linux_amd64.tar.gz
# tar xvzf kubectl-neat_linux_amd64.tar.gz
# sudo mv -v kubectl-neat /usr/local/bin/
cat << EOF | oc neat [2024-04-04 | 12:46:23]
apiVersion: v1
kind: Pod
metadata:
annotations:
openshift.io/scc: anyuid
@luckylittle
luckylittle / wav_to_flac.zsh
Created February 21, 2024 00:28
WAV to FLAC in all subdirectories
#!/bin/zsh
find . -type f -iname "*.wav" -execdir sh -c 'flac --compression-level-8 --verify "{}"' \;
@luckylittle
luckylittle / create-container-radarr.sh
Created October 19, 2023 23:44
Run radarr and sonarr inside Podman
#!/bin/bash
podman run -d \
--conmon-pidfile=/home/lmaly/radarr.pid \
--name=radarr \
-e PUID=1000 \
-e PGID=1000 \
-e TZ=Australia/Sydney \
-p 7878:7878 \
-v /home/lmaly/radarr:/config \
--restart unless-stopped \
@luckylittle
luckylittle / Dropbox_lucky.sh
Created October 19, 2023 03:46
Run multiple DropboxD on one Linux machine
#!/bin/zsh
HOME=$HOME/.dropbox_lucky; ~/.dropbox-dist/dropboxd
@luckylittle
luckylittle / Splunk_Certified_Cybersecurity_Defense_Analyst.md
Last active March 31, 2024 18:37
Splunk Certified Cybersecurity Defense Analyst [SPLK-5001] - Notes

Splunk Certified Cybersecurity Defense Analyst [SPLK-5001]

1.0 The Cyber Landscape, Frameworks, and Standards (*10%*)
  1.1 Summarize the organization of a typical SOC and the tasks belonging to Analyst, Engineer and Architect roles.
  1.2 Recognize common cyber industry controls, standards and frameworks and how Splunk incorporates those frameworks.
  1.3 Describe key security concepts surrounding information assurance including confidentiality, integrity and availability and basic risk management.

2.0 Threat and Attack Types, Motivations, and Tactics (*20%*)
  2.1 Recognize common types of attacks and attack vectors.
@luckylittle
luckylittle / alert_actions.conf
Last active September 21, 2023 03:34
Examples of all Splunk Configuration files (v9.1.0.2)
# Version 9.1.0.2
#
# This is an example alert_actions.conf. Use this file to configure alert
# actions for saved searches.
#
# To use one or more of these configurations, copy the configuration block into
# alert_actions.conf in $SPLUNK_HOME/etc/system/local/. You must restart
# Splunk to enable configurations.
#
# To learn more about configuration files (including precedence) please see the
@luckylittle
luckylittle / gnome_keyring_remove_pswd.zsh
Created August 2, 2023 02:38
REMOVE Annoying popup for Chrome/Chromium asking for GNOME Keyring password
#!/bin/zsh
source venv/bin/activate
python -c 'import keyring;keyring.set_password("system","username","");'
python -c 'import keyring;keyring.get_password("system","username");'
deactivate
@luckylittle
luckylittle / timezones.sh
Last active July 27, 2023 05:45
Quick & Easy way to display various timezones within your shell
#!/bin/bash
echo "----------------------------"
echo "Local Time"
date
echo "----------------------------"
echo ""
echo "Time in Los Angeles, CA"
export TZ=America/Los_Angeles
date
echo ""
@luckylittle
luckylittle / README.md
Created June 29, 2023 09:16
Python transformation of Openshift's ImageContentSourcePolicy. It changes the mirrors based on the source. Useful for cases when you do not need to mirror images, but you just proxy them.

Example of the ImageContentSourcePolicy:

spec:
  repositoryDigestMirrors:
  - mirrors: artifactory-proxy.domain.com.au/redhat-registry-openshift-remote/redhat-openshift-logging-kibana6-rhel8
    source: registry.redhat.io/openshift-logging/kibana6-rhel8
  - mirrors: artifactory-proxy.domain.com.au/redhat-registry-openshift-remote/redhat-openshift-gitops-1-gitops-operator-bundle
 source: registry.connect.redhat.io/openshift-gitops-1/gitops-operator-bundle