Skip to content

Instantly share code, notes, and snippets.

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

Boniface Kabaso boniface

🏠
Working from home
  • Zambia
  • Lusaka, Zambia
View GitHub Profile
@boniface
boniface / gist:8ddfc271676bb81a184f
Created October 18, 2014 17:00
Wordpress Migration
UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldsite.com', 'http://www.newsite.com') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'http://www.oldsite.com','http://www.newsite.com');
UPDATE wp_posts SET post_content = replace(post_content, 'http://www.oldsite.com', 'http://www.newsite.com');
UPDATE wp_postmeta SET meta_value = replace(meta_value, 'http://www.oldsite.com', 'http://www.newsite.com');
package main
import (
"github.com/gocql/gocql"
"github.com/SlyMarbo/rss"
"log"
"crypto/md5"
"encoding/hex"
"time"
"fmt"
@boniface
boniface / gist:9066037
Created February 18, 2014 07:19
super calc
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.kabaso.calculator.service.Impl;
import com.kabaso.calculator.service.CalculatorService;
# Tweaked from http://tomislavsantek.iz.hr/2011/03/moving-mysql-databases-to-ramdisk-in-ubuntu-linux
# Log in as root
# Mount ramdisk folder in RAM
mkdir /tmp/ramdisk
mount -t tmpfs -o size=128M tmpfs /tmp/ramdisk/
# Move MySQL data
mv /var/lib/mysql /tmp/ramdisk/mysql
ln -s /tmp/ramdisk/mysql/ /var/lib/mysql