Category Archives: Server

Update Unifi Controller on Linux

If you have a controller on a Linux box, use the following commands to update the system and install the new update

Code Signing Desktop App

  1. Open a Powershell prompt.
  2. Create a new self-signed certificate for Code signing using “New-SelfSignedCertificate -DnsName “yourdomain.com” -Subject “CN=The Name of Your App” -Type CodeSigningCert -CertStoreLocation cert:\CurrentUser\My“. This will create a certificate in the Personal\Certificates folder of the Certificate Manager. You can view this by running “certmgr.msc” from a Run box.
  3. Export the certificate’s public key to an external file for import into the trusted publishers folder of Certificate Manager using “Export-Certificate -Cert (Get-ChildItem Cert:\CurrentUser\My -CodeSigningCert)[0] -FilePath “My Code Signing Cert.cer”. Note the “[0]” brackets after the Get-ChildItem call. This implies that the certificate that you want to export is the first child item found. If you have multiple code signing certificates in your Personal storage you may need to modify this parameter. You can always double-click on the CER file that is exported to see if you’ve gotten the correct certificate.
  4. Import the certificate file that you just exported to the trusted publishers storage using “Import-Certificate -FilePath ‘.\My Code Signing Cert.cer’ -Cert cert:\CurrentUser\Root“. This will trust the certificate on your development workstation.
  5. Finally, sign the executable file using “Set-AuthenticodeSignature .\MyApp.exe -Certificate (Get-ChildItem cert:\CurrentUser\My -CodeSigningCert)[0]”. The same caveat regarding the “[0}” array index applies here. This is the command that I could not locate. I kept using SignTool to sign the executable but it never worked. I’m not sure if it was the trusted publisher problem, or this step. This command specifies Authenticode so I think this may have had the most impact.

After that you should have the executable show up with a certificate when authenticating with Quickbooks.

https://help.developer.intuit.com/s/question/0D54R00007GdUpJ/how-to-use-signtool-to-certify-my-quickbooks-application

Note: I got most of the information that I used from this StackOverflow Q&A, particularly the answer from @chaami:

https://stackoverflow.com/questions/84847/how-do-i-create-a-self-signed-certificate-for-code-signing-on-windows

WHMCS Oauth userinfo.php not working

I was trying to incorporate SSO in Freshdesk with WHMCS, but because WHMCS requires passing a query parameter = access_token instead of using the Authorization header, this is what you need to do to make it work.

1. Reveal Authorization Header in .htaccess

2. Use your own oauth-intermediary.php where you take the header and send the query parameter that WHMCS is expecting

3. User your new https://www.yousite.com/oauth-intermediary.php as the new userinfo.php URL when requested

Github permission denied from cPanel

For some reason cPanel private keys are needing to be manually added for it to connect to github properly

Also, I ran into an issue where the ssh-agent was not running and needed to be restarted with

Composer Memory Limit Issues when updating/installing

If you run into memory limit issues while trying to use composer, you can disable(or limit to a higher limit e.g. 1024M) with via the method below.