Skip to content

Instantly share code, notes, and snippets.


Kakoma kakoma

View GitHub Profile
kakoma /
Created Dec 1, 2017 — forked from stingh711/
How to mount another EBS as /var on EC2 (ubuntu)
#attach the EBS to /dev/sdf before running it
#format EBS
mkfs -t ext4 /dev/xvdf
#copy original /var to /dev/xvdf
mkdir /mnt/new
mount /dev/xvdf /mnt/new
cd /var
kakoma / WordPressPlugin-Update posts in bulk
Last active Jun 27, 2017
WordPress Plugin to update WordPress posts in bulk, changing any post field, not just the ones WP admin allows. Customize the code inside the foreach loop as desired. Save this in a file, place it in your plugins directory and activate it. The changes will run on activation. Delete the plugin after the change. Article on this here: http://kakoma…
View WordPressPlugin-Update posts in bulk
* Plugin Name: Post Bulk Update
* Description: On activation, I'll updates certain fields of your posts at once. Can't wait!
* Version: 1.0.0
* Author: Your name here
* License: GPL-2.0+
* License URI:
* */
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
kakoma / reconfigure-virtualbox-dkms
Last active Sep 6, 2018
Reconfigure Ubuntu's virtualbox-DKMS after a kernel upgrade
View reconfigure-virtualbox-dkms
# Description: Everytime the Kernel is upgraded (which is quite often), virtualbox stops working and throws the following error:
# The provider 'virtualbox' that was requested to back the machine
# 'default' is reporting that it isn't usable on this system. The
# reason is shown below:
# VirtualBox is complaining that the installation is incomplete. Please
# run `VBoxManage --version` to see the error message which should contain
# instructions on how to fix this error.
kakoma / Redirect ksd_customer role on login
Created Mar 7, 2017
For those who would like to redirect KSD customers to a special URL on login
View Redirect ksd_customer role on login
//Based on
* Redirect KSD customer after successful login.
* @param string $redirect_to URL to redirect to.
* @param string $request URL the user is coming from.
* @param object $user Logged user's data.
* @return string
View WordPress .htaccess https redirection
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# BEGIN WordPress
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
View gist:0ff4a2d52998854ae00f8494206205cf
add_action( 'ksd_after_ticket_info_metabox','after_ticket_info_metabox' );
function after_ticket_info_metabox( $post ){
ob_start(); ?>
<div style="" class="misc-pub-section misc-pub-public">
<span id="toggle-public">
<b>Make Public?</b>
<input type="hidden" name="_ksd_tkt_info_public" value="no" />
<input name="_ksd_tkt_info_public" type="checkbox" <?php checked ( get_post_meta( $post->ID, '_ksd_tkt_info_public', true ), "yes") ?> value="yes" />
You can’t perform that action at this time.