Skip to content

Instantly share code, notes, and snippets.

View fabito's full-sized avatar
🏠
Working from home

Fábio Franco Uechi fabito

🏠
Working from home
View GitHub Profile
@fabito
fabito / ray_cluster_resource_dagster.py
Created March 5, 2024 08:13
RayClusterResource Dagster resource implementation that provision/deprovision a new Ray cluster on demand
from typing import Optional
from dagster import AssetExecutionContext, ConfigurableResource, Definitions, InitResourceContext, asset
from ray.autoscaler.sdk import create_or_update_cluster, run_on_cluster, teardown_cluster
class RayClusterResource(ConfigurableResource):
cluster_config: str
@fabito
fabito / 8bitdo.SMG.ini
Last active January 21, 2023 11:27
8Bitdo SN30 Pro, Super Mario Galaxy, Dolphin Profile
[Profile]
Device = evdev/0/8Bitdo SN30 Pro
Buttons/A = `TR2`|SOUTH
Buttons/B = TR|EAST
Buttons/- = SELECT
Buttons/+ = START
Buttons/Home = MODE
IR/Up = TL&`Axis 3-`
IR/Down = TL&`Axis 3+`
IR/Left = TL&`Axis 2-`
- id: 'port-forward'
name: 'gcr.io/cloud-builders/docker'
args: [
'run',
'-itd',
'--network-alias', 'ml-pipeline.local',
'-e', 'CLOUDSDK_COMPUTE_ZONE=${_KF_ZONE}',
'-e', 'CLOUDSDK_CONTAINER_CLUSTER=${_KF_CLUSTER}',
'-e', 'CLOUDSDK_CORE_PROJECT=${_KF_PROJECT}',
'-p', '8888:8888',
@fabito
fabito / sentry.py
Created December 13, 2022 20:02 — forked from fliphess/sentry.py
Ansible sentry callback plugin - Send all errors from ansible to Sentry
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import getpass
import logging
import logging.config
import os
import socket
try:
@fabito
fabito / create-instance.sh
Last active November 30, 2022 09:18
Craete a Google Compute Engine instance with GPU , docker , cuda and nvidia-docker pre installed via startup shell script
#!/usr/bin/env bash
PROJECT=$1
INSTANCE_NAME=$2
MACHINE_TYPE=${3:-n1-standard-4}
ZONE=${4:-us-central1-c}
NUM_GPUS=${5:-1}
gcloud compute --project ${PROJECT} instances create ${INSTANCE_NAME} \
--zone ${ZONE} \
@fabito
fabito / gist:a3afcf242247fbf21f198dd466a90003
Created July 21, 2022 20:30
error runinference api with file corrupted
Traceback (most recent call last):
File "/venv/lib/python3.8/site-packages/apache_beam/runners/worker/sdk_worker.py", line 284, in _execute
response = task()
File "/venv/lib/python3.8/site-packages/apache_beam/runners/worker/sdk_worker.py", line 357, in <lambda>
lambda: self.create_worker().do_instruction(request), request)
File "/venv/lib/python3.8/site-packages/apache_beam/runners/worker/sdk_worker.py", line 597, in do_instruction
return getattr(self, request_type)(
File "/venv/lib/python3.8/site-packages/apache_beam/runners/worker/sdk_worker.py", line 628, in process_bundle
bundle_processor = self.bundle_processor_cache.get(
File "/venv/lib/python3.8/site-packages/apache_beam/runners/worker/sdk_worker.py", line 458, in get
@fabito
fabito / layers.txt
Last active January 21, 2022 21:20
YOLO v3 Layers
layer filters size input output
0 conv 32 3 x 3 / 1 416 x 416 x 3 -> 416 x 416 x 32
1 conv 64 3 x 3 / 2 416 x 416 x 32 -> 208 x 208 x 64
2 conv 32 1 x 1 / 1 208 x 208 x 64 -> 208 x 208 x 32
3 conv 64 3 x 3 / 1 208 x 208 x 32 -> 208 x 208 x 64
4 Shortcut Layer: 1
5 conv 128 3 x 3 / 2 208 x 208 x 64 -> 104 x 104 x 128
6 conv 64 1 x 1 / 1 104 x 104 x 128 -> 104 x 104 x 64
7 conv 128 3 x 3 / 1 104 x 104 x 64 -> 104 x 104 x 128
8 Shortcut Layer: 5
@fabito
fabito / jenkins_nginx_ci.template.json
Created November 9, 2012 22:47
AWS Cloudformation template which creates a server based on Amazon Linux and automatically installs jenkins with nginx (working as a reverse proxy).
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "AWS CloudFormation template to deploy jenkins/nginx.",
"Parameters" : {
"KeyName" : {
"Description" : "Name of an existing EC2 KeyPair to enable SSH access to the instances",
"Type" : "String",
@fabito
fabito / 8Bitdo SN30 Pro.cfg
Last active November 14, 2021 05:37
8Bitdo SN30 Pro
# 8Bitdo SN30 Pro - http://www.8bitdo.com/ - http://www.8bitdo.com/sn30pro-sf30pro/
# Firmware v1.37 - http://support.8bitdo.com/
input_driver = "dinput"
input_device = "Bluetooth Wireless Controller "
input_device_display_name = "8Bitdo SN30 Pro"
# Hex vid:pid and Decimal vid:pid is shown in the "log_verbosity" window, enable "log_verbosity" in retroarch.cfg and run RetroArch.
# Hex vid:pid = 2DC8:6101 -> Decimal vid:pid = 11720:24833
# input_vendor_id = "11720"
@fabito
fabito / DragonRise Inc. Generic USB Joystick.cfg
Created October 30, 2021 12:59
Retropie N64 Dragonrise controller mappings
input_device = "DragonRise Inc. Generic USB Joystick "
input_driver = "udev"
input_l_btn = "6"
input_l_btn_label = "L"
input_load_state_btn = "6"
input_r_btn = "7"
input_r_btn_label = "R"
input_save_state_btn = "7"