Why is Minecraft fun?


When minecraft first came out, I thought I wouldn’t enjoy playing the game because I generally didn’t enjoy open ended games. I had tried playing World of Warcraft before, but the sheer number of options open to a new player put me off. When I was playing a video game, I wanted there to be a plot, with a goal or a story or something!

My attidude has shifted. Now I really enjoy the lack of structure in minecraft. The fact that it’s almost entirely open ended is pretty fun because I get to decide how to play whenever I play. Do I want to build something? Do I want to mine? Do I want to construct a cpu inside of my game so I can program in my program?
But how do you make a game where you can do anything fun? With self imposted limit. I choose to play in survival mode rather than in creative mode. Why would I choose to make something harder? It’s because certain kinds of fun come from doing something hard. I think an integral part of play is the challenge.
Minecraft illuminates how in all games, we impose limits on our selves. There’s a greater sense of accomplishment that comes from creating something where you had to forage all the materials your self. It's harder but it's more fun.
My problem initially with minecraft was that making up your own story is hard but because it's hard it's more fun. It forces me to be more active and creative. And I like that

Adventures in meditation

http://images.fotocommunity.de/bilder/bach-fluss-see/see-teich-tuempel/meditation-c20eccba-2002-4e13-a226-5f2d811abe9c.jpg
The first time I meditated I was in high school and it was the night before a big exam. I don’t remember well how I found out about it (probably stumbleupon) but it became an important part of the exam preperation ritual for me. I’d lie in bed before going to sleep and count to 100. I stopped doing it on my own for a long time, although I did some small meditation sessions during the martial arts classes I took in high school and university.

Finally after getting fed up with my poor concentration at work, I decided that meditation would help me with focus. I also wanted to fix my posture and the good posture you need while meditating seemed like a good way to improve how I sat. This was last summer, but it turned out that sitting was really hard physically. That’s mostly because I was sitting wrong. I gave up for a few months until January of last year rolled around when I decided to make meditating regularly one of my goals. At first I just tried to do it on a best effort basis, with the goal of 3 or 4 times a week. That ended poorly. It was much to easy to find an excuse to not meditate today because I was too tired or too busy.

Finally I decided to give beeminder a try. If you’ve never heard of beeminder you should go read this page post about it but basically it’s a goal tracking with teeth. You can track my progress here (for those of you who are that bored). Having actual money on the line helped a lot. I started meditating considerably more often, but it wasn’t for very long periods, and I struggled a lot with the actual focus bit. My technique at this point was the same one I started out with initially. Counting 100 breaths while sitting cross-legged somewhere dark and quiet.

After getting frustrated and de-railling from my beeminder a few times, I went into RESEARCH MODE and scoured the internet. Someone from the Less Wrong IRC finally suggested the Aro Meditation course. It’s basically a weekly email that walks you through meditation as if you were a complete beginner. I highly recommend it as a resource if you are just starting out. One of the most useful pieces of information that it introduced was how to site like a human. Right now I am on week 13 of the Aro course and I can comfortably meditate for 30 minutes and I aim for 6 times a week. It’s been a pretty successful course I think, but I am starting to run into a wall.

Currently when I meditate I find it super difficult to quiet my mind and I often end up following trains of thought for quite some time before I realize I’ve let my mind wander. I suspect that this is because I tried to start using the more advanced meditations techniques suggested in the Aro course before I had masted the easy ones. I’m also going to try an experiment and use the meditation technique described here

Has meditation increased my concentration? I’m not entirely sure. I think it’s helped since I am finding it easier to focus for long-ish periods of time at work, but there are so many other factors that have changed since my initial decision that I can’t in good faith assign a high probability to meditation being the cause of this.

Will I keep meditating? Yes, I think I will. My goals have shifted a bit towards trying to become more mindful. The most valuable part of regular meditation has been to spend some serious time examing my own mind and my own thoughts. It’s kind of amazing how easy it is to avoid noticing how your brain actually works.

Links

How to host your own email on a $15 a month vps (Part 1)

Intro

Every now and then my paranoia will take over and I’ll have an urge to break free of all 3rd parties that I depend on for my life on the internet. The last time it struck I decided to set up my own mail server. I’m going to walk you through what I did in order to get it working

Important Acronym List (IAL)

Mail Transfer Agent: MTA This is the piece of software that handles incoming AND outgoing email. It receives email and then decides whether or not the message is for one of the users it knows about. It also decides who gets to send email and handles the delivery. In this tutorial we’re going to be using Postfix. The primary protocol that it speaks is SMTP

Internet Message Access Protocol: IMAP By default, postfix will deliver email messages to a folder on the computer it’s running on and the only way to access the messages is when you are logged into that box. Since this is kind of impractical, there are a ton of protocols that have been created to make accessing email messages on a remote server easy. We’re going to use dovecot and IMAP (the protocol) to access our messages on the server. You can also get dovecot to work with POP3, but this guide doesn’t cover getting it set up since it’s an older and less useful protocol.

What you need

  • A domain
  • I use namecheap, but I hear good things about hover.com
  • A server
  • Preferably running debian or ubuntu. It will be helpful for preventing your mail from being marked as spam if you can set the PTR / reverse DNS for this server’s IP address. Sadly, this means that you probably can’t run this on a server you have in your house. If you need a server, I recommend BuyVM since they have a $15 a year VPS that is perfectly adequate for this purpose.
  • An SSL certificate
  • You can get one for free from StartSSL

Directions

We’re mostly going to follow along with this guide from linode except for the bits about MySQL [1]. I don’t understand why they would use MySQL here since it’s huge overkill unless you are dealing with a very large number of users. Instead of MySQL we’re going to use sqlite since it doesn’t require any processes to be running and eating up the limited RAM available on the VPS.

You should follow the linode guide, except when they start talking about MySQL in which case you should come back here and see how to do it with SQLite. I’ve tried to match up the section/numbering so that it’s easy to figure out what to do differently.

Installing Packages

Step 3

Install these packages instead: sudo apt-get install postfix postfix-mysql dovecot-core dovecot-imapd dovecot-lmtpd dovecot-sqlite sqlite

Step 4 and 5

Ignore

SQLite instead of MySQL

Creating the database

Download this empty mailbox.sqlite and put it in /etc/mailbox.sqlite or if you don’t trust me you can create you’re own with this schema:

This will create our tables

Adding data

You can add data to sqlite database with the same syntax as MySQL, but interact with the database using the sqlite or sqlite3 command instead of mysql

Postfix

Step 8

Use the following instead of the one in the guide

We’ll be using these file names later as well

Step 11

Use this instead: nano /etc/postfix/sqlite-virtual-mailbox-domains.cf

Step 12

Step 15

You can test the set up by referencing your sqlite file instead of the mysql one. eg: postmap -q example.com sqlite:/etc/postfix/sqlite-virtual-mailbox-domains.cf

Step 16

Use this instead: nano /etc/postfix/sqlite-virtual-mailbox-maps.cf

Step 17

Step 20

Test with: postmap -q email1@example.com sqlite:/etc/postfix/sqlite-virtual-mailbox-maps.cf

Step 21

Use this instead: nano /etc/postfix/sqlite-virtual-alias-maps.cf

Step 22

Step 25

Test with: postmap -q alias@example.com sqlite:/etc/postfix/sqlite-virtual-alias-maps.cf (You get the idea at this point I hope)

Step 28

I skipped this bit entirely without any ill effects

Dovecot

Step 25 to Step 28

Please use the following as the contents of dovecot-sql.conf.ext

Conclusions

If all went well then you should be able to connect successfully to your new email server with your email client to both receive and send email! It’s amazing, I know.

In the next installment I’ll walk through the process of signing your email with DKIM so that it won’t get marked as spam by pretty much every email provider in existence

Sources

https://library.linode.com/email/postfix/postfix2.9.6-dovecot2.0.19-mysql

http://sealedabstract.com/code/nsa-proof-your-e-mail-in-2-hours/

http://blog.codinghorror.com/so-youd-like-to-send-some-email-through-code/

Notes

[1] I would have liked to reproduce most of the guide here since it IS published under a creative commons license, but it specifies no derivatives so I can’t actually modify it at all...

Recover password on a headless raspberry pi

I hate to admit it, but this is the second, or possibly third time that I’ve forgotten the password for my raspberry pi… I know that there are ways to reset my password, but most of them assume that the pi in question is attached to a monitor, and my pi is several feet from the nearest monitor. So, without further ado here is how to reset the password on your raspberry pi.

https://upload.wikimedia.org/wikipedia/commons/9/9c/Raspberry_Pi_Beta_Board.jpg

Requirements

  • SD Card reader
  • Computer capable of mounting an EXT4 partition

Instructions

Step 1

Unplug your pi and remove the SD card

Step 2

Insert the SD card into a working computer that you have root access on

Step 3

As root edit the following file on your SD card:

eg:

It’s very important that you DON’T EDIT THIS FILE ON YOUR OWN COMPUTER. Things could get messy if you do that

Step 4

Locate the line that starts with pi and replace the text between the first and second : with the output of the following command:

If you’re lazy you can use the following password hash:

$1$salty$SzJsU4qDcXp536Acnlp6I.

This will make the password for the pi user password

Step 5

Eject the SD card and put it back in your pi and let it boot up.

Step 6

ssh into your pi and change the password to something else immediately. You can do this by running:

and giving it the password you generated in step 4

Step 7

REMEMBER THE NEW PASSWORD YOU JUST CREATED

WTF did you make me do?

Well first of all, how do you think your computer knows your password? It would be silly to have it stored somewhere as it is, since that would make it pretty easy for someone to steal if they ever had access to your machine. Instead the computer stores it as a hash. That is, it takes the password and mangles it in a specific and repeatable way to produce password hash. The key part of the mangling process is that it’s one way. There’s no figuring out what the input is if your just have the output. When you give your computer the password at login it hashes it to see if it matches the one it has stored. On linux, these password hashes are stored in /etc/shadow. What we’ve done is change the stored password hash to something we new.

Filter Order in Rails

Today I learned a lot about the way that Rails handles filters, that the methods: before_filter, around_filter and after_filter

I ran into a bug while working on the work to upgrade from rails 3.2 to 4.0 that I thought might be caused by a change in the way that filters are applied. Let’s see if you can guess what the following code would output.

Sample Controller

I initially thought that filters were sorted into different queues, then processed in the order:

  1. Around
  2. Before
  3. After

Asking around, some people thought that the ordering was:

  1. Before
  2. Around
  3. After

(although that may have been because of the way I framed the question)

It turns out both are wrong.

The output of that controller would be this:

Filters are processed in the order they are defined.

You can see that this is the intended behaviour in this test for rails: filters_test.rb

That makes a lot of sense after some thought. You’d want to be able to have some before_filters run before around_filters, but before_filters to run inside of around_filters.

tl;dr Filters are processed in the order they are defined

subscribe via RSS