Posts

Showing posts from January, 2022

How to Identify Windows Service Start Failure?

Image
Identifying the Service  Once our Windows Service is successfully installed in the system and added to the Services list. Its time to get it running. For that we can open the Service Explorer by running the command services.msc in the Run Window. We can see the service that is added as shown below: We can start the service by right-click on the service to invoke the context menu for the service which contains options such as start, stop pause etc. We can  click on the start option to start the service. Identifying the Service Errors If the service fails to start no need to worry we can figure the actual reason for the failure by using the Event Viewer Tool from Windows. This tool will list the events which occurred when the system is in ON state. There we can search for some errors thrown by our service, sample is shown below: As its clearly shown in the figure above we can see the error thrown along with the call stack giving an indication of the potential reason for the failure. In t

Creating a Windows Service | How to add a Service into Services.msc in Windows?

Image
  Today we will be looking at how to add a Service into list of windows services or in other words make our service managed by Service Control Manager(SCM).We can see the list of existing Windows Services by typing in the command "services.msc" in the Run window. This will open up a window listing the various services in the system currently and also there current state. Suggested Reads :  dotnet publish Steps to Create Windows Service We can create a Windows Service by using the Microsoft Visual Studio Project Template "Windows Service". By selecting the template along with the Target framework new Windows Service is Created. Next Step is to Add a Project Installer to this Service to install the required components so that the Service Control Manager can know that a new service has been added. We can install the Project installer by right clicking on the designer file of the Service and choosing  "Add Installer" option, as shown in the figure below: This

Understanding Commonly used DockerFile statements

Image
  In this Exercise we will understand the use of commonly referred commands in Docker file for containerizing a Node js application. Lets take an example of a docker file as given below: Docker File Keywords FROM <Image Name>:<Image Version>       This represents the base image to be used for the container, this depends on the type of application we are containerizing in this case its node because we are trying to containerize Node application. ENV <Environment Identifier> = <Environment Name>       This statement sets the Environment needed for running the application. WORKDIR <Working directory name>       This identifies the directory which will be used within the container image for running the application. COPY <List of files>      This allows us to copy the required files which is necessary to setup the environment  and install the required dependency before starting the application. In this case we are copying the package.json file which conta

Containerizing Node JS Application using Docker installed in Windows Subsystem For Linux 2(WSL2)

Image
  Today we will be looking at how to containerize Node js application in WSL2 enabled in a Windows 10 Operating System. There are some prerequisite setup needs to be done before we proceed to containerize the application. First and foremost we need to enable WSL2 in windows 10 system. You can refer here to see the steps needed to enable WSL2. Once WSL2 is enabled then we need to install docker in WSL2 so that we can build the image. Once these things are done then we can start to containerize the application by creating a Dockerfile in the application. This Dockerfile describes the steps needed to be done by the docker deamon to build an image. How to Create DockerFile in Visual Studio Code We can easily create a DockerFile in the VS Code by installing the extension for the docker. Once the Docker extension is installed open the command Bar by pressing Ctrl + Shift + P and select the option docker : add docker file. After selecting the option to add the docker file you will  be prompt

[Android] Making Mobile Applications Load Faster With Developer Options

Image
  We all have come across a situation wherein the mobile applications take considerable time to load up due to different loading animations present with the android application. These animations take up significant time while loading up the application. Fortunately, there is a way to reduce the animation or speed up the animation in the android mobile using "Developer Options". Developer options is mainly for the mobile application programmers to debug the mobile device and collect different relevant information about the device. "Developer Options" is available in the settings menu.  But normally it would be turned off. How to Enable the Developer Option in Android Mobile Developer Option can be enabled by going to the Settings -> About Phone ->Software Information section. In this page you will find the Build Number. To Enable to developer mode click on the Build Number 7 times and then you will be prompted for the login PIN of the mobile device. Once it is

How to Plugin Html and css using Express (Node JS Framework)

Image
Express is a Node JS Framework for Web based application. Express can be used to plugin static resources in the web project mainly the html and css files. We will see here how can we plugin these files using express with example. Example To Plugin Html CSS Before we get started on these, certain pre-requisite packages need to be installed. One is the Node js itself which can be easily installed from online. it will be available as a exe and can be installed with default settings just like normal application. Once the Node js is installed we can verify if the installation is proper with the help of command node --version in the powershell. Once Node is installed we need to install the required node packages using the node packet manager(npm). Suggested Read :  Creating Node JS Webserver Some of the packages required for this will be express, which can be installed with the help of commands npm init and npm install express. We will see the progress of the installation in the PowerShell