Skip to content

Instantly share code, notes, and snippets.

@chsh
chsh / pg_pub_sub.rb
Last active May 2, 2024 08:13
PostgreSQL LISTEN/NOTIFY example for ruby
#
# A:
# pubsub = PgPubSub.new('channelname')
# pubsub.subscribe do |data|
# puts "data: #{data} is coming!"
# end
#
# B:
# pubsub = PgPubSub.new('channelname')
# pubsub.publish("hello world")
@fmateo05
fmateo05 / Kazoo-VoIP-OVN-Incus-Containers.md
Last active May 2, 2024 08:10
Kazoo VoIP Install with OVN and Incus Containers

Kazoo 2-zone cluster using Incus Containers; Open Virtual Network (OVN); Nebula Updated

This guide described how to install Kazoo with Incus containers and some other components like OVN networking and Nebula, etc.

  • Create 4 instances on Digital ocean; 2 on one datacenter (zone 100 ie. San Francisco) and the other 2 on another datacenter (zone 200 ie. New York).

The idea is like 2 instances per zone or datacenter as desired; if you later would like to create another zone. The main Linux distribution is Rocky Linux 9

  • Login to each server using ssh with private key
@nc9
nc9 / schemas.xmlsoap.org.xml
Created April 30, 2024 07:04
schemas.xmlsoap.org/soap/encoding/ mirror
<?xml version="1.0" encoding="UTF-8"?>
<!-- Schema for the SOAP/1.1 encoding
Portions © 2001 DevelopMentor.
© 2001 W3C (Massachusetts Institute of Technology, Institut National de Recherche en Informatique et en Automatique, Keio University). All Rights Reserved.
This document is governed by the W3C Software License [1] as described in the FAQ [2].
[1] http://www.w3.org/Consortium/Legal/copyright-software-19980720
[2] http://www.w3.org/Consortium/Legal/IPR-FAQ-20000620.html#DTD
By obtaining, using and/or copying this work, you (the licensee) agree that you have read, understood, and will comply with the following terms and conditions:
@rain-1
rain-1 / LLM.md
Last active May 2, 2024 08:08
LLM Introduction: Learn Language Models

Purpose

Bootstrap knowledge of LLMs ASAP. With a bias/focus to GPT.

Avoid being a link dump. Try to provide only valuable well tuned information.

Prelude

Neural network links before starting with transformers.

@usr-ein
usr-ein / Dockerfile
Last active May 2, 2024 08:07
Optimal multistaged Dockerfile for poetry
# syntax=docker/dockerfile:1
# Keep this syntax directive! It's used to enable Docker BuildKit
# Based on https://github.com/python-poetry/poetry/discussions/1879?sort=top#discussioncomment-216865
# but I try to keep it updated (see history)
################################
# PYTHON-BASE
# Sets up all our shared environment variables
################################
@vegard
vegard / kernel-dev.md
Last active May 2, 2024 08:05
Getting started with Linux kernel development

Getting started with Linux kernel development

Prerequisites

The Linux kernel is written in C, so you should have at least a basic understanding of C before diving into kernel work. You don't need expert level C knowledge, since you can always pick some things up underway, but it certainly helps to know the language and to have written some userspace C programs already.

It will also help to be a Linux user. If you have never used Linux before, it's probably a good idea to download a distro and get comfortable with it before you start doing kernel work.

Lastly, knowing git is not actually required, but can really help you (since you can dig through changelogs and search for information you'll need). At a minimum you should probably be able to clone the git repository to a local directory.

@yspkm
yspkm / NVIDIA Driver, CUDA, and cuDNN Installation Guide for Ubuntu22.04.md
Last active May 2, 2024 08:04
How to use CUDA in Ubuntu (with torch, cupy, cudnn.h + )

NVIDIA Setup Guide: Driver, CUDA, cuDNN & Data Libraries on Ubuntu 22.04

This guide will walk you through the process of setting up NVIDIA drivers, CUDA, cuDNN, and some popular data science libraries on Ubuntu 22.04.

Before You Begin

  • Ensure you have administrative privileges on your computer.
  • Make sure you are connected to the internet.

Installation Steps

@tan9
tan9 / ezlearning.user.js
Last active May 2, 2024 08:02
CHT e-Learning Assistant
// ==UserScript==
// @name CHT e-Learning Assistant
// @source https://gist.github.com/tan9/41686eab8e704bb18885a24339010d65
// @version 0.7.2
// @description Learn with no pain (and hopefully not no gain...)
// @author tan9, danny
// @downloadURL https://gist.githubusercontent.com/tan9/41686eab8e704bb18885a24339010d65/raw/
// @updateURL https://gist.githubusercontent.com/tan9/41686eab8e704bb18885a24339010d65/raw/
// @require https://www.gstatic.com/firebasejs/4.9.0/firebase.js
// @require https://code.jquery.com/jquery-1.12.4.min.js
@nitheeshkl
nitheeshkl / gige_gst_v4l.md
Last active May 2, 2024 08:02
Gstreamer pipelines to use GigE cams as webcam for Zoom/Teams/Skype

Using GigE cam as webcam for Zoom/Skype/Teams

TL;DR: Creates a Gstreamer pipeline to read camera frames from a GigE camera, using Aravis library, and publish them as V4l2 camera source, using V4l2loopback, that can be read by video conferencing programs like Zoom/Skype/Teams.

gst-launch-1.0 aravissrc blocksize=5013504 h-binning=1 v-binning=1 ! video/x-bayer,format=rggb,framerate=100/5,width=2448,height=2048 ! bayer2rgb ! video/x-raw,format=RGBx ! videoconvert ! video/x-raw,format=YUY2 !  aspectratiocrop aspect-ratio=16/9 ! videoscale ! video/x-raw,width=1280,height=720 ! queue ! v4l2sink device=/dev/video0

The Basics

@mvaisakh
mvaisakh / Bringup.md
Last active May 2, 2024 08:01
An Android Device Tree Bringup Guide

A small Device Tree Bringup Guide

Introduction

So, you guys might be wondering, how do these "Developers" get your favourite Custom roms, such as LineageOS, Paranoid Android etc., to their own devices. Well I'm here to Guide you on how to do it, specifically on how to bringup or make your own device tree from scratch or adapting.

Gist of this Guide: This is for people with genuine interest in Android OS porting/development. After going through this guide, you should be able to do a total device tree bringup on your own.

Prerequisite: Certain requirements are to be met before you start with this amazing journey.