Skip to content

Instantly share code, notes, and snippets.

View rgarcia's full-sized avatar

Rafael rgarcia

View GitHub Profile
@rgarcia
rgarcia / README.md
Last active February 6, 2026 21:06
Kernel: SCP files to/from browser VMs via kernel browsers ssh

SCP Files to/from Kernel Browser VMs

The Kernel CLI's kernel browsers ssh command (kernel/cli#103) provisions an SSH server on a browser VM and tunnels the connection over WebSockets. Because it sets up a standard OpenSSH server, you can use scp (and rsync, sftp, etc.) with the same tunnel — not just interactive shells.

Prerequisites

  1. Kernel CLI v0.14.5+ (with the browsers ssh subcommand and -o json support)

  2. websocat — WebSocket-to-TCP bridge used as the SSH ProxyCommand

@rgarcia
rgarcia / SKILL.md
Created February 2, 2026 19:38
DoorDash automation skill for agent-browser
name description allowed-tools
doordash
Access DoorDash for food delivery ordering, order history, account management, and restaurant/store browsing.
Bash(agent-browser:*)

DoorDash.com

Uses agent-browser with Kernel cloud browser provider. See the kernel-agent-browser skill for best practices.

@rgarcia
rgarcia / viewport-debug.sh
Created January 22, 2026 00:48
Debug script for Kernel browser viewport dimensions
#!/bin/bash
#
# Viewport Debug Script for Kernel Browsers
#
# This script demonstrates the difference between:
# 1. Creating a browser WITH viewport set at creation time
# 2. Creating a browser WITHOUT viewport (uses default 1920x1080)
#
# Usage: ./viewport-debug.sh
#
@rgarcia
rgarcia / test-kernel-provider.sh
Created January 22, 2026 00:36
Kernel provider integration test for agent-browser
#!/bin/bash
#
# Kernel Provider Integration Test
# Tests agent-browser CLI with Kernel cloud browser provider
#
# Usage:
# KERNEL_API_KEY="your-api-key" ./test-kernel-provider.sh
#
# Requirements:
# - agent-browser built (npm run build && npm run build:native)
#!/usr/bin/env bash
set -e
cd /tmp
rm -rf /tmp/mock
mkdir /tmp/mock
cd /tmp/mock
git clone https://github.com/golang/mock mock-before
package main
import (
"fmt"
"log"
"gopkg.in/yaml.v2"
)
const withAlias = `foo:
@rgarcia
rgarcia / circuit_breakers.md
Last active October 20, 2022 07:18
go circuit breakers
func New(errorThreshold, successThreshold int, timeout time.Duration) *Breaker

New constructs a new circuit-breaker that starts closed. From closed, the breaker opens if "errorThreshold" errors are seen without an error-free period of at least "timeout". From open, the breaker half-closes after "timeout". From half-open, the breaker closes after "successThreshold" consecutive successes, or opens on a single error.

@rgarcia
rgarcia / main.go
Created September 19, 2016 23:56
net/http server context object does not cancel on closed connections, need to listen for closenotify
package main
import (
"context"
"fmt"
"log"
"net/http"
"time"
"golang.org/x/net/context/ctxhttp"
@rgarcia
rgarcia / diff.txt
Created March 26, 2016 23:06
ldclient-node eventsource patch
*** 171,176 ****
--- 171,177 ----
req.on('error', onConnectionClosed);
req.setNoDelay(true);
+ req.setSocketKeepAlive(true);
req.end();
}
@rgarcia
rgarcia / b.go
Created March 14, 2016 21:21
mocking a vendored dependency
// $GOPATH/src/a/vendor/b/b.go
package b
import "log"
type Type int
type Interface interface {
InterfaceMethod(Type)
}