This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// clean URLs for attachments | |
// http://domain.com/?attachment_id=173 | |
// http://domain.com/attachment/173 | |
function rkv_attachment_urls($wp_rewrite){ | |
$new_rules = array(); | |
$new_rules['media/(\d*)$'] = 'index.php?attachment_id=$matches[1]'; | |
$wp_rewrite->rules = $new_rules + $wp_rewrite->rules; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## Crontab Example: | |
## #*/3 * * * * /bin/sh ~/htaccessdynamic.sh whatevermydyndnsis.dyndns-remote.com ~/domainiwanttoprotect.com/.htaccess > /dev/null 2>&1 | |
dynDomain="$1" | |
htaccessLoc="$2" | |
dynIP=$(/usr/bin/dig +short $dynDomain) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=IF(RIGHT(A1,(LEN(A1)-(LEN(A1)-1)))="/",LEFT(A1,(LEN(A1)-1)),A1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'init', 'cd_add_editor_styles' ); | |
/** | |
* Apply theme's stylesheet to the visual editor. | |
* | |
* @uses add_editor_style() Links a stylesheet to visual editor | |
* @uses get_stylesheet_uri() Returns URI of theme stylesheet | |
*/ | |
function cd_add_editor_styles() { | |
add_editor_style( get_stylesheet_uri() ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
t followers $1 > /tmp/followers1.$$.txt | |
t followers $2 > /tmp/followers2.$$.txt | |
comm -12 /tmp/followers1.$$.txt /tmp/followers2.$$.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /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 \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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';}}})(); |
OlderNewer