Skip to main content

Posts

Showing posts from 2018

Umbraco Notifications - Save and Send For Approval Process

In Umbraco you can give different permissions to the different Umbraco users and some of these users might have rights to only create or update content nodes but not to publish them. In this case; you might need your Umbraco system to send notification e-mails to the Umbraco users who can then publish the content nodes. To do this; you can write your own custom code by creating some event handlers or you can use built-in Umbraco notification functionality. For the second built-in option first login to Umbraco as admin and go to User's section and update the permissions as shown below; Once you are done with the user permissions, subscribe your Umbraco users to the content nodes, simply login to Umbraco with those users and find the content node, right click on it and select the following option; After this you need to make changes in the web.config file of your Umbraco project. For my case I am using my test gmail account for sending e-mails. In order to use your gm

MS SQL Server - Finding Running Server Processes and Killing the Processes which are Currently in a Blocked State

It is sometimes needed to see the running server processes and if necessary kill the ones who are in a blocked state. In order to do that you can use the following T-SQL scripts; This will return you the active processes and simply using the session_id value, you can kill the processes.       SELECT  sqltext . TEXT ,             req . session_id ,             req . status ,             req . command ,             req . cpu_time ,             req . total_elapsed_time        FROM   sys . dm_exec_requests req CROSS APPLY   sys . dm_exec_sql_text ( sql_handle ) AS sqltext KILL  [session_id] GO Also you can run the following script and check the BlkBy field for the SPIDs that are blocking other processes and then you can kill them. EXEC sp_who2 GO KILL 53 GO Once you run the "KILL" command, you can run the following command to check the results again; EXEC   sp_who2 GO

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 image Open Windows PowerShell Type this command and hit enter  get-filehash FILEPATH It 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  ajaxcalls   is 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. View: @section Scripts{     < script type ="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

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">     <system.webServer>       <httpErrors existingResponse="PassThrough" />     </system.webServer>   </location> Request URL: https://DOMAINNAME/umbraco/backoffice/UmbracoApi/Content/PostSave Request Method: POST Status Code: 400 Bad Request