Skip to content

Instantly share code, notes, and snippets.

View rampadc's full-sized avatar

Cong Nguyen rampadc

View GitHub Profile
@rampadc
rampadc / Set up Storyteller with TTS.md
Last active March 30, 2025 11:07
Set up Storyteller with TTS

Installation Instructions

  1. Save the script above as storyteller in a directory in your PATH (e.g., /usr/local/bin/)
  2. Make it executable: chmod +x /usr/local/bin/storyteller
  3. Initialize the environment: storyteller init

Usage

After installation, you can use the following commands:

@rampadc
rampadc / workflow.yaml
Last active February 22, 2025 13:27
Tekton Pipeline Workflow
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: tekton-pipeline-
namespace: default
spec:
entrypoint: pipeline-dag
serviceAccountName: pipeline
templates:
- name: pipeline-dag

NVIDIA GPU Debugging in MicroK8s

Running microk8s enable gpu didn't start the GPU operator correctly. I found this to work.

1. Check NVIDIA container runtime installation

dpkg -l | grep nvidia-container

2. Verify NVIDIA container runtime setup

@rampadc
rampadc / add-owners-shared-outlook-calendar.md
Created October 24, 2023 03:09
Add owners to shared outlook calendar

You will need a Windows machine with the Microsoft Outlook app installed to look up the mailbox's location.

  1. Start Powershell, doesn't have to be admin mode.
  2. Install the Exchange Online Powershell module: https://learn.microsoft.com/en-us/powershell/exchange/exchange-online-powershell-v2?view=exchange-ps#install-and-maintain-the-exchange-online-powershell-module
  3. Import the module: Import-Module ExchangeOnlineManagement
  4. Login and connect: Connect-ExchangeOnline -UserPrincipalName <UPN>. The <UPN> is your e-mail address. This will open the browser to authenticate you.
  5. Get the shared calendar or mailbox path. This can be found in the calendar's Properties panel, in "General > Location" tab in the Outlook desktop app. For example, let's say it is \\[email protected]\Calendar, and the calendar's name is Calendar name.
  6. Get existing users' permissions: Get-MailboxFolderPermission -Identity [email protected]:"\Calendar\Calendar name". Reference: https://learn.microsoft.com/en-us/powershell/m
@rampadc
rampadc / createSampleBufferFromPixelBuffer.swift
Created February 21, 2021 09:24
Create a CMSampleBuffer from CVPixelBuffer
// Usage
let pixelBuffer: CVImageBuffer? = createPixelBufferFrom(image: image) // see https://gist.github.com/rampadc/10a7dc257552f1fb86c1fcc2d1671bd9
let sampleBuffer: CMSampleBuffer? = createSampleBufferFrom(pixelBuffer: pixelBuffer)
// Function
func createSampleBufferFrom(pixelBuffer: CVPixelBuffer) -> CMSampleBuffer? {
var sampleBuffer: CMSampleBuffer?
var timimgInfo = CMSampleTimingInfo()
var formatDescription: CMFormatDescription? = nil
@rampadc
rampadc / createPixelBufferFromCIImage.swift
Created February 21, 2021 09:22
Create a CVPixelBuffer from a CIImage
// Usage - CVImageBuffer and CVPixelBuffer are the same types
let pixelBuffer: CVImageBuffer? = createPixelBufferFrom(image: image)
// How CIContext was declared - used in a MTKView class
device = MTLCreateSystemDefaultDevice()
framebufferOnly = false
colorPixelFormat = .bgra8Unorm
commandQueue = device!.makeCommandQueue()
Config.shared.ciContext = CIContext(mtlDevice: self.device!)
@rampadc
rampadc / macOS_bonded_auto_reconnect
Created July 29, 2020 14:55
esp32_mouse_keyboard: macOS bonded, subsequent powerups
I (2826) HID_LE_PRF: HID connection establish, conn_id = 0
I (2836) HID_DEMO: ESP_HIDD_EVENT_BLE_CONNECT
I (2836) HID_LE_PRF: GATT EVT 4
I (2846) HID_DEMO: remote BD_ADDR: 8c85908a6d15
I (2846) HID_DEMO: address type = 0
I (2856) HID_DEMO: pair status = success
I (2906) HID_LE_PRF: GATT EVT 1
@rampadc
rampadc / macOS_bonded_successful_1
Created July 29, 2020 14:43
esp32_mouse_keyboard: successfully bonded on Catalina 10.15.6
I (2456) EXT_UART: external UART processing task started
I (2466) HID_LE_PRF: GATT EVT 12
D (13446) BT_SMP: SMDBG l2c smp_connect_callback
I (13446) HID_LE_PRF: HID connection establish, conn_id = 0
I (13446) HID_DEMO: ESP_HIDD_EVENT_BLE_CONNECT
I (13446) HID_LE_PRF: GATT EVT 4
D (13456) BT_SMP: SMP_Pair state=0 br_state=0 flag=0x0
D (13456) BT_SMP: SMDBG l2c smp_connect_callback
@rampadc
rampadc / c_cpp_properties.json
Last active June 14, 2020 11:49
Win32 ESP32 c_cpp_properties.json
{
"configurations": [
{
"name": "Win32",
"includePath": [
"${workspaceFolder}/**",
"${env:IDF_PATH}/components/**",
"${env:ADF_PATH}/components/**"
],
"browse": {
@rampadc
rampadc / c_cpp_properties.json
Last active June 14, 2020 11:49
Mac ESP32 .vscode/c_cpp_properties.json
{
"configurations": [
{
"name": "Mac",
"includePath": [
"${workspaceFolder}/**",
"${env:IDF_PATH}/components/**",
"${env:ADF_PATH}/components/**"
],
"browse": {