menu

Monday, April 3, 2017

Resolving fetchMock issues when testing isomorphic-fetch [Reactjs]

Hi peeps,

This is a quickie, and the content is totally reactjs.
If you are using fetchMock to simulate your API requests and you happend to use isomorphic-fetch for better support of fetch in browsers, you might have noticed that how fetchMock doesn't work. The solution is that you have to change the isomorphic-fetch import as below

import fetch from isomorphic-fetch

should be changed to

import isomorphic-fetch

This is highlighted in the fetchMock documentation.


Wednesday, February 15, 2017

Using Google Clound Platform SDK installer behind a proxy

Hi,

In the latest version of Google App Engine SDK, the SDK comes as a part of the Google Cloud Platform SDK. (There's an option to select between that or the legacy SDK). But since new is always better, I tried out the new SDK installer.

Here's the python 2.7 installer for 64bit systems link :

Then I simply followed the instructions, which is to extract the files to *anywhere* and then simply run the install.sh script. This script basically adds aliases to the bashrc and downloads some components from the google servers. The issue is that I was behind a proxy and there was no instruction available on how to configure the installer script to use the proxy. So here's how.

Run the following commands replacing the proxy settings as necessary

Wednesday, November 23, 2016

Developing a 2D Board game with Python / Pygame : Part 2

Hi all,

Please check Part 1 before continuing to this section
In the last section, we covered board generation, leaving the actual network connectivity creation to this section.

Part 2 : Connecting to the server

Step 1 : Configure the game server

The given server (included in the github link), is made in C# as a Visual Studio Solution. Thus to run it
1) Download and extract the source
2) Install Visual Studio
3) Open lk.ac.mrt.cse.pc11/Tanks_server.sln
4) Once done, run the solution to open up the UI and the CLI

NOTE: IF you need to access the server from another machine, you need to make it listen to an interface IP. For that open up App.config and change the IP Address to something you get from ipconfig command.

Now with some analysis of the code and structure of the game server, the following can be seen.

Tuesday, November 22, 2016

Developing a 2D Board game with Python / Pygame : Part 1

Hi all,
Quick introduction is the game is called Tanks and more details about the game will follow later since right now is time critical.
But just to begin,
1) The board is a 20x20 grid
2) 5 players play at the same time
3) There are 4 different times of terrain - Ground, Brick wall, Water, Stone wall
5) Other sprites include coins and health packs
6) Multiplayer, it communicated through a central socket-server

What you need

1) python 2.7 installed
2) pygame library installed

Friday, August 12, 2016

Writing integration tests for Apache CXF REST API that supports XML and JSON

Hey folks,

This comes up as a part of my ongoing GSoC project. The task as described in an earlier post was simple. To convert a SOAP service to REST. Yet the individual issues that comes up along the way sums up to writing those separate blog posts about them.

So this is the last phase of the project that I'm currently carrying out, that is to write integration tests for the now available REST web service. Now have the following assumptions before we go through the procedure

1) The service is implemented with Apache CXF and JAX-RS
2) It can consume and produce both XML and JSON based requests and responses
3) Service is up and running and accessible at https://localhost:5000/rest
4) Service has a one service method called getResponse that accepts XML or JSON requests (in a predefined way) and outputs according to the headers given.

Friday, August 5, 2016

[GSoC 2016] REST implementation for WSO2 IS Entitlement Service

Hi all,

This post is to document the process followed, decisions taken and implementations done in implementing the REST service for WSO2 Identity Server's Entitlement Service. This was done as a GSoC project. If you are nto familiar with the WSO2 Identity Server, please first refer to my previous post which would answer most your questions.

Abbreviations

IS                      -  Identity Server
XACML           -  eXtensible Access Control Markup Language
REST                -  Representational state transfer
JSON                -  JavaScript Object Notation

Thursday, July 14, 2016

phpmyadmin not found on LAMP install in Ubuntu 16.04+

Hey folks,

Just another quick one. Recently I installed Ubuntu 16.04 and Ubuntu 16.10 both uses the shinny new php7.0. And some newer version of apache as well. And both times when I installed phpmyadmin, and go to http://127.0.0.1/phpmyadmin or http://127.0.0.1/phpmyadmin
it gives me a simple, annoying 404!

Well there's a lot of solutions for this in Q&A threads, but for me the only working solution is that, you need to Include the phpmyadmin configuration at the end of the apache2 configuration, so that apache knows that phpmyadmin exists. Here's how

1) Open up apache configurations

sudo nano /etc/apache2/apache2.conf

2) Add the following to the very end

Include /etc/phpmyadmin/apache.conf

3) Save and exist and then restart the apache server

sudo service apache2 restart

4) Browse http://127.0.0.1/phpmyadmin

WORKS GREAT!!