Tools | Blog | Limilabs https://www.limilabs.com/blog Tue, 18 Oct 2022 19:27:45 +0000 en-US hourly 1 https://wordpress.org/?v=6.3.4 Office 365: OAuth 2.0 IMAP, POP3 email client connectivity tools https://www.limilabs.com/blog/office-365-oauth-2-0-imap-pop3-email-client-connectivity-tools Wed, 21 Sep 2022 15:35:07 +0000 https://www.limilabs.com/blog/?p=6298 To assist IT managers in resolving Office 365 connectivity issues, Microsoft offers a web-based connectivity analyzer. It works with POP3 or IMAP clients and OAuth 2.0: Test IMAP access:https://testconnectivity.microsoft.com/tests/O365Imap/input Test POP3 access:https://testconnectivity.microsoft.com/tests/O365Pop/input Those tools test IMAP and POP3 connectivity only – remember that application in your AD must be properly configured. You need to choose […]

The post Office 365: OAuth 2.0 IMAP, POP3 email client connectivity tools first appeared on Blog | Limilabs.

]]>
To assist IT managers in resolving Office 365 connectivity issues, Microsoft offers a web-based connectivity analyzer. It works with POP3 or IMAP clients and OAuth 2.0:

Test IMAP access:
https://testconnectivity.microsoft.com/tests/O365Imap/input

Test POP3 access:
https://testconnectivity.microsoft.com/tests/O365Pop/input

Those tools test IMAP and POP3 connectivity only – remember that application in your AD must be properly configured.

You need to choose and implement one of the available OAuth 2.0 flows:
https://www.limilabs.com/blog/office-365-basic-auth-is-disabled

The post Office 365: OAuth 2.0 IMAP, POP3 email client connectivity tools first appeared on Blog | Limilabs.

]]>
Create code signing certificate https://www.limilabs.com/blog/create-code-signing-certificate-pfx Thu, 22 Dec 2016 09:38:28 +0000 https://www.limilabs.com/blog/?p=5166 Management summary You generate certificate signing request on your machine (using certmgr or ActiveX component). Private/public key pair is generated along with the request (on your machine). You export certificate that represents the request from your certificate key store. You extract private key from the certificate that represents the request. You send the request (it […]

The post Create code signing certificate first appeared on Blog | Limilabs.

]]>
Management summary
  1. You generate certificate signing request on your machine (using certmgr or ActiveX component).
  2. Private/public key pair is generated along with the request (on your machine).
  3. You export certificate that represents the request from your certificate key store.
  4. You extract private key from the certificate that represents the request.
  5. You send the request (it contains public key only) to CA (or ActiveX does this automatically).
  6. CA sends your certificate back (crt file that is basically your public key, signed with CA’s keys).
  7. Finally you need to combine the private key and the crt to create a pfx, that contains both private key and the certificate.

Important points

  • Private key is generated along with the certificate request.
  • Private key is generated on your machine.
  • Private key is never sent to CA (Certificate Authority).
  • Certificate received from the CA (*.crt file) doesn’t contain your private key.
    • Generate CSR & private key – ActiveX

      Some vendors, like Comodo, use Active X component, that runs on your machine and creates certificate request along with private/public key pair generation on your machine:

      activex_01

      Private key can be found in the certmgr of the local account (not machine’s):

      activex_02

      Later on it must be exported as a pfx (e.g. “Request.pfx”).

      Generate CSR & private key – CertMgr

      In MMC (certmgr), expand Certificates (Local Computer) and then Personal.
      Right-click Certificates, and then go to the following menus: All Tasks > Advanced Operations > Create Custom Request:

      certmgr_00

      Click Next:

      certmgr_01

      Click Next:

      certmgr_02

      Click Next:

      certmgr_03

      Ensure the Request format is PKCS #10, and then click Next:

      certmgr_04

      Click the downward-facing arrow next to Details, and then click Properties.

      certmgr_06

      On the subject type, select the following values, enter the corresponding Value, and then click Add:

      • Common name – Your business or organization’s name
      • Organization – Your business or organization’s name
      • Locality – Your business or organization’s address
      • State – The state where your business or organization resides
      • Country – The country where your business or organization resides

      Go to the Private Key tab, click Key type, and then select Make private key exportable:
      Click OK, and then click Next:

      certmgr_07

      Browse for the location where you want to save the file, enter a File Name (“Request.csr”), and then click Finish.
      Your CSR is now stored in the file you saved it to on your local machine.

      certmgr_05

      Request file is regular text file:

      certmgr_15

      This process also creates a private key, which you will need to use later to create a PFX file to sign your code or driver.

      Export certificate that represents the request

      If you were using ActiveX to generate certificate request, certificate that represents the request (including private key) is stored in certmgr of the local account (not machine’s):

      activex_02

      Go to “Certificate Enrollment Requests”/ “Certificates” (Hit refresh if it is empty):

      certmgr_08

      Right-click the certificate and then go to the following menus: All Tasks > Export:

      certmgr_09

      Select export private key and hit Next:

      certmgr_10

      Ensure the Request format is PKCS #12, and then click Next:

      certmgr_11

      Specify password:

      certmgr_12

      Browse for the location where you want to save the file, enter a File Name (“Request.pfx”), and then click Finish.

      certmgr_13

      Click Finish:

      certmgr_14

      Certificate that represents your request is now stored in the file you saved on your local machine. It contains both private and public key.

      Extract private key

      First you’ll need to install OpenSSL.

      To extract private key from the request, issue following command:

      openssl pkcs12 -in Request.pfx -out Request_PrivateKey.pem -nocerts -nodes

      nocerts = private key only,
      nodes = no password

      Generate CSR & private key – OpenSSL

      You can use following command to create certificate request and key using OpenSSL:

      openssl req -new -newkey rsa:2048 -nodes -keyout Request_PrivateKey.key -out Request.csr

      You may need to convert to convert the key (BEGIN PRIVATE KEY) to PKCS#1 format (BEGIN RSA PRIVATE KEY):

      openssl rsa -outform pem -in Request_PrivateKey.key -out Request_PrivateKey.pem

      CA creates a certificate

      Now you should upload -or- copy&paste request file (“Request.csr”) to your CA, and in return, they should create the certificate for you:

      generated_00

      What you receive from your CA looks more or less like this:
      generated_01

      Most important file is the crt file which contains your certificate (it includes public key only).

      Combine private key with cert to create pfx

      To combine private key from the request and certificate from CA into one pfx certificate, issue following command:

      openssl pkcs12 -inkey Request_PrivateKey.pem -in 00…70.crt -export -out 00…70.pfx

      The pfx file you created contains both private key and the certificate and can be used to sign your code.

      The post Create code signing certificate first appeared on Blog | Limilabs.

      ]]> NavigateToTest VS2013 extension https://www.limilabs.com/blog/navigate-to-test-vs2013-extension Sat, 26 Jul 2014 10:09:24 +0000 http://www.limilabs.com/blog/?p=4723 Extension is available for other Visual Studio versions: GoToTest macro for VisualStudio 2008 NavigateToTest VS2010 extension NavigateToTest VS2012 extension NavigateToTest VS2013 extension NavigateToTest VS2015 extension NavigateToTest VS2017 extension NavigateToTest VS2019 extension NavigateToTest VS2022 extension You can download the extension here: NavigateToTest Visual Studio 2013 extension Here’s the latest version that supports Visual Studio 2013. Extension […]

      The post NavigateToTest VS2013 extension first appeared on Blog | Limilabs.

      ]]>
      Extension is available for other Visual Studio versions:

      You can download the extension here:
      NavigateToTest Visual Studio 2013 extension

      Here’s the latest version that supports Visual Studio 2013.

      Extension is convention based. It matches ClassName file with ClassNameTest or ClassNameTests and vice-versa, so you can easily navigate to the test file and back.

      Here are some screenshots:

      Here’s the toolbar and two opened files:

      You can download the extension here:
      NavigateToTest Visual Studio 2013 extension

      The post NavigateToTest VS2013 extension first appeared on Blog | Limilabs.

      ]]>
      NavigateToTest VS2012 extension https://www.limilabs.com/blog/navigate-to-test-vs2012-extension Sun, 26 Aug 2012 13:50:55 +0000 http://www.limilabs.com/blog/?p=3313 Extension is available for other Visual Studio versions: GoToTest macro for VisualStudio 2008 NavigateToTest VS2010 extension NavigateToTest VS2012 extension NavigateToTest VS2013 extension NavigateToTest VS2015 extension NavigateToTest VS2017 extension NavigateToTest VS2019 extension NavigateToTest VS2022 extension You can download the extension here: NavigateToTest Visual Studio 2012 extension Here’s the latest version that supports Visual Studio 2012. Extension […]

      The post NavigateToTest VS2012 extension first appeared on Blog | Limilabs.

      ]]>
      Extension is available for other Visual Studio versions:

      You can download the extension here:
      NavigateToTest Visual Studio 2012 extension

      Here’s the latest version that supports Visual Studio 2012.

      Extension is convention based. It matches ClassName file with ClassNameTest or ClassNameTests and vice-versa, so you can easily navigate to the test file and back.

      Here are some screenshots:

      Here’s the toolbar and two opened files:

      You can download the extension here:
      NavigateToTest Visual Studio 2012 extension

      The post NavigateToTest VS2012 extension first appeared on Blog | Limilabs.

      ]]>
      NavigateToTest VS extension https://www.limilabs.com/blog/navigate-to-test-visual-studio-extension https://www.limilabs.com/blog/navigate-to-test-visual-studio-extension#comments Mon, 03 May 2010 09:28:56 +0000 http://www.limilabs.com/blog/?p=868 Extension is available for other Visual Studio versions: GoToTest macro for VisualStudio 2008 NavigateToTest VS2010 extension NavigateToTest VS2012 extension NavigateToTest VS2013 extension NavigateToTest VS2015 extension NavigateToTest VS2017 extension NavigateToTest VS2019 extension NavigateToTest VS2022 extension You can download the extension here: NavigateToTest Visual Studio extension Recently I decided to create a Visual Studio 2010 extension. Extension […]

      The post NavigateToTest VS extension first appeared on Blog | Limilabs.

      ]]>
      Extension is available for other Visual Studio versions:

      You can download the extension here:
      NavigateToTest Visual Studio extension

      Recently I decided to create a Visual Studio 2010 extension.

      Extension is convention based. It matches ClassName file with ClassNameTest or ClassNameTests and vice-versa, so you can easily navigate to the test file and back.

      Here are some screenshots:

      You’ll need to add toolbar manually:

      Here’s the toolbar:

      And two opened files:

      You can download the extension here:
      NavigateToTest Visual Studio extension

      The post NavigateToTest VS extension first appeared on Blog | Limilabs.

      ]]>
      https://www.limilabs.com/blog/navigate-to-test-visual-studio-extension/feed 2
      Editor Guidelines in VS2010 https://www.limilabs.com/blog/editor-guidelines-in-vs2010 Wed, 28 Apr 2010 07:29:41 +0000 http://www.limilabs.com/blog/?p=857 In VS2008 this could be done easily, it was just required to modify the registry. Visual Studio 2010 lacks this feature, but there is a cool plugin for that: Editor Guidelines. Just download, install, and put the following code in to the registry:

      The post Editor Guidelines in VS2010 first appeared on Blog | Limilabs.

      ]]>

      In VS2008 this could be done easily, it was just required to modify the registry.

      Visual Studio 2010 lacks this feature, but there is a cool plugin for that:
      Editor Guidelines.

      Just download, install, and put the following code in to the registry:

      Windows Registry Editor Version 5.00
      
      [HKEY_CURRENT_USERSoftwareMicrosoftVisualStudio10.0Text Editor]
      "Guides"="RGB(255,0,0) 80"
      

      The post Editor Guidelines in VS2010 first appeared on Blog | Limilabs.

      ]]>
      Source lines of code count using PowerShell https://www.limilabs.com/blog/source-lines-of-code-count-using-powershell https://www.limilabs.com/blog/source-lines-of-code-count-using-powershell#comments Mon, 29 Mar 2010 18:35:43 +0000 http://www.limilabs.com/blog/?p=777 Source lines of code (SLOC) is a software metric used to measure the size of a software program by counting the number of lines in the text of the program’s source code. As we all know the disadvantages of this metric, sometimes we simply want to know. Here’s a PowerShell script, that recursively searches for […]

      The post Source lines of code count using PowerShell first appeared on Blog | Limilabs.

      ]]>
      Source lines of code (SLOC) is a software metric used to measure the size of a software program by counting the number of lines in the text of the program’s source code.

      As we all know the disadvantages of this metric, sometimes we simply want to know.

      Here’s a PowerShell script, that recursively searches for *.cs files and counts the lines (empty lines and comments are excluded)

      (dir -include *.cs -recurse | select-string "^(\s*)//" -notMatch | select-string "^(\s*)$" -notMatch).Count
      

      Brief description of what all parts are doing:

      • dir -include *.cs -recurse : Lists all *.cs files, you can add additional extensions using a comma.
      • select-string “^(\s*)//” -notMatch : Exclude comments.
      • select-string “^(\s*)$” -notMatch : Exclude empty lines.

      The post Source lines of code count using PowerShell first appeared on Blog | Limilabs.

      ]]>
      https://www.limilabs.com/blog/source-lines-of-code-count-using-powershell/feed 5
      Red line at 80th column in VS https://www.limilabs.com/blog/red-line-at-80th-column-in-vs https://www.limilabs.com/blog/red-line-at-80th-column-in-vs#comments Wed, 14 Oct 2009 14:42:24 +0000 http://www.limilabs.com/blog/?p=195 There is a hidden feature in Visual Studio. You can add a nice, red, vertical line to your editor. All you need to do is to create a .reg file with the following content: Windows Registry Editor Version 5.00 [HKEY_CURRENT_USER/Software/Microsoft/VisualStudio/9.0/Text Editor] "Guides"="RGB(255,230,230), 80" And add it to registry (double click). That’s it!

      The post Red line at 80th column in VS first appeared on Blog | Limilabs.

      ]]>
      There is a hidden feature in Visual Studio. You can add a nice, red, vertical line to your editor.

      vs_redline_at80
      All you need to do is to create a .reg file with the following content:

      Windows Registry Editor Version 5.00

      [HKEY_CURRENT_USER/Software/Microsoft/VisualStudio/9.0/Text Editor]
      "Guides"="RGB(255,230,230), 80"

      And add it to registry (double click). That’s it!

      The post Red line at 80th column in VS first appeared on Blog | Limilabs.

      ]]>
      https://www.limilabs.com/blog/red-line-at-80th-column-in-vs/feed 1
      How to permanently remove a SVN folder https://www.limilabs.com/blog/how-to-permanently-remove-svn-folder https://www.limilabs.com/blog/how-to-permanently-remove-svn-folder#comments Wed, 07 Oct 2009 10:04:34 +0000 http://www.limilabs.com/blog/?p=168 Recently I wanted to permanently remove a folder from Subversion repository. Basically it was a folder with large amount of test data (email messages used for unit testing our Mail.dll email component), and I decided to rename every single file inside. Doing it with ‘SVN rename…’ for 3000 items was out of question. The solution […]

      The post How to permanently remove a SVN folder first appeared on Blog | Limilabs.

      ]]>
      svnRecently I wanted to permanently remove a folder from Subversion repository.

      Basically it was a folder with large amount of test data (email messages used for unit testing our Mail.dll email component), and I decided to rename every single file inside. Doing it with ‘SVN rename…’ for 3000 items was out of question.

      The solution was quite simple:

      First dump the whole repository:
      svnadmin dump "D:\My projects\SVN Data" > dumpfile.txt

      Second filter the folder I wanted to remove:
      svndumpfilter exclude Mail\eml < dumpfile.txt > filtered-dumpfile.txt

      Then delete and create a new repository:
      Delete repository
      svnadmin create "D:\My projects\SVN Data"

      Finally load the filtered dump into SVN repository:
      svnadmin load "D:\My projects\SVN Data" < filtered-dumpfile.txt

      You can also use this procedure for upgrading SVN repository version.

      The post How to permanently remove a SVN folder first appeared on Blog | Limilabs.

      ]]>
      https://www.limilabs.com/blog/how-to-permanently-remove-svn-folder/feed 5
      How to test email sending? https://www.limilabs.com/blog/how-to-test-email-sending Fri, 25 Sep 2009 08:11:13 +0000 http://www.limilabs.com/blog/?p=94 Nearly every web application these days sends some notifications to its users. Many times before, I came across people who said that it’s not possible to test such things. Well, they are wrong! There is a very cool project on sourceforge called nDumbster: http://ndumbster.sourceforge.net nDumbster is a simple fake SMTP server designed especially to enable […]

      The post How to test email sending? first appeared on Blog | Limilabs.

      ]]>
      Nearly every web application these days sends some notifications to its users.

      Many times before, I came across people who said that it’s not possible to test such things.
      Well, they are wrong!

      There is a very cool project on sourceforge called nDumbster:
      http://ndumbster.sourceforge.net

      nDumbster is a simple fake SMTP server designed especially to enable unit testing.

      [TestFixture]
      public class SmtpClientTest
      {
          private const int _port = 25;
          private SimpleSmtpServer _smtpServer;
      
          [SetUp]
          public void SetUp()
          {
              _smtpServer = SimpleSmtpServer.Start(_port);
          }
      
          [TearDown]
          public void TearDown()
          {
              _smtpServer.Stop();
          }
      
          [Test]
          public void SendMessage_SendsMessage()
          {
              Mail.Text("Some tex")
                  .Subject("Some subject")
                  .From(new MailBox("alice@mail.com", "Alice"))
                  .To(new MailBox("bob@mail.com", "Bob"))
                  .UsingNewSmtp()
                  .Server("localhost")
                  .OnPort(_port)
                  .Send();
      
              Assert.AreEqual(1, _smtpServer.ReceivedEmailCount);
              SmtpMessage mail = _smtpServer.ReceivedEmail[0];
              Assert.AreEqual(""Alice" <alice@mail.com>", mail.Headers["From"]);
              Assert.AreEqual(""Bob" <bob@mail.com>", mail.Headers["To"]);
              Assert.AreEqual("Some subject", mail.Headers["Subject"]);
              Assert.AreEqual("Some text", mail.Body);
          }
      };
      

      The post How to test email sending? first appeared on Blog | Limilabs.

      ]]>