Kiasyn's Blog


JQuery DataTables binding for MVC

I have created a MVC DataTables binding that is compatible with the DataTables plugin for JQuery.

You can check it out on github here

Filed under: Uncategorized No Comments

Enable-O365integration : Credential cannot be authenticated

Enable-O365integration : Credential cannot be authenticated
At line:1 char:1
+ Enable-O365integration -o365accountupn "xxxxxxxxxxxxxxxxxxxxxxxxxxx" -Pas ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Enable-O365Integration], O365ConfigureException
+ FullyQualifiedErrorId : InvalidInvoke,Microsoft.WindowsServerSolutions.O365Integration.EnableO365IntegrationPSCmdlet

If you ever get this error you need to disable the windows azure active directory sync in the Dashboard before continuing

Filed under: Uncategorized No Comments

IE9 couldn’t be downloaded

If you are getting this error in IE9, there is a simple fix, but no always easy to find ;)

Untick this bad boy:

Filed under: Uncategorized 1 Comment

LinqDataSource join

Hi guys,

If you are ever using a LinqDataSource and want to join a second table, bad news, you can't. BUT if your edmx file sees the join between the tables, you can still reference it.

See following extract from the ASP.NET file:

<asp:LinqDataSource ID="LinqDataSource1" runat="server"
ContextTypeName="MyDatabase.MyDatabaseEntities" EntityTypeName=""
OrderBy="DateCreated desc"
Select="new (ID, Name, Author.Name AS Author)"


Script summary: Failed loading then steps

This Kaseya error can be quite annoying to diagnose if you don't know what to look for.

It is caused by having a step (such as Set Registry Value) with < or > in it, as Kaseya use XML to save their scripts.

You can double tag it, eg <<br>> instead of <br> and it will run as expected.

Filed under: Uncategorized No Comments

Searching Recent Event Logs with C#

Hi guys,

Today I was looking into event log searching. I run a script that does a chkdsk on reboot but then when the machine boots I want to see the log from that report.

To do this, I search the registry for the most recent event within a certain time period (I choose 1 day). We can use Linq to make the filtering quite easy.

EventLog el = new EventLog();
el.Log = log;
el.MachineName = ".";

var result = (from EventLogEntry elog in el.Entries
where (elog.TimeGenerated >= DateTime.Now - new TimeSpan(days, 0, 0, 0))
&& (elog.Source.ToString().Equals(source))
&& (elog.EventID == id)
orderby elog.TimeGenerated descending
select elog).First();
catch (InvalidOperationException)
Console.WriteLine("No results found. ");

Cheers to StackOverflow for the basis of this code.

Filed under: Uncategorized No Comments

RVM, Merb, Rake and RSpec

I was having terrible difficulty getting Merb to work with RSpec. Turns out that Merb now uses Bundler, and if you don't edit your Gemfile to include rspec it bails on you.

  sam@shiny-dev:~/Projects/mojo$ rake db:migrate
    (in /home/sam/Projects/mojo)
    Merb root at: /home/sam/Projects/mojo
    /home/sam/.rvm/gems/ruby-1.9.1-p378@merb/gems/dm-validations-1.0.0/lib/dm-validations.rb:33: warning: already initialized constant OrderedHash
    Loading init file from ./config/init.rb
    Loading ./config/environments/development.rb
    rake aborted!
    no such file to load -- spec/rake/spectask
    /home/sam/Projects/mojo/Rakefile:24:in `require'
    (See full trace by running task with --trace)

This was solved by adding the line:

gem "rspec", :require => "spec"

to the bottom of the Gemfile in the project root.

Filed under: Uncategorized No Comments

Ruby chat-server with Fibers & Eventmachine

Posting this mostly for my reference so I don't lose it again later.

require 'rubygems'
require 'eventmachine'
class Connection < EventMachine::Connection
  attr_accessor :fiber, :name
  def initialize
    @fiber = { poll }
    @name = nil

  def post_init
    (@@connections ||= []) << self
  def poll
    send_data( "What is your name?" )
    @name = Fiber.yield
    send_data( "OK, your name is #{@name}\n")

    loop do
      msg = Fiber.yield
      @@connections.each do |conn|
        conn.send_data( "#{@name} said: #{msg}\n")
  def receive_data( data )
    @fiber.resume data.strip
end do
  EM.start_server "", 2000, Connection

Filed under: Uncategorized No Comments


A while ago I started work on an improved version of SMAUG FUSS

While I since got distracted and stopped work on it, I'm releasing what I did so the community can continue it.

I place no additional license on the work I have added.

Note: It currently does not compile, but if you do get it to compile it you can use lua within mobprogs, roomprogs etc. I think I setup most of the triggers, eg rand triggers, drop, etc.

A lot of the commands I didn't set up, mpgoto etc, but they could be done better now with the lua support anyway.

It is available for download, here

Filed under: Uncategorized No Comments

Converting from VMWare to Virtualbox

Yesterday I used Virtualbox for the first time, to create a Beowulf cluster.

Today, I am migrating my Ubuntu VM from VMWare Player to VirtualBox.

This is dead simple with a linux client:

  1. Copy your VMware image to your Virtualbox VM location
  2. Open up VirtualBox and go File->Virtual Media Manager
  3. Add the .vmdk file as a hard disk in the Virtual Media Manager
  4. Create a new VM, using the hard disk you copied as the disk.

That's it! Could it be simplier? :)

For Windows, things are a bit more difficult. See this link for more details.

Filed under: Uncategorized No Comments