Minecraft Mod Idea #284

It would be nice to have items sorted in chests, I have set it up with pipes before but as I am playing in Hexxit at the moment, I want a more ‘magical’ way for this to happen. What I am thinking is that you have a master chest and slave chests. The master chest is linked to the slave chests and the slave chests have the id/name of the items it automagically gets when they are put in the master chest.

To power this redstone needs to be placed in the master chest, the system will always keep at least 64 pieces of redstone in there and for every 64 items one redstone is used to ‘power’ the system.

Here is the walk through of the system.

  1. Craft a special chest which requires a normal chest, ender pearl and 64 redstone.
  2. This is then placed down.
  3. Looking at the chest type /magicchestsorter set master {name}
  4. On the backend this chest is marked as {userid}_{name} to uniquely call it out.
  5. Next you craft another special chest with a normal chest and a ender pearl.
  6. This is then placed down.
  7. Looking at the chest type /magicchestsorter set slave {name}
  8. On the backend this chest is marked as a slave to the master chest.
  9. Looking a the chest type /magicchestsorter set types {id},{id},{id} where id is the Minecraft id.
  10. On the backend this chest is marked as a destination for these types.
  11. Go to master throw in a stack of redstone and some items.
  12. When the events fire it takes the items out of the chests and routes them to the correct destination and consumes redstone.

Going to implement this in forge as it has custom block types, not intending to make a custom skin for the chest at this point in time.

MYN/1MTD and setting the Start Date in Outlook automagically.

If you are using Outlook and want to force the start date to be set with a due date in the future by default you can use a macros which automatically runs for any new task item.

In the VBA editor (Alt+F11) open up ThisOutlookSession

In the code window add the following:

Option Explicit
Public WithEvents Items As Outlook.Items

Private Sub Application_Startup()
  Initialize_handler
End Sub

Public Sub Initialize_handler()
  Dim objNS As Outlook.NameSpace
  Set objNS = GetNamespace("MAPI")
  Set Items = objNS.GetDefaultFolder(olFolderTasks).Items
End Sub

Private Sub Items_ItemAdd(ByVal Item As Object)
  On Error GoTo errHandler

  Dim objNS As Outlook.NameSpace
  Set objNS = GetNamespace("MAPI")

  If TypeOf Item Is Outlook.TaskItem Then
    Dim Task As Outlook.TaskItem
    Set Task = Item
    '1/1/4501 is None in the Outlook world.
    If Task.StartDate = #1/1/4501# Then
      Task.StartDate = Now()
      Task.DueDate = Now() + 3000 ' A due date a long way into the future.
      Task.Save
    End If
  End If
  Exit Sub

errHandler:
  MsgBox "Error " & Err.Number & ": " & Err.Description & " in ", vbOKOnly, "Error"
End Sub

From Web Archive: Mirroring SVN repository to GitHub

The site seems to be down. This was handy for something I was playing with.

References:

http://web.archive.org/web/20100331135806/http://www.fnokd.com/2008/08/20/mirroring-svn-repository-to-github/

 

So, I’m gearing up to work on some Java+Ruby (via JRuby) stuff.  The Java world still seems fairly entrenched in the cult of Subversion, while the Rubyists have gone with Git lately.

I’m still wrapping my mind around Git, but with GitHub, it’s fairly easy and straight-forward.  I paid my $7 for the micro account, to give me room to screw around.

There’s quite a few posts about mirroring SVN to a Git repository, but I feel the need to add my own, of course.

My goal is mirror the trunk of the JRuby project from Codehaus SVN to my account on GitHub.  By doing this, I can track the trunk development, and also work on my own patches.

I started by creating an empty repository on my GitHub account, called ‘jruby’.

http://github.com/bobmcwhirter/jruby/tree/master

Now, over on my always-on, Contegix-powered server, I create a brand new local git repository, also called jruby.

mkdir jruby

cd jruby

git init

Next I use ‘git svn init’ to setup the SVN repository as a remote code source to track.  Using the -T switch points git to the trunk, and ignores branches and tags, which is fine for my purposes.

git svn init -T http://svn.codehaus.org/jruby/trunk/jruby/

That does not pull any code, but it lets my local working tree know that I’m going to be pulling from an SVN repository at some point.  This setup only occurs in your local repository, and does not seem to ever get pushed to GitHub once we get to that point.

So, now we do the initial pull.  Once again, this is on my always-on, Contegix-powered server, not my local laptop.  I’m doing this on a server because towards the end, we’ll be setting up a cronjob to accomplish it all.

git svn fetch

It’ll think for a while, it’ll slurp down the SVN revision history, it’ll stop and ponder occasionally, and eventually, it’ll be done.  Woo-hoo!  Our local working tree is now up-to-date with the subversion HEAD as of that moment.

To reduce disk-space used by your local repository, go ahead and run the garbage collector

git gc

On my system, that reduced the space from over 600mb to under 70mb.

Now, that’s great, but it’s still just on my local repository.  Time to push it to GitHub.  We’re not going to follow their directions exactly, since this will ultimately be a cronjob and needs to use ssh.  And I’m slightly paranoid about my ssh keys.

So, the first thing I do is create another keypair, for used only by my mirroring process, and only for pushing changes to github.  It has no passphrase.  This allows me to keep my top-secret keys off my shared, always-on server.  If these keys are compromised, all an attacker can use them for is to push changes to GitHub.  Which, being revision-control, is more annoying than dangerous.  (Hooray for “git reset”).

ssh-keygen -t dsa -f .ssh/id_dsa_github_mirroring

Next, I edit my .ssh/config to add a “fake host” so that ssh connections invoked by git will use this new key.

As with all previous bits, this is still on my always-on server, not my local laptop.

Host githubmirror User git Hostname github.com IdentityFile /home/bob/.ssh/id_dsa_github_mirroring

This will cause any invocation of “ssh githubmirror” into “ssh git@github.com -i .ssh/id_dsa_github_mirroring”.

I then installed id_dsa_github_mirroring.pub into my GitHub account.

Now, GitHub’s instructions say to run this command to add the GitHub repository as a remote named “origin”

git remote add origin git@github.com:bobmcwhirter/jruby.git

Instead, we teak it to use the “fake host” we added to .ssh/config

git remote add origin git@githubmirror:bobmcwhirter/jruby.git

We’re almost done, I promise.

Next, we need to do the first push from my server up to GitHub.  We first push to the ‘master’ branch, since the repo really wants to have a master branch.

git push origin master

Now, GitHub doesn’t allow you to fork a repository you own, and since this mirror is owned by me, where can I do my own hacks and patches?  The ‘master’ branch of course.  But I still want an unmolested, straight-from-subversion mirror.  So, I create a ‘vendor’ branch in my workspace.  It’s initialized to match ‘master’ exactly.

git checkout -b vendor

Now, I push that to GitHub, too.

git push origin vendor

Awesome.  I now have two branches, identical at the moment, called “vendor” and “master”.

Now, as far as I can tell, all the Subversion setup that we did only lives in the local repository on my always-on server.  Anyone who clones from the GitHub repository will not have that stuff.  They can of course do a ‘git svn init’ themselves, to add it to their local repository.  But it doesn’t flow through GitHub.

But that’s fine, since I’ve been doing this on my always-on server anyhow.  My workspace is sitting in the ‘vendor’ branch that’s tracking the vendor branch from github.

I can pull the latest changes from Subversion by typing

git svn rebase

The ‘rebase’ command is neat, in that any changes that exist in the git repository are floated to be applied to whatever the latest HEAD is.  But since I’m only concerned with a one-way SVN-to-Git mirror, there will never be any changes to float, and this will just tack on subsequent SVN commits as Git commits onto the ‘vendor’ branch.  It’ll leave the ‘master’ branch un-touched.

After rebasing, you gotta push the ‘vendor’ branch up to GitHub.

git push origin vendor

Now, type that every 15 minutes, and your ‘vendor’ branch will stay mostly up-to-date.

Or use cron.

I’ve cronned a script that fires every 15 minutes

#!/bin/sh

cd /home/bob/github-svn-mirrors/$1 git svn rebase git push origin vendor

It’s run with the repository name as the first (and only) argument

*/15 * * * * /home/bob/github-svn-mirrors/bin/mirror jruby

Now, over on my laptop, finally, I can clone the repository, work on topic branches, push to master and have my own controlled environment and fork, while knowing the ‘vendor’ branch reflects the pure SVN state which I can also pull into my hackings as-desired.

When I submit a patch, if it ultimately floats back to me through the vendor branch, git is supposedly smart enough to realize that the same changes have arrived in my ‘master’ (assuming it’s applied verbatim) and keep things nice and tidy.  Else, I can force a merge, trampling my half-assed patch with the official JRuby code.

1MTD: The One Minute To-Do List

Yep, I was intrigued. Having used the GTD approach for a while and modifying it for my own use I saw this and thought I would have a look through it. I also noticed it was using Toodledo, a site that I had used to manage task previously as it is a faster on the go version than lugging outlook around.

So, what is 1MTD?

Firstly you can download the eBook free, or buy it if you like paper :) I will be going through the book and providing a summary below as a way to internalize the content.

eBook Link: http://www.michaellinenberger.com/free1MTD.htm

Buy the Book: The One Minute To-Do List: Quickly Get Your Chaos Completely Under Control

Overview

The approach is simple, you have three lists. These are based around priority.

Lists:

  • Critical Now – You are not going home until this is done. It absolutely has to be done today. Think things like create presentation for meeting today, it cannot wait. Perform surgery to remove tumor, it cannot wait. I think you get the idea.
  • Opportunity Now – This needs to be one sometimes in the next 10 days, no less and no more.
  • Over-The-Horizon – Somewhere beyond the 10 day period.
  • Thinking about GTD 1. is more like the next action with a due date of today. 2. is the steps that follow the next action for today if not due today or next actions you can do later on. 3. is the someday maybe list or tasks so far our that they are not important right now.

    The key point Michael gets across is around the prioritization of items, you can make anything important if you want. I know I have marked things as important and gone home not worrying about having done them that day. It is a easy thing to do. Interestingly it uses Urgency to drive the list, something that may upset a 7 habiter. The how Important and Urgent matrix is a important part and I do not think he is saying that it is irrelevant. I believe he is expecting you to know what is important already and when you look at the way tasks are aged out over time the system helps you keep the less important items out of the way while still allowing you to track them if you want.

    The idea is that the Critical Now list is killed in the morning’s activities. Then you move onto Opportunity Now. This sits well with the Urgent work that is Important.

    The 10 day limit for items in the Opportunity Now lists is supposed to get the things off our head so we relax, there is no reference to a study about it other than his experience. I guess looking at a 10 day horizon I have no idea if it will fit and would say maybe and this is where it drops into the Over The Horizon list. A GTD concept of mind like water to get it all nice and calm up there. Its also nice to think you are working on items ‘due’ in the next 10 days after dealing with the important items today. Nothing like getting ahead of the curve. Also if a item is in the 10 day bucket for a while, say, 12 days, you should move it to over the horizon because the priority or relevance of it has dropped.

    The review cycle is also based on these three buckets. The Critical Now list is a hourly review, the Opportunity Now is daily and over the horizon once a week. This pushed the weekly review out over the week for the more pressing and critical items something I was doing anyway.

    It is interesting the view on the due date, it is only for critical items and in the subject. Something I have tried before and found helpful. The rest of the filtering is the priorities and the start date which is when it entered the list. As items age they get less important to you and are not blocking your job or life. It is a nice way to age out items. I was doing this manually and this is a simpler way.

    He focus’s on the Next action aspect like GTD and tries to push the point that you should not put things you cannot do on the list. Obvious but not always easy to put into practice.

    The first part of the book as per may of the productivity guides is the get the old piece of paper out and a pencil. As per normal I ignore this and head on down to the next section on the technical aspects of the implementation. It covers two main systems, Outlook and Toodledo. It is funny the way he goes on about how hard it is to configure Outlook to do the system. Either I am an advanced Outlook user or most people do not know how to use Outlook well. Either way it is not that complicated to setup outlook using the priority flags on the tasks.

    The Toodledo setup is easy if you skip to the bit where he takes you through automating it via a like in Toodledo itself. I guess if you want to experience the journey you should follow along but I’m like the kids in the back seat and just want to be there.

    Rules of the System

  • Critical Now should have five or fewer items.
  • Critical Now are for items that have to be done today, your not going home until they are done.
  • Critical Now should be reviewed hourly.
  • Opportunity Now should have 20 or fewer items.
  • Opportunity Now are for tasks you would consider today, tomorrow or within the next ten days.
  • Opportunity Now should be reviewed once a day.
  • Use the start date/enter date to move it to Over-The-Horizon if this list gets to big
  • Over-The-Horizon should be reviewed once a week.
  • Over-The-Horizon items should be scanned on Monday to stop them causing issues if missed.
  • The title of the task has a due date if appropriate, or use calendar.
  • Next Actions

    I’m going to play with Toodledo and see how it goes for a week. I may even update my blog ;)

    Windows 8 Consumer Preview with Eee PC T101MT

    I have a Eee PC T101MT and wanted to run Windows 8 on it. The same steps can be run on the Consumer Preview

    Time to tweak the graphics! As the resolutions is only 600 not 768 in vertical you need to do the following.

    1. Type in regedit, you will then be shown a icon of regedit click/press on it or press Win + R to get the run prompt.
    2. Press Ctrl+F and search for Display1_DownScalingSupported in the registry. This will take a while.
    3. Once it has been found set its value to 1 to enable scaling.
    4. Hit F3 a few times to make sure you got all instances.
    5. Exit regedit and reboot the laptop. You can use Win + C n settings if using the keyboard.
    6. Once restarted click on the desktop tile and right click on the desktop to chenge the resolution.
    7. You now should be able to select 1024 x 768 (Note: This scales the screen and does not add pixels so some text and images may look weird.

    All Done! Enjoy Windows 8 on your netbook.

     

    As a note Win + Z, X or C are your friends in Windows 8. I am using it with keyboard and mouse and have not really noticed any drop in productivity. In face having the combination of touch and keyboard with Windows 8 makes things faster!

    Running Windows 8 on the Eee PC T101MT

    I have a Eee PC T101MT and wanted to run Windows 8 on it. This entry takes you through the steps.

    1. Download the Windows 8 Preview @ http://msdn.microsoft.com/en-us/windows/apps/br229516 I downloaded the 32-bit version as it was smaller and I only have 2Gb on the machine. :)
    2. Go to the Microsoft Store and download the Windows 7 USB/DVD download tool
      @ http://www.microsoftstore.com/store/msstore/html/pbPage.Help_Win7_usbdvd_dwnTool this will allow you to put the ISO on a bootable USB key. Did I mention you need a 8Gb USB key? If not you do. Go shopping if you do not have one, they are handy and this entry will be here when you get back.
    3. Once the ISO is downloaded and the Windows 7 USB/DVD download tool is installed open up the tool and select the Windows 8 ISO as the source and USB Device as the destination, select the USB key you put in the computer and then click begin copying.
    4. Once completed get out the T101MT and plug it into the power and put the USB key in one of the ports. When it starts up hit F2 to go into the BIOS and make sure you have USB as a boot option. You should be promted to select the boot device, select USB and watch the pretty install.
    5. One that is complete, name you computer, connect to wireless (assuming you have wireless), use express (yep, im lazy), log in with your live ID (Syncing Goodness) and wait until it finishes configuring.
    6. You now have Windows 8 goodness.
    7. Time to tweak the graphics! As  the res os only 600 not 768 in vertical you need to do the following.
    8. Type in regiedit, trust me :) you will then be shown a icon of regedit click/press on it.
    9. Press Ctrl+F and search for Display1_DownScalingSupported in the registry. This will take a while.
    10. Once it has been found set its value to 1 to enable scaling.
    11. Hit F3 a few times to make sure you got all instances.
    12. Exit regedit and reboot the laptop.
    13. Once restarted click on the desktop tile and right click on the desktop to chenge the resolution.
    14. You now should be able to select 1024 x 768 (Note: This scales the screen and does not add pixels so some text and images may look weird.

    All Done! Enjoy Windows 8 on your netbook.