Skip to content

Instantly share code, notes, and snippets.

View rigelk's full-sized avatar
☄️
Sinking in

Rigel Kent rigelk

☄️
Sinking in
View GitHub Profile
@rigelk
rigelk / foo.py
Last active May 8, 2017 17:27
websocket client with events for an 2.7 only python experiment
from ws4py.client.geventclient import WebSocketClient
from event_dispatching import EventEmitter
from app.setup_event_loop import start_event_loop
from app.setup_app_logging import setup_logging
from gevent.event import Event
import gevent
import signal
import copy
import sys
@rigelk
rigelk / PairingLibs.md
Created December 7, 2017 16:23 — forked from artjomb/PairingLibs.md
List of Pairing Libraries

Pairings can be used for all kinds of advanced cryptographic schemes such as Encryption (Identity-based, Attribute-based, Predicate-based, etc.), Signatures, Zero-Knowledge Proofs, etc. It is in no particular order.

Provides multiple types of Elliptic Curve groups with appropriate pairings on top of them. Code repository resides here.

License: LGPL
Language: C
Thesis: On the Implementation of Pairing-Based Cryptography by Ben Lynn (2007)

MPV, youtube-dl and web browsers

Play YouTube videos (or audio) with 2 clicks?

3_CTHRSQ.png

Video

cp /usr/share/applications/mpv.desktop ~/.local/share/applications/mpvv.desktop

@rigelk
rigelk / peertube.conf
Last active April 25, 2025 21:53
a now OUTDATED httpd/Apache vhost to run PeerTube | note that only Nginx is supported by the PeerTube team, and with this or any other Apache configuration, you will likely get NO SUPPORT.
# requires WebSocket support with `a2enmod proxy_wstunnel`
# check https://ssl-config.mozilla.org/#server=apache&version=2.4.41&config=modern&openssl=1.1.1d&hsts=false&ocsp=false&guideline=5.6 for hardening security
<VirtualHost *:80 [::]:80>
ServerName peertube.example.com
ServerAdmin [email protected]
Protocols h2c http/1.1
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/\.well\-known/acme\-challenge/
@rigelk
rigelk / design-pr-template.md
Last active February 21, 2018 03:30
A template for design PRs

A few sentences describing the overall goals of the pull request’s commits.

Design Changes

Related Items

List related task, documentation, pull requests, etc.

Steps to Test or Reproduce

/*
we check feed validity using:
- XSD for RSS 2.0 -> https://raw.githubusercontent.com/ultraq/rss-xml-generator/master/Schema/RSS-2.0.xsd
- JSON Schema for… JSON Feed -> https://raw.githubusercontent.com/sonicdoe/jsonfeed-schema/master/schema-v1.json
*/
const JSONFeedInstanceJSONSchema = require('jsonfeed-schema')
JSONFeedInstanceJSONSchema.properties.items.items.additionalProperties = true
async function loadXSD (path): Promise<string> {
@rigelk
rigelk / chrooted.sh
Created May 2, 2018 23:13 — forked from andsens/chrooted.sh
Configure server for chrooted sftp users and create those users
#!/bin/bash
# source this file in /root/.bashrc or /root/.zshrc
# Sets up the server for chrooted users
configure_chrooted() {
grep ^chrooted: /etc/group
if [[ $? == 0 ]]; then
printf "The chrooted group already exists, aborting...\n"
exit 1
@rigelk
rigelk / ffmpeg-utils.ts
Created July 28, 2018 09:25
check streamability
async function isVideoFileStreamable (path: string): Promise<{ [key: string]: boolean }> {
let stream = fs.createReadStream(path, {
encoding: null,
start: 0,
end: 1024 * 1024
})
const isAVC = (await getVideoFileStream(path)).filter(s => {
return s['codec_name'] === 'h264' &&
s['bit_rate'] < 3000000
import {
ComponentFixture,
TestBed
} from '@angular/core/testing'
import { FormsModule, ReactiveFormsModule } from '@angular/forms'
import { RouterTestingModule } from '@angular/router/testing'
import { VideosProvider, VideoService } from '../../shared/video/video.service'
import { VideoUpdateComponent } from '../+video-edit/video-update.component'
import { VideoEditComponent } from '../+video-edit/shared/video-edit.component'
import { VideosModule } from '../videos.module'
@rigelk
rigelk / diff.patch
Created September 30, 2018 11:18
PeerTube #1135 proposal
diff --git server/helpers/ffmpeg-utils.ts server/helpers/ffmpeg-utils.ts
index ed823a67..92025092 100644
--- server/helpers/ffmpeg-utils.ts
+++ server/helpers/ffmpeg-utils.ts
@@ -116,10 +116,6 @@ type TranscodeOptions = {
function transcode (options: TranscodeOptions) {
return new Promise<void>(async (res, rej) => {
- if (options.resolution === undefined) {
- return rej('Invalid video file')