Skip to content

Instantly share code, notes, and snippets.

Kakoma kakoma

Block or report user

Report or block kakoma

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@kakoma
kakoma / mount_ebs.sh
Created Dec 1, 2017 — forked from stingh711/mount_ebs.sh
How to mount another EBS as /var on EC2 (ubuntu)
View mount_ebs.sh
#!/bin/bash
#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
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
<?php
/**
* 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: http://www.gnu.org/licenses/gpl-2.0.txt
* */
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@kakoma
kakoma / reconfigure-virtualbox-dkms
Last active Sep 6, 2018
Reconfigure Ubuntu's virtualbox-DKMS after a kernel upgrade
View reconfigure-virtualbox-dkms
#!/bin/bash
# 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
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
<?php
//Based on https://codex.wordpress.org/Plugin_API/Filter_Reference/login_redirect
/**
* 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" />
</span>
You can’t perform that action at this time.