Skip to content

Instantly share code, notes, and snippets.

View vpalmisano's full-sized avatar

Vittorio Palmisano vpalmisano

View GitHub Profile
import {MediaKind, RtpCodecParameters, RtpParameters} from "mediasoup/lib/RtpParameters";
import {DtlsFingerprint, DtlsParameters, IceCandidate, IceParameters} from "mediasoup/lib/WebRtcTransport";
export interface ISdpConsumer {
id: string;
kind: MediaKind;
rtpParameters: RtpParameters;
removed: boolean;
}
@tavinus
tavinus / cloudsend.sh
Last active July 24, 2023 11:58
Send files to Nextcloud/Owncloud shared folder using curl
#!/usr/bin/env bash
############################################################
# MIGRATED TO REPOSITORY
# https://github.com/tavinus/cloudsend.sh
#
# This gist will NOT be updated anymore
############################################################
############################################################
#!/bin/bash
export MAKEFLAGS="-j 3"
set -e
VERSION="1.16.0"
LIBNICE_VERSION="0.1.16" # libnice (v>=0.1.14) needed for webrtcbin
LIBSRTP_VERSION="2.2.0" # libsrtp (v>=2.2.0) required for srtp plugin
WEBRTCAUDIO_VERSION="0.3.1" # webrtc-audio-processing required for webrtcdsp
[ -n "$1" ] && VERSION=$1
@cheethoe
cheethoe / gist:49d9c1d0003e44423e54a060e0b3fbf1
Last active April 14, 2022 21:01
Rook v0.8.0 device/osd removal
# This will use osd.5 as an example
# ceph commands are expected to be run in the rook-toolbox
1) disk fails
2) remove disk from node
3) mark out osd. `ceph osd out osd.5`
4) remove from crush map. `ceph osd crush remove osd.5`
5) delete caps. `ceph auth del osd.5`
6) remove osd. `ceph osd rm osd.5`
7) delete the deployment `kubectl delete deployment -n rook-ceph rook-ceph-osd-id-5`
8) delete osd data dir on node `rm -rf /var/lib/rook/osd5`
# Connectiong by SSH from Android Termux to Desktop and vice-versa.md
# Copyright (c) 2019 Evandro Coan
# 
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: hpa-downscale-limiter
namespace: kube-system
spec:
schedule: "*/3 * * * *"
concurrencyPolicy: Forbid
jobTemplate:
spec:
@zupzup
zupzup / main.go
Last active May 16, 2024 16:48
ElasticSearch to Prometheus Exporter in Go
package main
import (
"context"
"github.com/go-chi/chi"
"github.com/go-chi/render"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
log "github.com/sirupsen/logrus"
"gopkg.in/olivere/elastic.v6"
@jedi4ever
jedi4ever / gist:d095656ae0f0eca4a83ebb2b331da367
Last active January 11, 2024 22:01
Chromium build with proprietary codecs
@alxhub
alxhub / ngsw-doc-draft.md
Last active April 24, 2020 07:26
NGSW Documentation Draft (full)

What are Service Workers (and why might you want one)?

Service Workers are a new technology in modern web browsers. They augment the normal web deployment model and empower applications to deliver reliability and performance on par with natively installed code.

Service Workers have many different capabilities, but the most important is their function as a network proxy. They intercept all outgoing HTTP requests made by the application and can choose how to respond to them. For example, they can query a local cache and deliver a cached response if one is available. Proxying isn't limited to requests made through programmatic APIs (such as fetch), but includes resources referenced in HTML and even the initial request to index.html itself. Service Worker-based caching is thus completely programmable, and doesn't rely on server-specified caching headers.

Unlike the other scripts which make up an application (such as the Angular app bundle), the Service Worker is preserved after the user closes the tab. T

@ben-cohen
ben-cohen / shared_mutex.c
Created July 12, 2017 19:25
Mutex in mmap memory shared between processes.
/*
* shared_mutex: Mutex in mmap memory shared between processes.
*
* Ben Cohen, July 2017.
*
* Compile using:
* gcc -o shared_mutex shared_mutex.c -ggdb -Wall -std=c99 -pthread
*
* Two processes are created with an mmap shared memory region
* containing an array of chars and a mutex. The mutex is created with