Touching files in Windows

In Unix you have the touch command which you can use to update a files timestamp. No such thing in Windows. But instead, apparently, one can do this:

REM Updates the timestamp of the file
copy /b filename.ext +,,

REM Creates a new empty file
echo $null >> filename.ext

If you need it more than seldom there are also some more tricks in the StackOverflow sources below.

Windows equivalent of the Linux command ‘touch’?
Equivalent of Linux `touch` to create an empty file with PowerShell?

Helpful Sublime Text 2 packages

Keep forgetting the names of packages I like to install when setting up Sublime Text 2. Or that I should install them to begin with. So here’s a note to self on packages I should install whenever I reinstall this fantastic editor. And a note to you if you use the editor and didn’t know such helpful packages existed.

  • Package Control, the package that adds a package manager to the editor. After that is installed, simply press Ctrl+Shift+p, bring up Install Package by typing “ip”, and hit enter. You can then search for packages and install them super easy.
  • Highlight, for copying syntax highlighted code either as HTML or as RTF. Nice for pasting code into emails, documents, etc.
  • Indent XML, for… indenting XML. Been very helpful for cleaning up messy SOAP requests from logs, etc.
  • LESS, for syntax highlighting of LESS files
  • Markdown Preview, for quick preview of markdown files in the browser
  • Text Pastry, for fun pasting madness. You can for example paste in sequences of numbers.

Hosting Minecraft on Hyper-V in Windows 8.1 Pro

Just got a new computer which I hoped would be powerful enough to run both a Minecraft Server and the Minecraft game. And, turns out it is!

Managing servers and stuff tend to be easier in unix though, so I figured I’d try to run it in a virtual machine. First thought of VirtualBox, but then I stumbled upon the fact that Windows 8.1 Pro comes with a Hyper-V Platform built-in. Decided to check it out, and it works fantastic.

At least after I swapped out the virtual hard drive with the SSD from my old computer. Not sure if I set it up wrong, or if Minecraft just really don’t like being inside a virtual hard drive on a regular HDD…

Anyways, here’s what I’ve done for future reference in case I need to set it up again, or if anyone else would like to check it out. Depending on your comfort with command lines, unix, etc, you might need to use some google-fu. Or leave a comment, and I’ll try to help :)

Here’s what I use and try to cover here:

Continue reading

Notes on Minecraft hosting

Just notes to self that I keep having to find in various documents and random Minecraft forums of varying quality of which there are a lot…

Screen stuff

I have an unused laptop which I installed Ubuntu Server on, and this is what I use to run the Minecraft server so it’s easy to manage and won’t die when I disconnect.

# Run detached in screen using dir name as screen name
screen -dmS ${PWD##*/} java -Xmx3G -XX:MaxPermSize=256M -jar server.jar nogui

# List screens
screen -ls

# Reattach to specific
screen -r name

# Reattatch to whatever (handy if just one running)
screen -raAd

# Detach (important, since Ctrl+c would shut down the server)
Ctrl+a, Ctrl+d

Minecraft server stuff

A bit cheaty, especially the last one, but sometimes you just want to play without worrying about losing what you spent way too many hours working on. I prefer a gravestone mod over the last one though, cause then dying is still an annoyance, but at least you have a chance of getting back that crazy expensive armor and the fifteen stacks of diamonds you just spent forever digging up.

# Prevent creepers and such from destroying stuff
gamerule mobGriefing false

# Don't lose stuff when dying
gamerule keepInventory true

With a hint of Social Ineptitude