Skip to content

Instantly share code, notes, and snippets.

@jedi4ever
jedi4ever / gist:903751
Created April 5, 2011 14:51
Tuning stuff for Ubuntu hosts
# /etc/security/limits.conf
* soft nofile 999999
* hard nofile 999999
root soft nofile 999999
root hard nofile 999999
===========================================================
# /etc/sysctl.conf
# sysctl for maximum tuning
@jedi4ever
jedi4ever / main.cpp
Created April 28, 2021 09:05 — forked from metalinspired/main.cpp
TMC2209 UART
/**
* Author Milan Divkovic
*
* You can control the motor with following commands:
* 0: Disables the motor
* 1: Enables the motor
* + or -: Increase or decrease speed in respect to rotation direction
*/
#include <Arduino.h>

These are notes while researching a way to convert a browser/website to a stream. This could be used for Facebook Live or for webrecording. TL'DR:

  • I started with Phantomjs - but that didn't support the html5 video tag
  • SlimerJS supports it, but there is no way to record audio directly (though this might come from desktop audio)
  • So I moved to research ffmpeg/X11/XVFB to record it with linux which works
  • But ffmpeg has no easy way to mix streams/overlays to I moved on to OBS with overlay browser support
  • I started researching options OBS in docker and it needed best a GPU , so I move to nvidia-docker
  • And so came across building game servers on EC2/AWS using GPUs and managed to run OBS inside of GPU g2x.large machine
  • I tried streaming to twich , which works great and managed to restream 4K 60FPS youtube on an AWS instance
  • Remote control works through OBS-Remote but OBS has kinda limit in types of features
@jedi4ever
jedi4ever / nodejs-cluster-zero-downtime.md
Last active February 11, 2024 13:45
nodejs clustering, zero downtime deployment solutions

Clustering: The basics

The trick? pass the file descriptor from a parent process and have the server.listen reuse that descriptor. So multiprocess in their own memory space (but with ENV shared usually)

It does not balance, it leaves it to the kernel.

In the last nodejs > 0.8 there is a cluster module (functional although marked experimental)

@jedi4ever
jedi4ever / upload-to-appstore.sh
Created August 18, 2014 12:13
Command upload App/Ipa to the iTunes Connect App Store
#!/bin/bash
set -ex
# This scripts allows you to upload a binary to the iTunes Connect Store and do it for a specific app_id
# Because when you have multiple apps in status for download, xcodebuild upload will complain that multiple apps are in wait status
# Requires application loader to be installed
# See https://developer.apple.com/library/ios/documentation/LanguagesUtilities/Conceptual/iTunesConnect_Guide/Chapters/SubmittingTheApp.html
# Itunes Connect username & password
USER=bla
@jedi4ever
jedi4ever / gist:d095656ae0f0eca4a83ebb2b331da367
Last active January 11, 2024 22:01
Chromium build with proprietary codecs
@jedi4ever
jedi4ever / gist:944216
Created April 27, 2011 13:08
build .deb for redis via fpm
VERSION=2.2.5
apt-get -y install wget
rm -rf redis-$VERSION
wget http://redis.googlecode.com/files/redis-2.2.5.tar.gz -O redis-$VERSION.tar.gz
tar -xzvf redis-$VERSION.tar.gz
cd redis-$VERSION
./configure --prefix=/usr
make
rm -rf /tmp/redis-$VERSION.$$
mkdir /tmp/redis-$VERSION.$$
@jedi4ever
jedi4ever / .vscode-settings.json
Last active August 4, 2023 21:34
Make Langchain and pytest working
python@9cc8ee288f2f:~/.vscode-server/data/Machine$ more settings.json
{
"python.testing.pytestEnabled": true,
"python.testing.pytestArgs": [
"--disable-socket",
"--allow-unix-socket",
"tests/unit_tests"
],
"python.poetryPath": "/opt/poetry/bin/poetry",
"python.testing.cwd": "/workspaces/libs/langchain"
@jedi4ever
jedi4ever / dev.Dockerfile
Last active August 4, 2023 20:20
improved devcontainer for langchain
# This is a Dockerfile for running unit tests
# Use the Python base image
FROM python:3.11.2-bullseye
# install bash completion - to make make work
RUN apt-get update && apt-get install -y bash-completion
# Install nodejs & yarn (for docs)
@jedi4ever
jedi4ever / gist:1864622
Created February 19, 2012 16:55
parallels sdk send keycodes
import sys
import prlsdkapi
if len(sys.argv) != 4:
print "Usage: parallels_send_keycode '<VM_NAME>' '<keyname>' '<press|release>'"
exit()
# Parse arguments
vm_name=sys.argv[1]
# Keycode to use