Skip to content

Instantly share code, notes, and snippets.

View jasperf's full-sized avatar
🏠
Working from home

Jasper Frumau jasperf

🏠
Working from home
View GitHub Profile
@jasperf
jasperf / .htpasswd-command
Created March 12, 2015 10:50
Generate .htpasswd file with user and encrypted password #htaccess #apache
htpasswd -c /path/to/file/.htpasswd login
@jasperf
jasperf / wp-sec-keys-example
Created March 12, 2015 10:51
WordPress Security Keys Example #wordpress #security
define('AUTH_KEY', 'Q tljMM| ,$eO*d:_[SF*PrPj5*1Ag>Q@I#+E2[XEu^J`9UF=`.+&+p}UhWg@!8i');
define('SECURE_AUTH_KEY', '2cdsUA;Hsk1/)$~er:RWw`._/2*n.7?.B|&Xfyy&II9Q@pepoQEPE=$JGX6?dMti');
define('LOGGED_IN_KEY', 'xWXFH|6),po+g!}7B!gPfR?!:o>jzL>Nk~4.j3^D]|7E|@Q.3sjhr)~aYFTN-q#M');
define('NONCE_KEY', 'aKXg-pFu3?#Px _h`ncL:%`Fm>,|s-YoC=aZ^$*c2P|Fx3suG{z:0E::S}>bg4uO');
define('AUTH_SALT', 'bo]*a>tZS`{][8@/8WLiQbxG.yzg{2Gfz7l&H*SZ|Y4,lR xBiIZ0gv#]w,(;&[M');
define('SECURE_AUTH_SALT', 'D$jDtWcueQ<|d rIM!f#~uK/<J_;C>i.58I_Nr}Q2N1vB|I|K-il3pB>oB5J>Ck}');
define('LOGGED_IN_SALT', '^`xE4T{:aHhj0:?x,MJ31$q,g3fU2km#i:QIL}Cpa~=/U0%HT&hppuHW3^ ^..vM');
define('NONCE_SALT', 'MTNE_OzQ7wWJ4LwD,q S#oRj@euUS^$+)G6F:I-v9|JRl4dDQoeZ.f;?BG8I[zT@');
@jasperf
jasperf / wp-block-file-editing
Created March 12, 2015 10:53
WordPress Block File Editing from the Dashboard #wordpress #security
Define('DISALLOW_FILE_EDIT', true);
@jasperf
jasperf / portfolio-plugin.php
Last active August 29, 2015 14:17
Portfolio Plugin based on WordPress Custom Post Type, custom Taxonomy and post_type_link filer #wordpress
<?php
/**
* Plugin Name: Imagewize Portfolio Plugin
* Plugin URI: https://imagewize.com
* Description: A simple portfolio plugin
* Version: 1.0.0
* Author: Jasper Frumau
* Author URI: https://imagewize.com
* Text Domain: Optional. Plugin's text domain for localization. Example: mytextdomain
* Domain Path: Optional. Plugin's relative directory path to .mo files. Example: /locale/
@jasperf
jasperf / antagonist-bb-errors.md
Last active August 29, 2015 14:17
Antagonist BackupBuddy HTTP Loopback Errors and issues related to wp cron

##HTTP Loopback Errors Antagonist ###https://www.antagonist.nl/ HTTP Loopback Connections are not enabled on this server or are not functioning properly. You may encounter stalled, significantly delayed backups, or other difficulties. See details in the box below. This may be caused by a conflicting plugin such as a caching plugin. Click for instructions on how to resolve this issue. Details:

Loopback test error: Operation timed out after 4000 milliseconds with 0 bytes received. URL: http://site.com/wp-admin/admin-ajax.php. If you need to contact your web host, tell them that when PHP tries to connect back to the site at the URL http://site.com/wp-admin/admin-ajax.php via curl (or other fallback connection method built into WordPress) that it gets the error Operation timed out after 4000 milliseconds with 0 bytes received. This means that WordPress' built-in simulated cron system cannot function properly, breaking some WordPress features & subsequently some plugins. There may be a problem with the s

@jasperf
jasperf / ubuntuserver-vbox-ssh.md
Created March 27, 2015 11:10
How to make ssh-ing into VirtualBox Server Possible

//http://stackoverflow.com/questions/5906441/how-to-ssh-to-a-virtualbox-guest-externally-through-a-host ##SSH Login VirtualBox Server The best way to login to a guest Linux VirtualBox VM is port forwarding. By default, you should have one interface already which is using NAT. Then go to the Network settings and click the Port Forwarding button. Add a new Rule:

Host port 3022, guest port 22, name ssh, other left blank. or from command line

VBox command to mofidy access

VBoxManage modifyvm myserver --natpf1 "ssh,tcp,,3022,,22" where 'myserver' is the name of the created VM. Check the added rules:

@jasperf
jasperf / wp-debug-hide-php-notices
Created May 1, 2015 10:57
Hide PHP Notices in WP DEBUG #wordpress
<?php
//Turns off notices
//https://wycks.wordpress.com/2013/12/05/how-to-remove-error-notices-using-wordpresss-wp_debug/
error_reporting(E_ALL ^ E_NOTICE);
?>
@jasperf
jasperf / gzip-test.md
Created May 12, 2015 19:45
This tool checks your server to see if it is sending out compressed data. It checks for compression via mod_gzip, mod_deflate, or any server-side language that does content compression. Enter the address of a specific page or file to check. #gzip #seo
@jasperf
jasperf / force-ssl-on-wordpress
Created May 18, 2015 10:58
.htaccess snippet with WordPress ReWrite Rules + Rule to always use SSL or HTTPS #htacess #ssl
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]