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 / generate_pdf.sh
Created April 19, 2023 06:08
Beautiful PDF generator out of Markdown powered by podman
#!/bin/zsh
########################################
########################################
## ##
## Author: [email protected] ##
## Takes Markdown file `in.md` and ##
## converts it into a LaTeX PDF !! ##
## ##
########################################
@luckylittle
luckylittle / fedora_upgrade.sh
Last active October 7, 2023 16:42
Typical workflow of Fedora system-wide upgrade to the next releasever
#!/usr/bin/env bash
sudo dnf upgrade --refresh
sudo dnf install dnf-plugin-system-upgrade
sudo dnf system-upgrade download --releasever=37
sudo dnf system-upgrade reboot
sudo dnf install remove-retired-packages
remove-retired-packages
sudo dnf repoquery --unsatisfied
sudo dnf repoquery --duplicates
@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 September 24, 2025 18:53
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 December 11, 2023 15:12
(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