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 / fix_icaclient.sh
Created February 17, 2023 04:44
SSL Problems with Citrix ICAClient on Linux
# Error: You have not chosen to trust USERTrust RSA Certification Authority (SSL error 61)
wget http://www.tbs-x509.com/USERTrustRSACertificationAuthority.crt
sudo cp USERTrustRSACertificationAuthority.crt /opt/Citrix/ICAClient/keystore/cacerts/USERTrustRSACertificationAuthority.pem
# alternatively, if it's intermediate put it in /opt/Citrix/ICAClient/keystore/intcerts/
sudo /opt/Citrix/ICAClient/util/ctx_rehash
@luckylittle
luckylittle / procedure.txt
Last active February 16, 2023 01:25
GitOps environment promotion / image version updates
### BEFORE:
lmaly@localhost  ~/Projects/gitops-environment-promotion/envs/staging-asia   main  cat kustomization.yml
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: staging
namePrefix: staging-asia-
@luckylittle
luckylittle / pre-commit.sh
Created February 15, 2023 04:41
Pre-commit Git hook (.git/hooks/pre-commit.sh) that checks certain keywords
#!/bin/sh
matches=$(git diff-index --patch HEAD | grep '^+' | grep -Pi 'password|keyword2|keyword3')
if [ ! -z "$matches" ]
then
cat <<\EOT
Error: Words from the blocked list were present in the diff:
EOT
echo $matches
exit 1
fi
@luckylittle
luckylittle / Mock Exam 1.md
Last active March 6, 2026 11:12
Prometheus Certified Associate (PCA)

Mock Exam

1

Q1. The metric node_cpu_temp_celcius reports the current temperature of a nodes CPU in celsius. What query will return the average temperature across all CPUs on a per node basis? The query should return {instance=“node1”} 23.5 //average temp across all CPUs on node1 {instance=“node2”} 33.5 //average temp across all CPUs on node2.

node_cpu_temp_celsius{instance="node1", cpu="0"} 28
node_cpu_temp_celsius{instance="node1", cpu="1"} 19
node_cpu_temp_celsius{instance="node2", cpu="0"} 36
node_cpu_temp_celsius{instance="node2", cpu="1"} 31
@luckylittle
luckylittle / CC.md
Last active February 2, 2026 11:14
(ISC)2 Flashcards for CC (Certified in Cybersecurity)
  1. Security commensurate with the risk and the magnitude of harm resulting from the loss, misuse or unauthorized access to or modification of information.

Adequate Security

  1. Controls implemented through policy and procedures. Examples include access control processes and requiring multiple personnel to conduct a specific operation. Administrative controls in modern environments are often enforced in conjunction with physical and/or technical controls, such as an access-granting policy for new users that requires login and approval by the hiring manager.

Administrative Controls

  1. The ability of computers and robots to simulate human intelligence and behavior. > Artificial Intelligence
@luckylittle
luckylittle / mkdir.sh
Created September 15, 2022 23:06
How to read complete line in `for` loop with spaces
IFS=$'\n'; for course in $(cat mkdir.txt); do mkdir ${course}; done; unset IFS
@luckylittle
luckylittle / radarr-unmonitor-downloaded.py
Created August 28, 2022 10:58
Python script to unmonitor already grabbed movies from Radarr v4.1.0.6175
#!/usr/bin/env python3
#-*- coding: utf-8 -*-
import json
import requests
import sys
import datetime
APIKEY=''
URL='http://localhost:7878/api/v3'
@luckylittle
luckylittle / .tmux.conf
Last active October 7, 2023 16:42
Ultimate tmux.conf files
source ~/.tmux/.tmux.conf
source ~/.tmux/.tmux.conf.ui
@luckylittle
luckylittle / playbook-export.yml
Created July 29, 2022 05:36
Complete backup of Red Hat Ansible Automation Platform into YAML files ready to be used by redhat_cop.controller_configuration collection
---
- name: Playbook to Export all resources from the AAP into YAML files using awxkit
hosts: localhost
vars:
controller_configuration_path: "/home/lmaly/Projects/awxkit"
tasks:
- name: Export all users assets
awx.awx.export:
users: 'all'
register: "users"
@luckylittle
luckylittle / clean_logs_rhel.sh
Created June 20, 2022 06:00
Quickly empty all the major logs on RHEL
#!/bin/zsh
LOGS=(
/var/log/boot.log
/var/log/btmp
/var/log/cron
/var/log/dnf.librepo.log
/var/log/dnf.log
/var/log/dnf.rpm.log
/var/log/firewalld