Monday, March 25, 2013

Angular.js, a haven for the lazy developer

 
I've been acquainted with this framework in a JavaScript meetup I attended at the Google campus in Tel Aviv. 

The speaker, Shay Resnik was full of praise to this new infra that allows developers to be lazy and write so much less code. 

But as a supper lazy developer, I had to see for my self. So I did. and it does. The combination of RoR and Angular is especially nice because the code shrinks down to the essentials. 

I found a nice example for the workings of RoR and Angular, called angular_rails_demo on git and although it took a bit of working to actually get the app running on mac (nokogiri and rmagick are bitches) it is fantastically simple and easy to follow. 

After abandoning Adobe Flex in all my projects, I can finality say that there is something I like  in HTML and JavaScript.


Sunday, March 3, 2013

Minecraft server installation on Ubuntu

Installation instructions:

First step, prepare the system requirements:
  • sudo apt-get update [This updates all the packages on the server]
  • java -version [checks if you have Java installed on the machine]
  • sudo apt-get install default-jdk [installs the necessary Java executables]

Second step, open the server port for inbound communication:
  • sudo iptables -A INPUT -p tcp --dport 25565 -j ACCEPT

Third step, install the Mindcraft server

Fourth step, running the server:
there are two options to run
directly running the server:
  • java -Xmx1024M -Xms1024M -jar minecraft_server.jar nogui
or run it through a delegation software (this enables the console to be closed without shutting down the server)
for this option, first install "Screen":
  • sudo apt-get install screen
running the server through Screen:
  • screen -S "Minecraft server"
detach consule from server stdout:
  • ctl-a d
or, reattach the console to the Screen stdout:
  • screen -R

Server's world (level) and player manipulation

the minecraft server has several configuration files that define the game environment characteristics.
these files are saved in a proprietary format and zipped, so there is no use trying to open them in a text editor. the NBT spec is available at: http://wiki.vg/NBT

its possible to run a specialized editor for NBT formatted files available at: https://github.com/jaquadro/NBTExplorer

There are some libraries available for reading and writing to this format in an array of programming languages.

A ruby lib to read/write NBT format files: https://github.com/mental/nbtfile.git
(an extended list is available on the http://wiki.vg/NBT page)