Skip to content

Instantly share code, notes, and snippets.

View levysantanna's full-sized avatar
😎

Levy Sant'Anna levysantanna

😎
  • Red Hat
  • Brazil
View GitHub Profile
@levysantanna
levysantanna / migrate.py
Created February 5, 2025 17:36 — forked from ervwalter/migrate.py
Migrate files in cephfs to a new file layout pool recursivly
import os
import shutil
import logging
import sys
from concurrent.futures import ThreadPoolExecutor
import threading
import uuid
import xattr
from pathlib import Path
@ervwalter
ervwalter / migrate.py
Last active February 5, 2025 17:36
Migrate files in cephfs to a new file layout pool recursivly
import os
import shutil
import logging
import sys
from concurrent.futures import ThreadPoolExecutor
import threading
import uuid
import xattr
from pathlib import Path
@noseka1
noseka1 / JSONPath in kubectl CLI.md
Last active February 21, 2025 02:53
JSONPath in kubectl CLI examples

Examples

$ kubectl get pods -o json
$ kubectl get pods -o jsonpath='{@}'
$ kubectl get pods -o jsonpath='{.items[0]}'
$ kubectl get pods -o jsonpath='{.items[0].metadata.name}'
$ kubectl get pods -o jsonpath="{.items[*]['metadata.name', 'status.capacity']}"
$ kubectl get pods -o jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.status.startTime}{"\n"}{end}'
$ kubectl get pods -o jsonpath='{.items[*].status.podIP}'
@probonopd
probonopd / Wayland.md
Last active March 13, 2025 19:58
Think twice about Wayland. It breaks everything!

Think twice before abandoning Xorg. Wayland breaks everything!

Hence, if you are interested in existing applications to "just work" without the need for adjustments, then you may be better off avoiding Wayland.

Wayland solves no issues I have but breaks almost everything I need. Even the most basic, most simple things (like xkill) - in this case with no obvious replacement. And usually it stays broken, because the Wayland folks mostly seem to care about Automotive, Gnome, maybe KDE - and alienating everyone else (e.g., people using just an X11 window manager or something like GNUstep) in the process.


As 2024 is winding down:

@franklinokech
franklinokech / importRange.gs
Created April 25, 2019 12:21
import Range using google app script
function importFarmList() {
//geth values to be imported from the source sheet
var values = SpreadsheetApp.openById('19VSMmYDmLI4z4cIXjPmufn9d7Q-sL-xqzCCUVV4y7VU').
getSheetByName('Farm List').getRange('A:Q').getValues();
//set values imported
SpreadsheetApp.getActive().getSheetByName('farm_list').
getRange(1,1,values.length,values[0].length).setValues(values);
}
#!/bin/bash
REGISTRY=${1}
ORIGIN=${2}
INVENTORY=${3}
for images in $(cat ${INVENTORY}) ; do
echo "Inserting image ${images}"
skopeo copy dir:${ORIGIN}/${images} docker://${REGISTRY}/${images}
done
#!/bin/bash
REGISTRY=docker://registry.access.redhat.com
DESTINY=./copy-images
for images in $(cat ${1} | grep -v ^#) ; do
echo "Copying image ${images}"
mkdir -p ${DESTINY}/${images}
skopeo copy --dest-compress ${REGISTRY}/${images} dir:${DESTINY}/${images}
done
@kurtis318
kurtis318 / NVIDIAonLenovoP50andFedora 28.txt
Last active April 21, 2020 19:57
NVIDIA on Lenovo P50 and Fedora 28
I have a Lenovo P50 ThinkPad that I am issued at work. I run the latest Fedora on my primary laptop for years but
have avoided running the NVIDA graphics drivers because installation was manual and could break with kernel updates.
I updated my personal Dell XPS 15 to use the new NVIDIA drivers that are now supported in Fedora 28 I think these were suppose to come from rpm-fusion but it looks like they are in Fedora 28 tree, I could be wrong. The install was as easy as just installing the nvidia-driver package and reboot. This worked without any issues. I could launch nvidia-settings and glxgears without any issues.
The purpose of this Gist post is to document how I got the NVIDIA drivers from Fedora 28 on the P50. It was not as easy as installing nvidia-driver and rebooting.
For starters, here are the specs for the P50:
[root@kwr50p kurtis] # inxi -SG

find pod's host

oc describe po pod-name

interface index

oc exec pod-name cat /sys/devices/virtual/net/eth0/iflink

find vethx by index

ip a

finally

@jpswade
jpswade / devops_best_practices.md
Last active February 22, 2025 04:19
Devops Best Practices Checklist

Find the original here article here: Devops Best Practices

DevOps started out as "Agile Systems Administration". In 2008, at the Agile Conference in Toronto, Andrew Shafer posted an offer to moderate an ad hoc "Birds of a Feather" meeting to discuss the topic of "Agile Infrastructure". Only one person showed up to discuss the topic: Patrick Debois. Their discussions and sharing of ideas with others advanced the concept of "agile systems administration". Debois and Shafer formed an Agile Systems Administrator group on Google, with limited success. Patrick Debois did a presentation called "Infrastructure and Operations" addressing