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
# Aliases | |
alias c="clear" | |
alias ll="ls -lah" | |
alias lz="ls -laZ" # include (selinux) security context in listing | |
alias cl="c && ll" | |
alias ..="cd .." | |
# Empty contents of files | |
empty() { | |
for arg in "$@" |
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
CURL | |
curl -o /dev/null -w "Connection Time: %{time_connect} TTFB: %{time_starttransfer} Total Time: %{time_total} \n" https://example.com/ | |
Documentation & formatting variables: | |
https://curl.haxx.se/docs/manpage.html#-w | |
Apache Bench | |
ab -n 1000 -c 100 https://example.com/ |
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
Recommended Repos | |
https://wiki.centos.org/AdditionalResources/Repositories | |
PHP | |
https://ius.io/ | |
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
OSX DiskUtility Format | |
sudo diskutil eraseDisk FAT32 NAME MBRFormat /dev/disk1 | |
Copy Image | |
sudo dd bs=1m if=/path/to/raspbian.img of=/dev/disk1 | |
Setup | |
https://www.losant.com/blog/getting-started-with-the-raspberry-pi-zero-w-without-a-monitor | |
PiZero W does not support 5GHz WiFi |
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 | |
/** | |
* Reference: https://websmartdesign.nz/searching-structured-post-data-with-wordpress/ | |
*/ | |
// Join wp_postmeta | |
add_filter('posts_join', function($join) { | |
global $wpdb; | |
$join .= "LEFT JOIN {$wpdb->postmeta} ON ({$wpdb->posts}.ID = {$wpdb->postmeta}.post_id) "; |
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 | |
/** | |
* Reference: https://websmartdesign.nz/searching-structured-post-data-with-wordpress/ | |
* Make meta data searchable | |
*/ | |
// Join wp_postmeta | |
add_filter('posts_join', function($join) { | |
global $wpdb; |
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 | |
run() | |
{ | |
/usr/share/elasticsearch/bin/elasticsearch-plugin $1 | |
} | |
init() | |
{ | |
# Get installed plugins |
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 array indexOf() method | |
* | |
* @param {object} Object | |
* @param {int} max | |
* @param {int} min) | |
* @return {mixed} | |
*/ | |
if (!Array.prototype.indexOf) Array.prototype.indexOf = (function(Object, max, min){ | |
"use strict"; |
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 | |
/** | |
* Force Login | |
*/ | |
function force_login() { | |
if (!is_user_logged_in()) { | |
$url = home_url($_SERVER['REQUEST_URI']); | |
$whitelist = []; |
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 | |
# Loop through links | |
while IFS="" read -r LINE || [ -n "$LINE" ]; do | |
# Replace domain (everything before "/media") | |
PATH=${LINE//**\/media/media} | |
# Get file file name (everything after the last "/") | |
FILE_NAME=${PATH//*\//} |
OlderNewer