Skip to content

Instantly share code, notes, and snippets.

View jasontucker's full-sized avatar

Jason Tucker jasontucker

View GitHub Profile
<?php
/**
* Auto-Update Enabler
*
* Decisions, not options. Inspired by Trac ticket #58389 by
* Jos Velasco and an offhanded comment on the fedi by Andy
* Fragen.
*
* @package Auto-Update Enabler
* @author Jason Cosper <boogah@gmail.com>
@dannygsmith
dannygsmith / wp-create
Last active December 29, 2018 09:56
Script to create new WordPress Site
#!/usr/bin/env bash
export HOME="/Users/john"
#styles
VP_NONE='\033[00m'
VP_RED='\033[01;31m'
VP_GREEN='\033[01;32m'
VP_YELLOW='\033[01;33m'
VP_PURPLE='\033[01;35m'
@dannygsmith
dannygsmith / wp-db-restore
Last active December 13, 2017 03:47
Restore all WordPress databases in laravel valet
#!/usr/bin/env bash
SUFFIX=`date "+%w"`
#styles
VP_NONE='\033[00m'
VP_RED='\033[01;31m'
VP_GREEN='\033[01;32m'
VP_YELLOW='\033[01;33m'
VP_PURPLE='\033[01;35m'
/* First image to video, add background image for getting the correct aspect:ratio */
/* Rescale the second image to fit height or width depending on their max size */
/* Add zoom pan effect, from the center to the right */
ffmpeg -i background.jpg -i firstimage.jpg -filter_complex "[1:v]scale='if(gt(a,4/3),1920,-1):if(gt(a,4/3),-1,1080)' [ovrl], [0:v][ovrl] overlay=(main_w-overlay_w)/2:(main_h-overlay_h)/2, zoompan=z='zoom+0.001':x='if(gte(zoom,1.5),x+1)':d=1000" -t 5.96 -r 23.976 -b:v 6500k -minrate 6500k -maxrate 6500k -bufsize 1385 -s 1920x1080 -aspect 16:9 -c:v libx264 -threads 2 -an -vcodec libx264 -b:v 6500k -minrate 6500k -maxrate 6500k -bufsize 1835k firstImage.m2v
/* Do the same for third image */
ffmpeg -i background.jpg -i https://s3-us-west-1.amazonaws.com/hyundai-nfl-uat-s3bucket/hyundai-nfl/uploads/userFiles/89/12473928-10208483723709039-458355032907144613-ojpg -filter_complex "[1:v]scale='if(gt(a,4/3),1920,-1):if(gt(a,4/3),-1,1080)' [ovrl], [0:v][ovrl] overlay=(main_w-overlay_w)/2:(main_h-ov
@boogah
boogah / .bash_profile
Last active February 24, 2016 01:36
One command to upgrade npm, Atom packages & Homebrew. Based on http://blog.thibmaekelbergh.be/2015/12/15/5-minute-guide-to-keeping-your-system-updated.html
# Note: You won't have access to this command until you run `source ~/.bash_profile` or log back in!
# Call this from cron or run manually as needed.
function update() {
echo "" ; echo "`date`: RUNNING: npm update"
npm install npm -g # Update npm itself
echo "`date`: FINISHED: npm update" ; echo "" ; echo "`date`: RUNNING: npm package updates"
npm update -g # Update installed npm packages
echo "`date`: FINISHED: npm package updates" ; echo "" ; echo "`date`: RUNNING: atom update"
apm upgrade -c false # Update Atom packages & themes
@gauntface
gauntface / toggle-remote-styles.js
Last active March 12, 2020 12:56
A book marklet to toggle styles.
javascript:(function(){var styles = document.querySelectorAll('link[rel=\'stylesheet\']'); for (var s = 0; s < styles.length; s++) {styles[s].mediax = styles[s].media;if (styles[s].media === 'only x') { styles[s].media = styles[s].mediax; } else if (styles[s].media !== 'print') {styles[s].media = 'only x';}}})();
@renatolfc
renatolfc / ovpn-writer.sh
Created December 28, 2014 18:50
Script to generate an OpenVPN client configuration file in the unified format
#!/bin/sh
##
## Usage: ./ovpn-writer.sh SERVER CA_CERT CLIENT_CERT CLIENT_KEY SHARED_SECRET > client.ovpn
##
server=${1?"The server address is required"}
cacert=${2?"The path to the ca certificate file is required"}
client_cert=${3?"The path to the client certificate file is required"}
client_key=${4?"The path to the client private key file is required"}
#! /bin/bash -x
VBR="2500k"
FPS="30"
QUAL="medium"
YOUTUBE_URL="rtmp://a.rtmp.youtube.com/live2"
SOURCE="rtsp://xxx.xxx.xxx:554/Streaming/Channels/1"
KEY="xxxxxxxxxxxxxxxx.xxx-xxx-qms4-emuc"
#ffmpeg \
@dhrrgn
dhrrgn / gist:10125477
Last active February 26, 2021 18:42
Upgrade Ubuntu OpenSSL to patch Heartbleed
sudo apt-get update
sudo apt-get install -y libssl1.0.0 openssl
# Confirm Build Date is at least Aril 7th 2014
openssl version -a
# Restart all services listed by this command:
sudo lsof -n | grep ssl | grep DEL
@mahemoff
mahemoff / commonfollowers.sh
Created December 1, 2013 00:43
Find common followers of 2 Twitter accounts using https://github.com/sferik/t
#!/bin/bash
t followers $1 > /tmp/followers1.$$.txt
t followers $2 > /tmp/followers2.$$.txt
comm -12 /tmp/followers1.$$.txt /tmp/followers2.$$.txt