Skip to content

Instantly share code, notes, and snippets.

@CurtisL
CurtisL / .htaccess
Last active May 7, 2024 17:47
Better Maintenance Mode .htaccess rules
# BEGIN MAINTENANCE MODE
# ADD your IP address to gain access. Local IPS for local testing
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REMOTE_ADDR} !^192\.168\.0\.0
RewriteCond %{REMOTE_ADDR} !^127\.0\.0\.1
RewriteCond %{DOCUMENT_ROOT}/maintenance.html -f
RewriteCond %{DOCUMENT_ROOT}/maintenance.enable -f
RewriteCond %{SCRIPT_FILENAME} !maintenance.html
RewriteRule ^.*$ /maintenance.html [R=503,L]
@jxson
jxson / README.md
Created February 10, 2012 00:18
README.md template

Synopsis

At the top of the file there should be a short introduction and/ or overview that explains what the project is. This description should match descriptions added for package managers (Gemspec, package.json, etc.)

Code Example

Show what the library does as concisely as possible, developers should be able to figure out how your project solves their problem by looking at the code example. Make sure the API you are showing off is obvious, and that your code is short and concise.

Motivation

@LukeZGD
LukeZGD / ios-downgrade-dualboot.md
Last active May 7, 2024 17:41
Downgrade and dualboot status of almost all iOS devices

Downgrade and dualboot status of almost all iOS devices

UPDATED: 2024-05-02

@ifiokjr
ifiokjr / ADB Instructions.md
Last active May 7, 2024 17:41
Android Platform Tools
@geekman
geekman / myusbgadget
Created January 17, 2017 02:47
Pi Zero multiple USB gadgets minimal example
#!/bin/bash -e
modprobe libcomposite
cd /sys/kernel/config/usb_gadget/
mkdir g && cd g
echo 0x1d6b > idVendor # Linux Foundation
echo 0x0104 > idProduct # Multifunction Composite Gadget
echo 0x0100 > bcdDevice # v1.0.0
@ruario
ruario / authy-fetch-extract-snap.md
Last active May 7, 2024 17:38
How to download and install Twilio Authy on a desktop Linux system without snap support
  • Make an install directory somewhere convenient and switch to it
mkdir -p ~/.local/share/authy
cd ~/.local/share/authy
  • Fetch the current Authy snap
@diego3g
diego3g / settings.json
Last active May 7, 2024 17:38
VSCode Settings (Updated)
{
"workbench.startupEditor": "newUntitledFile",
"editor.fontSize": 14,
"editor.lineHeight": 1.8,
"javascript.suggest.autoImports": true,
"javascript.updateImportsOnFileMove.enabled": "always",
"editor.rulers": [80, 120],
"extensions.ignoreRecommendations": true,
"typescript.tsserver.log": "off",
"files.associations": {
@cjfswd
cjfswd / api_discord_get_channel_messages.js
Last active May 7, 2024 17:38
discord rest api get all messages from channel
import fs from 'fs'
import fetch from 'cross-fetch';
import dotenv from 'dotenv';
dotenv.config();
const TOKEN = process.env.TOKEN || ''
const GUILD_URL = process.env.GUILD_URL || ''
class IGuild {
@bogsen
bogsen / fix-plex-hdr-subtitles.md
Last active May 7, 2024 17:37
Fix Plex transcoding HDR videos very slowly when burning subtitles in at the same time

What?

For some reason, although Plex supports hardware-accelerated HDR tone mapping, Plex decides not to use it when subtitles need to be burned in. This results in extremely slow transcoding on hardware that should be able to keep up using hardware acceleration. I've noticed this issue on my server with Intel QuickSync, and this fix is made specifically for that case.

Before the fix, the SW tone mapping was only able to do 6-7 fps on a i5 7400T for an HDR 4K->1080p transcode. With the fix, that same transcode happens with HW tone mapping, and goes up to 82 fps. Even for HDR 4K->4K, this CPU is able to do 35 fps using QuickSync, thus keeping up with at least one video stream.