Posts

How to view queries executed in MySQL?

Hi all, This is a small post which I would like to share my finding with you. In one of my software project, There was a small peace of software which frequently dealing with database. (I got that clue from MySQL workbench dashboard) I was so curious about that because I wanted to know what does that do and what does it read/write from/to the database.  Finally I found a solution which helps me to find out that ! The solution was MySQL log. First you will have to enable the log. If you are using a version below 5.1.12, you will have to go to configuration level (my.cnf). But fortunately, If you are using MySQL >= 5.1.12 you can do that on the fly with MySQL global variables and does not need to restart the server as well. This is how I did (in MySQL >= 5.1.12), There are two options which can be done. Writing log to a table Writing log to a file. By default, MySQL logging is disabled, because of the performance reasons.  So we have to enable it first.   Writing log to a table Exe

Introduction to docker!

Image
Well, Today I thought to bring you something different. Docker is the most popular platform in today to run applications easily. Docker helps us to deploy our applications more easily with less involvements of configurations. Main concept behind the docker is virtualization . Anyway, this is some kind of large topic and like you, I'm still learning these stuff. However I would like to share my experience on this technology with you. I hope this will help someone who willing to take the first step of the docker technology. Without further, let's dive into the docker sea !. So as I say, Lets start docker from basic. 😉 Why we need docker? The requirement of docker is started with the introduction of micro service architecture. According to the microservice architecture , we should split/divide our application into different individual services. So that, unlike 3 tier (monolithic) architecture, we have to deploy and run several services. Example system with microservic

Lets read emails in gmail using oAuth 2.0 (Application demo)

Image
Today I will create a oAuth application using java programming language. The application will access google's gmail api and read emails in user's gmail inbox. To access user's gmail account, application will use oAuth access token obtained by gmail authentication server. Don't worry. I will demonstrate each step by clearly. So lets start computing from basics! To use gmail api, we need to obtain app id and app secret from google api console. To do so, you will need a google account. If you are using a gmail account or any other google product (Ex. google drive, youtube), then you already have a google account. If you don't have a google account, you can create it from here. So then you will need to access into the google cloud api console. It has very clear and clean user interface. Google api console will provide various kinds of apis from each of google products. Since we are going to develop for Gmail, lets log into gmail api section. In google itself there are

CSRF Defence - Double Submit Cookie Pattern Demo

This is a continuation of previous csrf prevention tutorial . If you haven't read it, please read it first.  Lets continue from previous one. As you can remember, we have succesfull implemented an application that prevents from csrf attacks using synchronizer token pattern . Today we will try to prevent csrf using double submit cookie pattern . Since both synchronizer token pattern and double submit cookie pattern have same application base, I will try to modify the previous application to achieve the goal. Before the coding, lets remember the idea and difference between synchrizer token pattern and double submit cookie pattern. In synchronizer token pattern, server needs to maintain a list of csrf tokens for each user session. So client will request that stored token using an ajax request. Since cross domain requests are not allowed by default in ajax, malicous sites cannot request csrf token from server. In double submit cookie pattern, server will not maintain list of csr

Mobile Applications Basics

Image
Current Context Current days, mobile applications became more and more popular than other applications like desktop applications and web applications. The reason is portability and usability. Technology trend of current days quickly moving to smart devices like tablets pcs, smartphones etc. The popularity of desktop pcs and laptop pcs becoming decreasing day by day. When we considering the people in current days, most of them have at least one smartphone. And the hardware specifications are also becoming increasing and they got more powerful. What about web applications As the reason of improvement in the mobile industry, software developers tend to develop web applications since they are more flexible and can be made to meet requirements for desktop pcs and at the same time they can fulfill the requirements for mobile devices. With the improvements of CSS technologies and CSS frameworks like Bootstrap , web applications can adapt to the screen size of the device that curre