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 / 01-Create and Manage Cloud Resources.md
Last active March 26, 2024 10:36
Professional Google Cloud Architect (2023) -- Cohort ID: PCA02-GETCERT/2023.05.25

Create and Manage Cloud Resources

Creating virtual machine

  • To attach a persistent disk to a virtual machine instance, both resources must be in the same zone
  • If you want to assign a static IP address to an instance, the instance must be in the same region as the static IP

GCloud CLI

@luckylittle
luckylittle / dl_links.csv
Last active May 16, 2023 23:17
Manning Publications Ebooks Downloader
@luckylittle
luckylittle / wayland_brightness.sh
Created May 1, 2023 06:19
Change the brightness of your monitor programatically
#!/bin/zsh
# Turn the monitor brightness down to almost zero
dconf write /org/gnome/shell/extensions/soft-brightness/current-brightness 0.01
# Turn the monitor brightness up to usable value
dconf write /org/gnome/shell/extensions/soft-brightness/current-brightness 0.8
@luckylittle
luckylittle / generate_pdf.sh
Created April 19, 2023 06:08
Beautiful PDF generator out of Markdown powered by podman
#!/bin/zsh
########################################
########################################
## ##
## Author: lmaly@redhat.com ##
## 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