Skip to content

Instantly share code, notes, and snippets.

@rafaelcaricio
rafaelcaricio / raspberry-pi-zero_as_webcam.md
Created June 14, 2024 06:04 — forked from justinschuldt/raspberry-pi-zero_as_webcam.md
Directions for setting up a RaspberryPi to act as a generic USB webcam

hardware/software

Webcam parts:

  • Raspberry Pi Zero W Rev 1.1
  • Raspberry Pi Camera v2 (8-megapixel)
  • Raspberry Pi High Quality Camera (12.3-megapixel)
  • Raspbian Buster Lite 2020-02-13

Webcam works with:

  • Windows 10
  • Windows 10 "Camera" app
// ==UserScript==
// @name Mastodon Bird UI Conversafiada.net
// @match https://conversafiada.net/*
// @grant GM_addStyle
// @grant GM_getResourceText
// @version 2
// @description A UserScript that applies the Mastodon Bird UI style to conversafiada.net
// @resource layout-single-column https://raw.githubusercontent.com/ronilaukkarinen/mastodon-bird-ui/master/layout-single-column.css
// @resource layout-multiple-columns https://raw.githubusercontent.com/ronilaukkarinen/mastodon-bird-ui/master/layout-multiple-columns.css
// @downloadURL https://gist.github.com/rafaelcaricio/096231368e9391ed703fcde16c433a8c/raw/mastodon-bird-ui.user.js
@rafaelcaricio
rafaelcaricio / ffmpeg_bars_and_tone_stream.sh
Created January 16, 2023 15:23 — forked from tjensen/ffmpeg_bars_and_tone_stream.sh
FFMPEG command for generating a "bars and tone" RTMP live stream
ffmpeg -re \
-f lavfi -i "smptebars=rate=30:size=640x360" \
-f lavfi -i "sine=frequency=1000" \
-vf drawtext="text='%{pts\:hms}':rate=30:x=(w-tw)/2:y=(h-lh)/2:fontsize=48:fontcolor=white:box=1:boxcolor=black" \
-f flv \
-vcodec libx264 -profile:v baseline -pix_fmt yuv420p -preset ultrafast -tune zerolatency -crf 28 \
-acodec aac \
rtmp://streaming-server/live/key
# https://github.com/kubernetes/contrib/blob/master/ingress/controllers/nginx/examples/default-backend.yaml
apiVersion: v1
kind: ReplicationController
metadata:
name: default-http-backend
spec:
replicas: 1
selector:
app: default-http-backend
template:
@rafaelcaricio
rafaelcaricio / gpg-agent.conf
Created May 10, 2016 12:30 — forked from nl5887/gpg-agent.conf
Using GPG Agent on OS-X
launchctl unload -w -S Aqua /System/Library/LaunchAgents/gpg.agent.daemon.plist
launchctl load -w -S Aqua /System/Library/LaunchAgents/gpg.agent.daemon.plist
@rafaelcaricio
rafaelcaricio / gist:4620635
Last active December 11, 2015 15:28
Should use the complete path name.

Setting up fresh Ubuntu server for Ruby on Rails

Once in a while you, as a Ruby developer, are faced with product owner's "Allright, now it's time to make it live". And then you probably think "I'll be fighting with these stubborn servers for next few days....". If you have very simple app or one at the early stages of its lifetime you can use one of "no hassle deployment" platforms like Heroku or OpenShift. But chances are you need some custom stuff that is hard to achieve on these kind of platforms or you just feel better with "root" access.

You have many options for setting up Linux servers. Amongst the most popular ones are Chef and Puppet. Various hosting provider also add their own solutions for provisioning boxes (like Stackscripts on Linode). Or you can do it "the old-school way", manually. If you don't need multiple machines and/or you have just a simple Rails s

@rafaelcaricio
rafaelcaricio / robot.js
Created December 5, 2012 00:47 — forked from fabiopimentel/robot.js
[CAELUM TEAM]Megatron
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.clone();
@rafaelcaricio
rafaelcaricio / robot.js
Created December 3, 2012 15:03 — forked from victorlcampos/robot.js
Bartorista
function Robot(robot) {}
// well, we need to do something...
// whenever our robot is idle, this method gets called.
Robot.prototype.onIdle = function(ev) {
var robot;
robot = ev.robot;
robot.ahead(50);
robot.turn(90);
robot.rotateCannon(10);
robot.rotateCannon(-20);
@rafaelcaricio
rafaelcaricio / robot.js
Created December 3, 2012 15:03 — forked from victorlcampos/robot.js
Bartorista
function Robot(robot) {}
// well, we need to do something...
// whenever our robot is idle, this method gets called.
Robot.prototype.onIdle = function(ev) {
var robot;
robot = ev.robot;
robot.ahead(50);
robot.turn(90);
robot.rotateCannon(10);
robot.rotateCannon(-20);