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 <[email protected]>
@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'
@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
@Steveorevo
Steveorevo / install.php
Last active April 6, 2016 07:08
Automate your WordPress installation with this WordPress "drop in" (goes in your wp-contents folder).
<?php
echo 'This has been customized!!!';
// Perform post-install customizations
if ( function_exists( 'add_action' ) ){
add_action( 'wp_mail_content_type' , 'customize_install' );
function customize_install(){
// Switch themes
switch_theme('twentytwelve');