Skip to content

Instantly share code, notes, and snippets.

View williamcaban's full-sized avatar

William Caban Babilonia williamcaban

View GitHub Profile
@williamcaban
williamcaban / convert_1password_to_apply.py
Created April 13, 2025 23:54
Script to convert 1Password8 export to CSV compatible with Apple Password
import csv
import os
def convert_1password_to_apple(input_file, output_file):
"""
Convert a 1Password CSV export file to a format compatible with Apple Passwords.
Apple Passwords import format requires the following columns:
- Title
- URL
#!/bin/bash
set -euoE pipefail
# Redfish commands related to Virtual Media.
# Redfish doc reference: https://www.supermicro.com/manuals/other/RedfishRefGuide.pdf
export BMC_ADDRESS=''
export ISO_IMAGE=http://192.168.117.9:8080/ocp4-rwn-1-small.iso
export username_password='Administrator:superuser'

Using Sushy Tools with Libvirt

  • Add linux user to libvirt group
sudo usermod -a -G libvirt <your-user>
sudo -y install libvirt-devel gcc python3-devel
  • Login and validate user can execute virsh commands
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@williamcaban
williamcaban / ocp-4.2-hugepages-1g.md
Last active November 6, 2024 08:37
Configure 1G Hugepages in OpenShift 4.2

Configure 1G Hugepages in OpenShift 4.2

Update Node Kernel Parameters

Supporting 1G hugepages requires the Kernel to support 1G Hugepages. This is done by applying a boot Kernel parameter.

  • Create a MachineConfig (MC) to apply to the Node type that will be using the 1G hugepages. The following example set 1G hugepages for all worker nodes 50-kargs-1g-hugepages.yaml:
    apiVersion: machineconfiguration.openshift.io/v1
    

kind: MachineConfig

RHEL AI 1.1 as Inference Endpoint

Step 1. Update the host_port key serve section of the config.yaml to listen in all interfaces.

...
serve:
  backend: vllm
  chat_template: auto
 host_port: 0.0.0.0:8000
@williamcaban
williamcaban / NetFlow or SFlow with OpenShift 4.md
Created May 2, 2020 15:24
Simple procedure to enable NetFlow or SFlow on OpenShift 4

Netflow or sFlow on OpenShift 4 w/OVN Kubernetes

  • Identify the ovs-node of the Node hosting the Pods to monitor

    # oc get pods --selector="app=ovs-node" -o wide
    NAME             READY   STATUS    RESTARTS   AGE   IP              NODE       NOMINATED NODE   READINESS GATES
    ovs-node-4hldj   1/1     Running   0          47h   198.18.100.16   worker-1   <none>           <none>
    

ovs-node-bd9ln 1/1 Running 0 47h 198.18.100.12 master-1

from datasets import load_dataset
# Combine 'question' and 'answer' into a single 'text' field
def combine_qa(local_dataset):
local_dataset['text'] = f"User: {local_dataset['Question']}\nAssistant: {local_dataset['Answer']}"
return local_dataset
####################################################################################
# main
####################################################################################
@williamcaban
williamcaban / dataset_to_ilab.py
Last active July 7, 2024 18:53
Convert a Q&A custom dataset to InstructLab format
#
import sys, json
from pathlib import Path
from datetime import datetime
import pandas as pd
TSTAMP = datetime.now().replace(microsecond=0).isoformat().replace(":", '_')
ILABGEN = "granite-7b-lab-7b-Q4_K_M"+f"_{TSTAMP}"
DEBUG = True
@williamcaban
williamcaban / Simulating Bare Metal with VirtualBMC.md
Last active May 30, 2024 11:39
Bare Metal IPMI for VMs with Virtual BMC

Simulate Bare-Metal IPMI for VMs in RHEL8 Libvirt

  • Install the Virtual BMC package in the machine to use as the vBMC server. Note1: When using OpenStack repos the python3-virtualbmc RPM might be available. These instrucctions do not use that package.
    pip3 install virtualbmc
    
    • The vBMC server can be running in any machine. When using a remote libvirt server it is recommended to have passwordless authentication from the vBMC server to the libvirt machines.
    • For this document the vBMC Server export vBMCServerIP=192.168.1.13