Skip to content

Instantly share code, notes, and snippets.

tricarte tricarte

Block or report user

Report or block tricarte

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@tricarte
tricarte / ffmpeg.md
Created Oct 22, 2019 — forked from protrolium/ffmpeg.md
using ffmpeg to extract audio from video files
View ffmpeg.md

ffmpeg

Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

Convert WAV to MP3, mix down to mono (use 1 audio channel), set bit rate to 64 kbps and sample rate to 22050 Hz:

@tricarte
tricarte / wp-dos-patch.sh
Created Jul 7, 2019
patch wordpress for cve-2018-6389
View wp-dos-patch.sh
#! /bin/bash
if [[ -f wp-login.php && -f wp-admin/load-scripts.php && -f wp-admin/includes/noop.php ]]
then
sed -i "1 s/^.*$/<?php\ndefine('CONCATENATE_SCRIPTS', false);/" wp-login.php
sed -i -e "s/^require( ABSPATH . WPINC . '\/script-loader.php' );$/require( ABSPATH . 'wp-admin\/admin.php' );/g" wp-admin/load-scripts.php
sed -i -e "s/^require( ABSPATH . WPINC . '\/script-loader.php' );$/require( ABSPATH . 'wp-admin\/admin.php' );/g" wp-admin/load-styles.php
echo """<?php
/**
* Noop functions for load-scripts.php and load-styles.php.
@tricarte
tricarte / fragment-cache.php
Created Jul 7, 2019
wordpress fragment cache
View fragment-cache.php
<?php
// https://css-tricks.com/wordpress-fragment-caching-revisited/
function fragment_cache($key, $ttl, $function) {
if ( is_user_logged_in() ) {
call_user_func($function);
return;
}
$key = apply_filters('fragment_cache_prefix','fragment_cache_').$key;
$output = get_transient($key);
if ( empty($output) ) {
You can’t perform that action at this time.