Skip to content

Instantly share code, notes, and snippets.

Avatar

ROBERT MCDOWELL ROBERT-MCDOWELL

View GitHub Profile
@ROBERT-MCDOWELL
ROBERT-MCDOWELL / peertube.conf
Last active August 24, 2023 23:44 — forked from rigelk/peertube.conf
Unofficial support of the last and updated httpd/Apache vhost to run PeerTube
View peertube.conf
# PeerTube Apache configuration version 23.8.15
# For Apache version 2.4.47+
SSLSessionCache "shmcb:/usr/local/apache/logs/ssl_gcache_data(512000)"
SSLSessionCacheTimeout 87400
SSLStaplingCache shmcb:logs/stapling-cache(150000)
# Please check your Apache installation features the following modules via 'apachectl -M':
# STANDARD HTTP MODULES: core_module, proxy_module, proxy_http2_module, proxy_wstunnel_module, proxy_http_module, headers_module, remoteip_module, ssl_module, filter_module, reqtimeout_module
# THIRD PARTY MODULES: None.
@x-labz
x-labz / frame-transformer-js-wasm.js
Last active August 26, 2023 00:57
frame transformer with wasm
View frame-transformer-js-wasm.js
const W = 640; // video frame width
const H = 360; // video frame height
const pixelData = await imageLoader("./seaside.png"); // get the pixel data of the backgroung image in RGBA format
const buffer = new Uint8Array(W * H * 1.5); // byte buffer for the incoming frame in YUV 422 format
const bufferRGB = new Uint8Array(W * H * 4); // byte buffer for the result frame in RGBA format
const transformer = new TransformStream({
async transform(videoFrame, controller) {
const copyResult = await videoFrame.copyTo(buffer);
View renew-letsencrypt-certificates.sh
#!/bin/bash
#
# renew-letsencrypt-certificates.sh DOMAIN [EMAIL]
#
# Copy Let's Encrypt SSL certs from a remote public facing web server to local filesystem
# Look for changes, if any change, restarts the web service
# Useful for using Let's Encrypt with local internal servers, with custom DNS.
# Working "mail" command needed for email alerts
#
@stewartmcgown
stewartmcgown / takeout-discovery.json
Last active June 21, 2023 20:54
Google Takeout API
View takeout-discovery.json
{
"title": "Takeout API",
"discoveryVersion": "v1",
"ownerName": "Google",
"version_module": true,
"resources": {
"exports": {
"methods": {
"get": {
"flatPath": "v2/{service}/exports/{exportId}",
@Jiab77
Jiab77 / real-time-php-fpm-status.md
Last active July 26, 2023 18:40
Real-time PHP-FPM Status
View real-time-php-fpm-status.md

Real-time PHP-FPM Status

This gist will explain you how to enable an undocumented feature of PHP-FPM which will give a real-time performance stats.

Everybody knows the famous phpinfo() and the page it generates, right? Then the real-time PHP-FPM status page design is very similar.

image

Some informations from the top are not displayed to avoid security issues.

Enable PHP-FPM Status

@teacupx
teacupx / widevine-flash_arm64.sh
Created December 30, 2018 19:30 — forked from ruario/1-README.md
Fetches a ChromeOS image for ARM and extracts the Widevine and Flash binaries, saving them in a compressed archive
View widevine-flash_arm64.sh
#!/bin/sh -eu
# Make sure we have wget or curl
available () {
command -v "$1" >/dev/null 2>&1
}
if available wget; then
DL="wget -O-"
DL_SL="wget -qO-"
elif available curl; then
@ruario
ruario / 1-README.md
Last active September 10, 2023 10:21
A script that fetches a ChromeOS image for ARM32 and extracts the Widevine binary, saving it in a compressed archive for use with Vivaldi
View 1-README.md

The included script 'widevine-flash_armhf.sh' fetches a ChromeOS image for ARM and extracts the Widevine binary, saving it in a compressed archive. Since it downloads a fairly large file (2Gb+ on disk after download) it is recommended that you run the script on a machine that has plenty of disk space.

To install the resultant archive, issue the following on your ARM machine–after copying over the archive if needed:

sudo tar Cfx / widevine-flash-20200124_armhf.tgz

(Where 'widevine-flash-20200124_armhf.tgz' is updated to reflect the actual name of the created archive)

@supix
supix / postgres_recovery.md
Last active September 16, 2023 10:01
Postgres error: Missing chunk 0 for toast value in pg_toast
View postgres_recovery.md

The problem

In some cases, it is possible that PostgreSQL tables get corrupted. This can happen in case of hardware failures (e.g. hard disk drives with write-back cache enabled, RAID controllers with faulty/worn out battery backup, etc.), as clearly reported in this wiki page. Furthermore, it can happen in case of incorrect setup, as well.

One of the symptoms of such corruptions is the following message:

ERROR: missing chunk number 0 for toast value 123456 in pg_toast_45678

This almost surely indicates that a corrupted chunk is present within a table file. But there is a good way to get rid of it.

@berstend
berstend / AllowFlashInChromium.md
Last active January 22, 2020 10:21
Allow flash content to run by default in Chromium by using a management policy file
View AllowFlashInChromium.md

Tested on Ubuntu 14.04 and Chromium 65

Steps

apt-get install chromium-browser adobe-flashplugin

mkdir -p /etc/chromium/policies/managed

vim /etc/chromium/policies/managed/foo_policy.json
@tcurvelo
tcurvelo / takeout.js
Created April 18, 2018 00:46
WIP: Automating Google Takeout Download
View takeout.js
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch({headless: false});
const page = await browser.newPage();
await page.goto('https://takeout.google.com/');
const input = await page.evaluate(() => {
const next = document.querySelector('#identifierNext');