Skip to content

Instantly share code, notes, and snippets.

@zodsoft
zodsoft / CMake_3_20_Ubuntu_18_04.md
Created May 21, 2025 03:17 — forked from bmegli/CMake_3_20_Ubuntu_18_04.md
CMake 3.20 in Ubuntu 18.04 (reversible way)

Motivatation

  • modern CMake is required for building a lot of new software
  • CMake is dependency for many packages (e.g. ROS related)
  • we don't want to remove CMake (which would remove packages that depend on it)
  • we want safe procedure to update CMake that can be reversed easily

Current version in OS

Check current version

@zodsoft
zodsoft / llama4openai-api.py
Created February 14, 2025 02:57 — forked from kinoc/llama4openai-api.py
Flask based endpoint to emulate OpenAI API enpoints using llama/alpaca and HF models
# a simple Flask API to emulate OpenAI's using llama models and/or transformers
# runs on 3080
import sys
import time
import torch
import json
from peft import PeftModel
from flask import Flask, make_response, request, abort

Install Zsh and Oh-my-zsh on CentOS 7

Based on this article

ALL INSTALLATIONS ASSUME YES WHEN PROMPTED, that's what -y does

This script can be copy paste to ssh as is. No hands installation. :-)

yum install zsh -y
@zodsoft
zodsoft / gist:74cc552d94f0b50a1142e637747f3896
Created August 30, 2023 02:54 — forked from binura-g/single-line-cert.sh
Convert Certificates ( .pem, / .crt / etc ) into single-line strings for JSON payloads
awk 'NF {sub(/\r/, ""); printf "%s\\n",$0;}' cert-name.pem
@zodsoft
zodsoft / gist:2ae1807aa5d147a19ad0a51d93541252
Created August 30, 2023 02:54 — forked from binura-g/single-line-cert.sh
Convert Certificates ( .pem, / .crt / etc ) into single-line strings for JSON payloads
awk 'NF {sub(/\r/, ""); printf "%s\\n",$0;}' cert-name.pem

Install Android SDK CLI Ubuntu 20.04 WSL2 (Work in Progress)

Install Java 8

sudo apt install openjdk-8-jdk-headless

Android SDK

@zodsoft
zodsoft / AdbCommands
Created June 24, 2022 13:14 — forked from dswapnil104/AdbCommands
Adb useful commands list
adb help // List all comands
== Adb Server
adb kill-server
adb start-server
== Adb Reboot
adb reboot
adb reboot recovery
adb reboot-bootloader
@zodsoft
zodsoft / hex2bytes.h
Created June 23, 2022 15:33 — forked from arnobaer/hex2bytes.h
C++ infinite hex string to bytes (of any junk size)
/*
* hex2bytes - hex string of unlimited length to a continous block of bytes
* Copyright (C) 2018 Bernhard Arnold <bernhard.arnold@cern.ch>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
@zodsoft
zodsoft / Graph.scala
Created June 13, 2022 14:50 — forked from FreddieSanchez/Graph.scala
bfs/dfs implementation of a graph in Scala 3
import scala.annotation.tailrec
class Graph[A](m: Map[A, Set[A]]):
type Vertex = A
type GraphMap = Map[Vertex, Set[Vertex]]
private def neighbors(v: Vertex): List[Vertex] =
m.get(v).map(_.toList).getOrElse(List.empty[Vertex])
def search(start: Vertex, end: Vertex): Boolean =
@tailrec
def bfs(toVisit: List[Vertex], visited: List[Vertex]): Boolean =
@zodsoft
zodsoft / can-packages-and-tools.md
Created May 25, 2022 14:03 — forked from jackm/can-packages-and-tools.md
Collection of CAN bus packages and tools

Collection of CAN bus packages and tools

This document assumes the use of Linux as the chosen development platform. Items in bold are highly recommended.

It is recommended to use SocketCAN when working with CAN bus on Linux. It is supported by the Linux kernel mainline and follows the Linux interface model, allowing you to use other network tools such as Wireshark. This also allows the creation of virtual CAN interfaces where no physical hardware is required to simulate or replay CAN messages.