Skip to content

Instantly share code, notes, and snippets.

View nicopace's full-sized avatar

Nicolás Pace nicopace

View GitHub Profile
modprobe v4l2loopback video_nr=3
gst-launch-1.0 -v ximagesrc startx=1 starty=1 endx=320 endy=240 ! videoconvert ! "video/x-raw,format=YUY2" ! tee ! v4l2sink device=/dev/video3
# you can also use gst-launch to select a window https://superuser.com/questions/709866/ffmpeg-x11grab-a-single-window
<script>
window.erxesSettings = {
messenger: {
brand_id: "st3FrK",
},
};
(function() {
var script = document.createElement('script');
@nicopace
nicopace / gist:21e33fb89f217023f827b1ebd25b122e
Last active March 16, 2020 13:45
WebRTC P2P apps without centralized servers
1. Use local app server and mdns/bonjour/zeroconf to announce it for signalling
2. use webrtc for p2p udp communications
https://github.com/bykof/cordova-plugin-webserver
https://github.com/floatinghotpot/cordova-httpd
https://github.com/becvert/cordova-plugin-zeroconf
https://github.com/cjb/serverless-webrtc
Uses:
* use pouchdb to sync dbs p2p for coordination
@nicopace
nicopace / gist:945cb03f3868c8b249b8b0e446d049cc
Created February 24, 2020 03:01
Run raspberry pi on qemu emulation
qemu-system-arm -kernel ~/Downloads/kernel-qemu-4.19.50-buster -cpu arm1136-r2 -M versatilepb -dtb ~/Downloads/versatile-pb.dtb -no-reboot -append "root=/dev/sda2 panic=1" -drive format=raw,file=2020-02-23-wiki-lite-qemu.img -nographic
<html>
<body>
<script src="https://togetherjs.com/togetherjs-min.js"></script>
<button onclick="TogetherJS(this); return false;">Start TogetherJS</button>
<script>
document.addEventListener('DOMContentLoaded', function() {
document.getElementById('browsingSession').href = 'https://tmate.io/t/' + window.location.hash.substring(1);
});
</script>
@nicopace
nicopace / ubuslisten.html
Created April 25, 2019 13:47
Server-sent events for openwrt on pure lua
<html>
<!-- this one goes in /www/ubuslisten.html -->
<meta charset="UTF-8">
<body></body>
<script>
var source = new EventSource("/cgi-bin/ubuslisten.lua");
source.addEventListener('message', function(e) {
console.log(e.data);
}, false);
@nicopace
nicopace / _workflows.md
Last active February 8, 2019 23:01
Workflows

This document will discribe a set of worklows I am implementing.

@nicopace
nicopace / Description.md
Created January 18, 2019 00:43
Freeze directories in a repository to a specific commit
git clone github.com/librerouterorg/openwrt.git
cd openwrt
wget https://gist.github.com/nicopace/b98c5c9d99e0a14c64b361522de3dc25/raw/56f58460366adb8ef0d9c6a678ab2190dc4b5784/freeze-directories.sh
wget https://gist.github.com/nicopace/b98c5c9d99e0a14c64b361522de3dc25/raw/56f58460366adb8ef0d9c6a678ab2190dc4b5784/freezed-directories
./freeze-directories.sh
@nicopace
nicopace / upload.php
Created December 10, 2018 13:38
Simple php file uploader
<?PHP
if(!empty($_FILES['uploaded_file']))
{
$path = "uploads/";
$path = $path . basename( $_FILES['uploaded_file']['name']);
if(move_uploaded_file($_FILES['uploaded_file']['tmp_name'], $path)) {
echo "The file ". basename( $_FILES['uploaded_file']['name']).
" has been uploaded";
} else{

Having local mirrors of Free Software has been always a very useful thing. The most common repositories that are usually mirrored are ubuntu or Debian, but we can also mirror Android Free Software apps. We can use fdroid-dl and host it in a HTTP server like NGINX.

To do this:

  • pip install https://github.com/t4skforce/fdroid-dl.git

(WIP)