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
ALTER TABLE table_name CONVERT TO CHARACTER SET utf8 COLLATE 'utf8_unicode_ci'; |
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
find / -type f -name .htaccess 2>/dev/null -print -exec cat {} \; |
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 | |
#for file names | |
WDAY=`/bin/date +%w` | |
FDATE=`/bin/date +%Y%m%d` | |
BACKUPPATH="/tmp" | |
WEBDIR="/var/www" | |
SITES=`ls $WEBDIR` |
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
Section: AUTH | |
mailgun_login: | |
driver = plaintext | |
public_name = LOGIN | |
hide client_send = : [email protected] : password | |
Section: ROUTERSTART | |
mailgun: | |
driver = manualroute | |
domains = ! +local_domains |
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
yum -y update | |
yum groupinstall -y 'development tools' | |
yum install -y zlib-devel openssl-devel sqlite-devel bzip2-devel | |
yum install xz-libs | |
wget https://www.python.org/ftp/python/2.7.12/Python-2.7.12.tar.xz | |
xz -d Python-2.7.12.tar.xz | |
tar -xvf Python-2.7.12.tar | |
cd Python-2.7.12 | |
./configure --prefix=/usr/local | |
make; make altinstall |
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
// redirect attachment pages to home | |
function ljxdm_redirect_attachment_pages() { | |
if(is_attachment()) { | |
global $post; | |
if($post && $post->post_parent) { | |
wp_redirect(esc_url(get_permalink($post->post_parent)), 301); | |
exit; | |
} else { | |
wp_redirect(esc_url(home_url('/')), 301); | |
exit; |
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
class ljxdmStripComments | |
{ | |
public function __construct() { | |
add_action('get_header', array($this, 'start'), 100); | |
add_action('wp_footer', array($this, 'end'), 100); | |
} | |
private static function strip($html) { | |
return preg_replace('/<!--(.|\s)*?-->/','',$html); | |
} |
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
# tcp ports and services | |
egrep -w '(80|22|443)/tcp' /etc/services | |
# netstat list of open ports | |
sudo netstat -tulp | grep LISTEN | |
# -t – List all TCP ports on Linux | |
# -u – List all UDP ports on Linux |
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
function ljxdm_upload_mime_types( $mimetypess ) { | |
$mimes['svg'] = 'image/svg+xml'; | |
return $mimes; | |
} | |
add_filter( 'upload_mimes', 'ljxdm_upload_mime_types' ); |
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
/* | |
* Allow HTML in term descriptions. | |
* https://developer.wordpress.org/reference/functions/wp_filter_kses/ | |
* | |
*/ | |
function ljxdm_disable_kses_on_terms() { | |
if ( current_user_can( 'unfiltered_html' ) ) { | |
foreach ( array( 'pre_term_description' ) as $filter ) { | |
remove_filter( $filter, 'wp_filter_kses' ); |
OlderNewer