Skip to content

Instantly share code, notes, and snippets.

2022 Zephyrus G14 Fedora Silverblue Setup

GPU Naming

Most applications in Linux will report the names of the two GPUs as follows.

  • Dimgrey Cavefish is dGPU
  • Yellow Carp is iGPU

Boot Hotkeys

@PeterMitrano
PeterMitrano / serialize_deserialize_rospy_python3
Created March 4, 2021 15:58
Quick example of how to serialize then deserialize a ROS msg in python 3
from io import BytesIO
from geometry_msgs.msg import Point
p = Point(x=2, y=4)
print(p)
buff = BytesIO()
p.serialize(buff)
serialized_bytes = buff.getvalue()
@sloretz
sloretz / ros_python_typesupport.md
Last active April 17, 2025 11:56
ROS 2 python type support and rclpy interaction

Doing import std_msgs.msg.String or from std_msgs.msg import String imports a generated Python class.

Type support

The typesupport for the String type exists on a metaclass: String.__class__._TYPE_SUPPORT. This value starts as None. It later becomes a pycapsule (with no name) when someone calls String.__class__.__import_type_support__(). This is done in rclpy by check_for_type_support(msg_type). It's called by the Node in create_...(). Afterwards inside C code the function rclpy_common_get_type_support(pymsg_type). blindly assumes _TYPE_SUPPORT is a pycapsule.

@kharandziuk
kharandziuk / terraform-presigned-url.tf
Created June 25, 2020 11:50
A hack to generate a presigned url in terraform
variable "bucket_name" {
default = "max-bucket-for-testing"
}
provider "aws" {
region = var.aws_region
profile = var.aws_profile
}
resource "aws_s3_bucket" "artifacts" {
// GeneratedClient here is codegen-ed
#[tonic::async_trait]
impl TonicClient for GeneratedClient<Channel> {
async fn try_connect(
dest: tonic::transport::Endpoint,
) -> Result<Self, tonic::transport::Error> {
GeneratedClient::connect(dest).await
}
}
@YashasSamaga
YashasSamaga / yolov4.py
Last active July 13, 2024 06:42
YOLOv4 on OpenCV DNN
import cv2
import time
CONFIDENCE_THRESHOLD = 0.2
NMS_THRESHOLD = 0.4
COLORS = [(0, 255, 255), (255, 255, 0), (0, 255, 0), (255, 0, 0)]
class_names = []
with open("classes.txt", "r") as f:
class_names = [cname.strip() for cname in f.readlines()]
@raveenb
raveenb / ssh_into_android.md
Last active April 23, 2025 13:25
SSH into Android

Connecting to an Android device over SSH

Initial Setup

Install Android App Termux from APKPure or AppStore. If the app exists, just delete and re-install it to get the latest version, The APK can be downloaded from https://apkpure.com/termux/com.termux/ Install the APK using by running

adb install ~/Downloads/Termux_v0.73_apkpure.com.apk
@chriswayg
chriswayg / Ubuntu_Debian_Cloud_images_in_Proxmox.md
Last active April 11, 2025 10:35
Ubuntu and Debian Cloud images in Proxmox
@arno01
arno01 / docker-on-android.md
Last active April 2, 2025 03:08
Docker on Android

WORK IN PROGRESS

Docker on Android

Setup:

Samsung Galaxy Tab S5e SM-T720
Android Pie on Linux 4.9.112 (not rooted)
Termux
@george-hawkins
george-hawkins / arm64.md
Last active December 5, 2024 08:41
Running virtualized x86_64 and emulated arm64 Ubuntu cloud images using QEMU

QEMU arm64 cloud server emulation

This is basically a rehash of an original post on CNXSoft - all credit (particularly for the Virtio device arguments used below) belongs to the author of that piece.

Download the latest uefi1.img image. E.g. ubuntu-16.04-server-cloudimg-arm64-uefi1.img from https://cloud-images.ubuntu.com/releases/16.04/release/

Download the UEFI firmware image QEMU_EFI.fd from https://releases.linaro.org/components/kernel/uefi-linaro/latest/release/qemu64/

Determine your current username and get your current ssh public key: