Showing posts from 2018

Kali Linux - Verifying Integrity and Authenticity of Kali Linux .iso Image On Windows Machine

When you decide to install Kali Linux to your computer, you first need to go to the official website and decide which image to download. While this page is TLS-protected, the actual download link points to an unencrypted URL that offers no protection against potential man-in-the-middle attacks. As a result; you must verify your Linux image.

In order to do that;

First copy the sha256sum value of the image that you're downloading to somewhere safe. Download the imageOpen Windows PowerShellType this command and hit enter get-filehash FILEPATHIt will take a little while for Powershell to return the Algorithm, Hash and Path details of your file.Check the Hash value with the sha256sum  value of your image. If they don't match, this could be security risk, otherwise you can install your Kali Linux. Happy coding.

How to use JQuery Ajax Methods for Async ASP.NET MVC Action Methods

Making repeatedly calls to async methods can be a nightmare. In this case, it makes sense to use 2 ajax methods, instead of one.

Here is a simple solution to overcome this problem. See that ajaxcallsis emptied after the success response for the first ajax call and then the second ajax method is used to make one single call to the async action method.

Hope it helps.


@section Scripts{ <scripttype="text/javascript">
var smartDebitObject = new Object(); smartDebitObject.MembershipNumber = $("#MembershipNumber").val(); smartDebitObject.ProfileId = $("#ProfileId").val(); smartDebitObject.FirstName = $("#FirstName").val(); smartDebitObject.LastName = $("#LastName").val(); smartDebitObject.AddressLine1 = $("#AddressLine1").val(); smartDebitObject.Postcode = $("#Postcode").val(); smartDebitObject.Town = $("#Town").val(); smartDebitObject.FrequencyType = $("#FrequencyType").val(); var request = JSON.string…

Briefly Stateless and Stateful Design in Programming

Stateless programming is related to the mathematical notion of a function, which when called with the same arguments, always return the same result. This is a key concept of the functional programming paradigm.

In other words;
Stateless means there is no memory of the past. Every transaction is performed as if it was being done for the very first time.

Stateful means there is memory of the past. Previous transactions are remembered and may affect the current transaction.

RESTful we services are by design stateless, so is ASP.NET MVC.

Stateless: //The state is derived by what is passed into the function function int addOne(int number) { return number + 1; } Stateful: //The state is maintained by the function private int _number = 0; //initially zero function int addOne() { _number++; return _number; }

Fix for Umbraco Backoffice Login Problem - umbraco/backoffice/UmbracoApi/Authentication/PostLogin - 400 Bad Request

If you ever see that you can not login to Umbraco backoffice anymore even though you haven't changed anything, this could be because of 301 Url Tracker umbraco package.

For my case; this package was messing up paths for Umbraco Backoffice API mehtods and deleting all records in icUrlTracker table has fixed my problem.

There are other suggestions like updating the web.config useLegacyEncoding setting but this hasn't worked for me.

Hope it helps.

Fix for "Umbraco PostSave 400 Bad Request"

Custom error config changes might cause some Umbraco 400 response issues. As a results while saving and publishing umbraco content, you might see "PostSave 400 Bad Request" messages. In my case I also couldn't see some umbraco mandatory field validation messages.

In order to fix it you can add the following line to your web.config and it should start working.
  <location path="umbraco">
      <httpErrors existingResponse="PassThrough" />
Request URL: https://DOMAINNAME/umbraco/backoffice/UmbracoApi/Content/PostSave Request Method: POST Status Code: 400 Bad Request