Terraform in game development – Don’t Starve Together

dont_starve_together_blogpost

A while ago you could read about Vagrant for Don’t Starve Together (aka DST), this time let’s discuss about similar tool named Terraform.

As in vagrant blogpost I am playing Terraform with DST, because it’s quite good aspect and problem were you can check out tools like Terraform.

You may wondering what do you have with those all games ? Games for me were *THIS* thing that I started programming, it all has begun from Helbreath, were as a 13 years old I wanted to create my own server so I had to compile C++ source code, it was challenging for somebody with zero knowledge of C++, so that’s why I still love doing private server and giving back to gamers community.

Terraform is a tool that allows you to describe your infrastructure as a code, it means that you can write json-like description and it tells to terraform what it has to do to spin up required parts of infrastructure to achieve fully working environment. This tool is ideal for any kind of cloud provider it supports, Amazon, AWS, DigitalOcean

I have created terraform configuration for DST. Main place where my infrastructure described is vm-dontstarve.tf

This block describes that we going to use AWS provider, with access_key, secret_key and specific region.  ${var.aws_access_key}  and ${var.aws_secret_key} this is how you define variables.

In this part, we can see block that has information about AWS instance,  what AMI to use (image of OS), what type of instance, ssh key name, your custom security group and additionally how to connect with our VM during provisioning step.

Here we describe provisioning step, we can copy file, execute remote command, or execute command locally.

Next one aws_security_group block, which describe your topology of ports and connections between your machines. DST requires port 10999 UDP protocol as incoming traffic so we have to add ingrees rule, in “egress” we specify that we allow to any outside traffic on any port and protocol.

Last security rule (ingress) open SSH connection over 22 port, require to connect with our machine and to do provisioning.

For a long time I was wondering if tools like Vagrant, Terraform could be helpful in game development especially to maintain server infrastructure, and in my opinion they are! Soon I will blog more about hashicorp products and their usage in game development.

Don’t Starve Together and Vagrant

219740_screenshots_2013-03-13_00004

I had few approaches into Vagrant but every time I was recreating what somebody have done already which was quite frustrating because I couldn’t share what I have done and achieved. This time I came across with one problem that can be solved by using Vagrant and it’s a field where it wasn’t used before so it was also good time for me to do everything by my own.

First thing first, what is Vagrant and why I used it with Azure for Don’t Starve Together Server (aka DST). Vagrant is quite old tool, first time I’ve heard about this, it was at Paul’s session probably BuildStuff 2013. Basically this tool allows you to create configuration of your VM as a code, so it can be replicable on every VM provider or even at Cloud providers such as azure, aws. I chose vagrant and azure because I wanted to do easy and one command way to spin up don’t starve together server on cloud.

Vagrant-dontstarve, repository with complete tutorial how to get started, most difficult part is certification, yea a know…MS screwed it up totally…I hope so that one day it will be simplified.

Basically repository contain two main files, Vagrantfile and script.sh.

Vagrantfile is a file where it keeps whole configuration about your : VM image, provider, provisioner, network and more. Here is a configuration for azure, additionally provisioning is global and can be applied to others providers.

 

In the other hand script.sh is a simple bash script that contain instruction for a provisioning step, at this step you are trying to get your machine to certain state, it can set up privileges for users, install applications, configure them. At fallowing piece of code it tries to add architecture, then install all requires libs for SteamCMD.

 

Right now it’s configured only for one provider – Azure, but in few next days I would like to cover VirtualBox and AWS. There one issue that cannot be automated yet, DST requires to open 10999 UDP port, which now unfortunately vagrant-azure doesn’t support, but I hope so that I will make PR soon, I do have to find some time and get ruby environment to work ;)

Happy playing!

Pawel

Battlehack 2015 Demo

JustGiving API Demo

  1. Make a donation with reference code
  2. Retrieve donations for given reference code
  3. Retrieve donation for given ID

Those three calls are complete flow to make a donation and then get aggregated donations for specific reference, and then get details for specific donation. Additionally when you succeed make a donation you will get in response donationId as a URL parameter.

Check out our chat at JabbR, where you can ask question and discuss about API.

At our Github repository you can find complete collection for Postman. Feel free to import and play with it.

P.S Payment process, and queries above are set up against sandbox.

References :

What about formal education?

Recently I got BSc degree at Wroclaw University of Technology (aka PWr) in field of Electronic and Telecommunication, today in my blogpost I would like to talk about formal education, how I precept it,  and what it gives us. We will try to answer to following question, is formal education required to be a programmer?

Legacy

Before I went to Uni. I had some experience in field of programming, mostly basic knowledge about c++, c#, php, even my first *real* job was programming, during summer break at high school. In meantime when I was in high school I did few minor projects as freelancer. I am very glad that, I didn’t waste my time during summer break and instead of this I have been gaining knowledge.

During that time my ego was very huge, probably because I was very young and my thinking was that I can do anything, beside that was the time when I thought that I know *everything* and I can do the same job as colleagues with 5+ years experience. I was so wrong…

I was almost ready to drop out of university, because I thought that programming is just about writing the code, and math ? who cares about math…and other skills.

Expectations

My expectation about university wasn’t clear enough, but for sure I wanted to continuously improving my programming skills (yea right now I know that it doesn’t matter) and I was hoping to get more knowledge about algorithms and data structures.

As I said before, I thought that knowledge I had before my Uni, was everything that I need, and University won’t give me neither skills nor knowledge that I would use later in my career.

I think that most of us had same expectations and point of view about university, especially people who had previous experience with programming or they started their journey very young.

Reality

Reality, was huh…very different that my expectations, basically because I went into Electronic department and my field of study was Electronic and Telecommunication, so in a first look it couldn’t have so much common with programmer job, and its skills.

Of course I was wrong (again n-th time), I got great classes with programming on all levels of abstraction, ASM, C, C++, C#, Matlab, I was programming DSP, distributed systems,  optimizations algorithms, data structures, sorting algorithm. Many interesting things, that’s why now I am a little bit disappointed, because I didn’t make my best to focus on my study properly.

Even during one of the laboratory I propose to do pair programming with piece of TDD, and she has agreed on that. Always remember, if you want to do something in different way, then just ask your professor (99% depend on you, how you do it!).

Studies gave me very strong background about computers, and computer science theory, a lots of math…but hey! functional programming is all about math, physics, electric circuits theory (this is one of the legendary subject, due to hardness to pass)

Beside, at my third year of studies I had classes about image processing, optimization, numerical algorithms, pure joy! That time I realized that web development is boring as hell, that why I chose to my BSc project a Optimization Algoritm as a subject. I will write more about my BSc project later, but it was amazing to learn new language within 2-3 weeks.

Post-graduate feelings

I think that lots of students they forget that university isn’t profession school where you are learning to be a just a worker, Uni is beyond of this, it is a school where you are learning to be a inventor, creator that know all about what is hidden behind of specific platform, or some level of abstraction, you know math, algorithms, how something is built.

What I feel right now, that I didn’t use my time properly during my university, at least first two year of my studies, I think that studies are the best time to learn as much you can and discover things that normally you won’t discover.

Why you might ask me, because during your university you are still young, you have loads of power, free time, you don’t have any real commitment, mortgages. That’s why you should use your time wisely! Don’t worry, time for settle down will come! and don’t worry about money it should be just a side effect of your work, something not really relevant at the begging. Time for real money will come as well.

During this three years you can get know a lot of interesting people, maybe even your future partners in your business, at PWr, we do have a lot of group of interests. Get involve yourself, even if you are really beginner, it doesn’t really matter, because at those groups you will meet a lot of people that will help you to kick off with your knowledge. As Jakub wrote at his blog, you can be good code writer without university and computer science, but you are going to miss a lot of fun and knowledge.

Ending word, in my opinion if you want to be just a programmer (aka coder), you don’t have to know all about computer science, you can learn coding via video courses but some of the knowledge is still difficult to get from internet. For me discussion with professors was really relevant in terms of getting knowledge, they walked through all this knowledge, problems years ago and it can be really nice to see different point of view. I am sure that formal education is not required if you want to be a programmer, but it helps a lot in terms of learning new things, getting know variety of abstraction and what is hidden beyond of them. I want to really encourage you to get a degree at least BSc because it’s pure fun!

University degree is not required to be a programmer, but it’s useful and helpful.

Please let me know what you are thinking about this, and if you have any questions feel free to ask me here or via email pawel@sawicz.eu

Resources:

http://jj09.net/10-things-learn-university/

http://www.daedtech.com/how-developers-stop-learning-rise-of-the-expert-beginner

@Edit : Thanks for Michal Franc for review, and kind word.

Stochastic Approximation – Beginning

example-of-function

Hi everyone, this time I would like to present you something more ambitious than previous blog posts.

Since it is my last semester at Wroclaw University of Technology, the time of BSc project has come. I will write down a mini-series about my preparation, sometimes it can be more technical or just theory. This write is a introduction what is about my project.

Ideas

In the middle of may 2014 I have realized that it’s time to choose a subject for my final project, I had plenty of ideas my like : own interpreter, nosql database, some new tools, implement continuous delivery  but I wanted also to do something not ordinary so after few talks with my supervisor we have agreed to parallel implementation of some optimization algorithm, then we chose Global Stochastic Optimization algorithm described by Sid Yakowitz.

Optimization ?!

Yes, you may wonder that it’s something boring but it’s not!

Especially, this field of studies is getting more popular or at least should be, because we can use those high specialized algorithms on our big data sets to optimize or find solution of our problems.

Where it’s useful ?

We might use it in problems where we want to optimize our problem. I would say that the problem of optimization is everywhere from signal processing to production in some sort of industry. Almost everything can be represented, described as a mathematical model and then optimize.

As you already know that this algorithm can solve some optimization problems you may ask so how many different information (variables) Can I provide ? Basically this algorithm is powerful and quick up to 9th dimensional functions

 What’s my plan

My plan for the next couple of weeks is to create fully working algorithm for 3D problems, so far I have read one article SIAM and one section of the book, it took quite long time to understood what is written (a lot of math!).

First prototype written in R is almost done (but about this I will type separate blog post)

Resources

First of all chapter of this book (Random search under additive noise) is a basic knowledge then you can read this SIAM which is less difficult than this book.

Repositories :

https://github.com/pawelsawicz/Thesis

and

https://github.com/pawelsawicz/Thesis.Documentation

#dotnetconfPL – 2014

dotnetconf logo

 

Hey!

Hey all I would like to invite you to second edition of dotnetconfPL. If you hear about it first time then check out last edition. As you may guess this conference is in Polish, we were inspired by global edition, so we decided to do it in Polish.

At this year we have few more licences to raffle during our event, six resharper and three ncrunch. Thank for all sponsors!

This edition has seven technical oriented talks and one soft oriented talk, we tried, and we want to experiment this approach.

When?

18 October 2014, we are going to start at 3:00 PM GMT+2

Where?

Internet, so you can join to us whenever you can.

Resources :

http://dotnetconf.pl/

My journey to being nomad

PRELUDE :

nomad :

  • a member of a people or tribe who move from place to place to find pasture and food
  • a person who continually moves from place to place; wanderer

nomads

 

My thoughts about journey during summer break has begun at the early October when I decided that it will be fun and great experience to work abroad during my summer break, in the meantime I was participant at DevDay and I have met Martin Mazur from Tretton37 (I have already know tretton37 and how fantastic they are, I always wondering about getting there). Also I got somehow influenced by Rob Ashton and his talk

ACT ONE - Tretton37

(During DevDay) At two minutes talk I asked him about t-shirt of tretton37 and then I decided to ask him about internship, he answered me that unfortunately they don’t have such thing like internship but “drop me a email” and we will try figure out something.

After few days ago, I did this! I have written email and Martin answered me : “Please write down you plans for this internship and how it should looks like, and why are you doing this and why tretton37?”, so many whys and hows but finally answer was simple, “You are the best and I want to learn from the best, you know I wanna be a ninja”

Then after several email we agreed together that I should contact with them at the beginning of next year (2014) because we were talking about summer internship so it’s a while till summer.

New year has come and end of the January seems to be perfect to contact with tretton37 and refresh them about myself (*ping* email). Then the reply arrived, “Can we have skype call to sum up all of those earlier words”, I was happy as hell it supposed to be my first English interview, but I had knowledge after earlier interviews and I said that I need more time to prepare myself. Finally I have done those steps during my preparations.

  • Short review of gramma – it’s optimal, but not necessarily to speak fluent. 
  • Review of vocabulary, in my opinion to master fluent speaking you have to have large knowledge of vocabulary. (not only at technical field)
  • A lot of talking and listening, try to talk in English every day till interview, let your ears and brain to get used to it.
  • If it’s technical interview make preparation on that field too.

Finally friday has come (21.02.2014), Martin had called to me, and…mostly everything went well, yes of course…I got few stuck, mainly due to lacking vocabulary (damn it!), but it wasn’t something serious I was able to explain in other words, so it’s OK. We agree almost everything about my needs and expectations, so now I had to wait till technical interview.

Bad news arrived, unfortunately Martin said that they couldn’t manage with right projects for me and time for me (it’s logic because Martin has taken this internship very seriously as me, we came up with idea that I will get some kind of “mentor” through my whole internship, you know code review that kind of stuff).

If you think that my relationship with tretton37 has ended you are wrong! I offered myself for being a volunteer at leetspeak so see ya soon guys!

ACT TWO - JustGiving

Everything was happening so quickly that I almost didn’t notice that I have signed off contract, but let’s back at the beginning of  this story.

It was sunny morning when Michal sent me a offer from JustGiving, they were looking for Junior ASP.NET & API Product Developer, main responsibilities are : maintenance existing API and develop new features. Moreover I supposed to represent a JG at meetups and conferences, you know – fancy word “Evangelist”. When I saw this offer, I thought that it’s a great opportunity for my summer break plans.

Preparation started imminently, at the first fire went my  curriculum vitae, there wasn’t so much thing to correct, mostly some quick fixes. The hardest part was a cover of letter, so many iterations…it took me a lot of time to make it perfect ;) . Additionally for my application process I had to create something that is using JustGiving API, I made quick decision and I started creating Windows Phone 8 application (repository).

When everything was finished, I sent my candidate for this application, one day later Jamie replied, and we made a appointment at skype with informal interview at the next week (I had my university and work, so there was highly probability that without time I may not prepare myself).

dayofjugmentDay of judgment has come, due to my shity internet connection at home I had to visit my friend and make skype call at her home. This talk lasted about 40 minutes and I had great chat with Jamie. After that talk I feel that it went well.

At the beginning of the second week of June, it was in the middle of my classes, Michal send me a message at skype “congratz” and then I received an email from Jamie and he congratulated for getting this job.

Ending

Those two stories gave me a lot of experience in field of English interviews, making a proper preparations, and I would like to thank all of you that were involved at my recruitment process. My journey with JG will begin at 30.06 so please keep finger crossed because I would like to give them a lot of ideas, and my skills! What’s is important to mention here, that people who surround us, are amazing just keep eye open and create a opportunity for them and yourself

Resources :

http://dictionary.reverso.net/english-definition/nomad

UnauthorizedAccessException while accessing camera

Recently I got that kind of Exception, UnauthorizedAccessException it occurred when I wanted initialize my webcamera in Windows 8 application.

access_deny_microphone_w8

The weirdest thing is that if your application just takes a photo you have to include in requirements that it has to allow a microphone…yes to microphone. Because CaptureControl.Source is a type of MediaCapture, and this class provide a possibility of  taking a photos, recording video and sound, in my opinion this is very weird because if I am making a embedded system it force from me that I have to provide a hardware that has got microphone.

In my opinion there should be a separate classes that provides taking a photos, and recording a video/sound.

Solution to that exception: You have to check in capabilities that your application require a microphone.

microphone_capabilities_w8

 

P.S “Odmowa dostępu” – yep I have polish version of VS, but it means “Access deny”

 

git diff pawelsawicz-cv

I am back! with brand new blog post! Too much time I have been waiting for releasing my new CV but now after few reviews done by mine friends I am ready to write about it, maybe it will help you :)

As you remember at the beginning of march 2013 I was looking for a job as .NET Developer, that was very enlightening time and had showed my weakness and fields to improve myself, CV was one of that thing.

  • Header

header_old

header_new

In this section I had made changes by resize big title of my name to smaller one, next step was to create a title of document and add date of releasing this document. Date of releasing of the document is very important because, it shows you how new, or updated document is.

  • Personal information

 personalinformation_old

personal_info_new

I had deleted some information from this section, like who cares where I live ? I am ready to re-locate anywhere! Birthday information is deleted too, because age don’t define my skills, probably it can define domains wisdom, especially, on how many fields I had worked.

What’s new ? github account. Like I said before I wanna expand my OSS activity, so I think it’s good idea to show my code blocks, furthermore within few months I became github junky

  • Work experience

workexperiance_old

work_experiance_new 

I rebuilt this section by changing  description listing, to sentence, that are formed up as infinitive. moreover current job position is updated.

  • Education

Without changes, still undergraduate – just 2 semester left and checkpoint! (I will get my BSc)

  • Skills

skills_old

skills_new 

Yeah, most rebuilt section at all, first of all I’ve deleted this weird gradation (basic, intermediate and expert) and have replaced with content that actually tells you on what technologies I am working at. Moreover I have added fundamental knowledge. To change this section I was forced by one of the interview, and actually they had right, because what tells you if someone has got C# at expert mode ? that he’s a f**ing awesome as Jon Skeet ?

  • Activities

 activities_old

activities_new

Few new activities that I have made, like dotNetConfPL. Furthermore have added projects for Imagine Cup.

  • Projects

project_new

New section for my commercial and non-commercial projects, as you know  lately I was involved in projects for conferences, at this year I will do more and better.

Conclusion:

My CV is available at : github.com/pawelsawicz/CurriculumVitae so everything is versioned and you can watch my progress :) About things I learnt today, first of all, font on your CV should be a sans-serif, because generally people reads CV on computer, so this font looks better on screen. Second of all, your senescence should be in infinitive form. I want to thanks everyone who have reviewed my CV and gave me a feedback (especially @francmichal, and @JakubJedryszek).

My 2013 and goals for 2014

2013 for my was year full of changes and new things.

  • it was my first time when I was at DevDay, unfortunately due to lack of time I didn’t wrote blogpost. However at this conference I had opportunity to met *almost* everyone from twitter and polish .NET blogosphere. It was fantastic two days in Krakow thanks @rafek and @mihcall for invitation, and see ya at 2014 :)
  • Next event where I have been – was BuildStuff (this blog post is still in progress), but nevertheless I would like to thank to Nereinga and Greg for a fantastic event that was buildstuff, and for all people I had pleasure to met! After-parties were fantastic I can’t wait till next time. What I have learnt during buildstuff, that sessions are not important thing in conference, but after-parties and socializing are important, because here you meet awesome people, you can talk with them and share experience, idea between you.
  • Yea and the most important achievement is that since 7th July I am developer at @Neuro_Sys, thanks for everyone! Especially for my co-workers, I had learnt many things from you :)
  • I participated at Imagine Cup 2013 and what I had learnt is that the idea could has got killing feature but if you don’t have good guy for video presentation you just fail. (marketing, marketing and once more time marketing).
  • dotnetconfPL – First virtual conference base on original idea from @shanselman and @jglozano (dotNetConf) it was first event that I was co-organizer, and again so much wisdom influenced to me it’s priceless, so lesson for today estimate your time carefully. Why ? as Jakub said we started thinking about this event something around May for some of you it could be a very long time to create such like this, but four months were just perfect! (there was too many thing to handle, like speakers, website, sponsors, financial issue) we even had idea to establish organisation.  Probably we continue this event at 2014 as well, so keep cross fingers for us. If you have any ideas that you want to share with us please keep free to contact with us dotnetconfpl@gmail.com.

There are almost all Goals for next year (2014) :

  • Update my CV, yes it’s time to remove some section and add new ones, after 6 months of my employment, my skills has been validated, so it’s time to clean up my CV.
  • I have to move my blog from wordpress to Ghost (already installed, but still need customization). Time to make minimalist blog-site. Next step to refreshing my site will be custom website – “placeholder” for my projects it’s time to reveal my activity for other people.
  • Create application in Xamarin for DevDay and Buildstuff (finally three platform will be supported!). I hope that first commit will be pushed up at the begining of February. Moreover I will try describe my progress at blogpost.
  • Next goal, I want to get involved to OSS contributions, more commits and public repos in github. It helps my with recruiting process, and I always wanted to do something pro publico bono.
  • At this year I want to try make a session at wroc.net or .NET EKA (student .net group). I think it’s good time to start sharing my knowledge and experience with others folks.
  • Last goal but very important, it’s time for node.js and improve my js skill. Yea unfortunately my js skill isn’t so good that I want, so practise time!!!

After all Happy new year everyone!

hey-you-happy-new-year