Make Thunderbird the Default Mail Client
If Thunderbird is specified as your system's default email application, it will integrate with other applications (such as word processors and web browsers). For example, when you click an email address link (like "This email address is being protected from spambots. You need JavaScript enabled to view it.") on a web page or invoke a mail function (such as "Send to") from a word processor, Thunderbird will launch and open a message composition window.
Force Thunderbird to check if it is the default
Thunderbird can be configured to check if it is the operating system's default mail client each time it is started.
- At the top of the Thunderbird window, click the , or click the menu button menu and select and choose .
- On the panel, select the tab.
- Make sure that "Always check to see if Thunderbird is the default mail client on startup" is checked.
- Click to check if Thunderbird is set as the default mail client immediately.
- If you want to set Thunderbird as the default client for e-mail, newsgroups or feeds, check the corresponding boxes and click OK. When a box is grayed out, Thunderbird is already set as the default client for that purpose.
- If you set Thunderbird to be the default mail client, other applications (such as your web browser or word processing application) may need to be restarted for the changes to take effect.
Set Thunderbird as the operating system default
- Open the Settings application by pressing and releasing the Windows Start button, then clicking the gear icon.
- Click the Apps icon, then click Default Apps in the list.
- Click the icon under the heading Email to show your choices.
- Select Thunderbird.
Set Thunderbird as an application default
In some cases (such as Firefox on KDE Linux), the application doesn't check the operating system preferences to determine the default email application. When that is the case, you must set the default in the application itself. Refer to the application documentation for instructions.
How to Create a PFX Certificate File from a PEM File
How to Create a PFX Certificate File from a PEM File
Issue
Some certificate authorities (such as RapidSSL) only supply certificate in the form of a PEM file, which is not usable by many Windows services.
In the case of RapidSSL, the PEM file may not have been generated as a part of a certificate signing request.
How to Convert PEM to PFX
- Install the latest stable Open SSL. The main page is here or you can find good Windows binaries here.
- Copy the PEM file to the OpenSSL binary folder, such as C:\Program Files\OpenSSL-Win64\bin
- Open an administrative command prompt or Powershell window to that folder
- Type in:
.\openssl pkcs12 -export -out result.pfx -inkey mypemfile.pem -in mypemfile.pem
- You will be prompted for a PFX password as part of the process. You must securely store the password with the PFX file to be able to use it.
- Above, the -inkey command is used to input the private key. If you have a separate certificate signing request (CSR) this would likely not be in the .PEM file, but would be in a separate .CRT file:
.\openssl pkcs12 -export -out result.pfx -inkey mycsrkeyfile.crt -in mypemfile.cer
Also see here.
Applies to:
- Windows Server services that require a PFX certificate that includes the private key
The PKCS#12 or PFX format is a binary format for storing the server certificate, any intermediate certificates, and the private key into a single encryptable file. PFX files are usually found with the extensions .pfx and .p12. PFX files are typically used on Windows and macOS machines to import and export certificates and private keys.
Requirements
- The original private key used for the certificate
- A PEM (.pem, .crt, .cer) or PKCS#7/P7B (.p7b, .p7c) File
- OpenSSL (included with Linux/Unix and macOS, and easily installed on Windows with Cygwin)
The commands below demonstrate examples of how to create a .pfx/.p12 file in the command line using OpenSSL:
PEM (.pem, .crt, .cer) to PFX
openssl pkcs12 -export -out certificate.pfx -inkey privateKey.key -in certificate.crt -certfile more.crt
Breaking down the command:
openssl
– the command for executing OpenSSLpkcs12
– the file utility for PKCS#12 files in OpenSSL-export -out certificate.pfx
– export and save the PFX file as certificate.pfx-inkey privateKey.key
– use the private key file privateKey.key as the private key to combine with the certificate.-in certificate.crt
– use certificate.crt as the certificate the private key will be combined with.-certfile more.crt
– This is optional, this is if you have any additional certificates you would like to include in the PFX file.
PKCS#7/P7B (.p7b, .p7c) to PFX
P7B files cannot be used to directly create a PFX file. P7B files must be converted to PEM. Once converted to PEM, follow the above steps to create a PFX file from a PEM file.
openssl pkcs7 -print_certs -in certificate.p7b -out certificate.crt
Breaking down the command:
openssl
– the command for executing OpenSSLpkcs7
– the file utility for PKCS#7 files in OpenSSL-print_certs -in certificate.p7b
– prints out any certificates or CRLs contained in the file.-out certificate.crt
– output the file as certificate.crt
How to clear the group policy cache on a machine
Clear the group policy cache on a machine
way one
- Open My Computer/Computer
- In the URL or address bar paste: %windir%\system32\GroupPolicy
- Right click and delete the: Machine and User folders to clear local group policy cache
- Restart the computer to reapply the group policies
You can also run the little PowerShell oneliner as Administrator to remove the Group Policy folder and all files below:
Remove-Item "$env:windir\system32\GroupPolicy" -Force -Recurse
way two
- Delete the “HKLM\Software\Policies\Microsoft” Key (looks like a folder).
- Delete the “HKCU\Software\Policies\Microsoft” Key
- Delete the “HKCU\Software\Microsoft\Windows\CurrentVersion\Group Policy Objects” Key.
- Delete the “HKCU\Software\Microsoft\Windows\CurrentVersion\Policies” Key.
third way
- Remove the computer from the domain – (change to a Workgroup)
- Restart computer
- Run gpupdate /force
- Rejoin the domain
MSSQL Tutorial
MSSQL Tutorial
The SELECT statement is used to select data from a database.
The SQL SELECT Statement
The SELECT statement is used to select data from a database.
SELECT Syntax:
SELECT column1, column2, ...
FROM table_name;
SELECT * FROM table_name;
The SQL SELECT DISTINCT Statement
The SELECT DISTINCT statement is used to return only distinct (different) values.
SELECT DISTINCT Syntax
SELECT DISTINCT column1, column2, ...
FROM table_name;
The SQL WHERE Clause
The WHERE clause is used to filter records.
WHERE Syntax
SELECT column1, column2, ...
FROM table_name
WHERE condition;
The SQL AND, OR and NOT Operators
The WHERE clause can be combined with AND, OR, and NOT operators.
AND Syntax
SELECT column1, column2, ...
FROM table_name
WHERE condition1 AND condition2 AND condition3 ...;
OR Syntax
SELECT column1, column2, ...
FROM table_name
WHERE condition1 OR condition2 OR condition3 ...;
The SQL ORDER BY Keyword
The ORDER BY keyword is used to sort the result-set in ascending or descending order.
The ORDER BY keyword sorts the records in ascending order by default. To sort the records in descending order, use the DESC keyword.
ORDER BY Syntax
SELECT column1, column2, ...
FROM table_name
ORDER BY column1, column2, ... ASC|DESC;
The SQL INSERT INTO Statement
The INSERT INTO statement is used to insert new records in a table.
INSERT INTO Syntax
INSERT INTO table_name (column1, column2, column3, ...)
VALUES (value1, value2, value3, ...);
SQL NULL Values
A field with a NULL value is a field with no value.
IS NULL Syntax
SELECT column_names
FROM table_name
WHERE column_name IS NULL;
A field with a NULL value is a field with no value.
IS NOT NULL Syntax
SELECT column_names
FROM table_name
WHERE column_name IS NOT NULL;
SQL UPDATE Statement
The UPDATE statement is used to modify the existing records in a table.
UPDATE Syntax
UPDATE table_name
SET column1 = value1, column2 = value2, ...
WHERE condition;
SQL DELETE Statement
The DELETE statement is used to delete existing records in a table.
DELETE Syntax
DELETE FROM table_name WHERE condition;
SQL TOP, LIMIT, FETCH FIRST or ROWNUM Clause
The SELECT TOP clause is used to specify the number of records to return.
SQL Server / MS Access Syntax:
SELECT TOP number|percent column_name(s)
FROM table_name
WHERE condition;
MySQL Syntax:
SELECT column_name(s)
FROM table_name
WHERE condition
LIMIT number;
SQL MIN() and MAX() Functions
MIN() Syntax
SELECT MIN(column_name)
FROM table_name
WHERE condition;
MAX() Syntax
SELECT MAX(column_name)
FROM table_name
WHERE condition;
SQL COUNT(), AVG() and SUM()
The COUNT() function returns the number of rows that matches a specified criterion.
COUNT() Syntax
SELECT COUNT(column_name)
FROM table_name
WHERE condition;
The AVG() function returns the average value of a numeric column.
The AVG() function returns the average value of a numeric column.
AVG() Syntax
SELECT AVG(column_name)
FROM table_name
WHERE condition;
The SUM() function returns the total sum of a numeric column.
The SUM() function returns the total sum of a numeric column.
SUM() Syntax
SELECT SUM(column_name)
FROM table_name
WHERE condition;
SQL LIKE Operator
The LIKE operator is used in a WHERE clause to search for a specified pattern in a column.
LIKE Syntax
SELECT column1, column2, ...
FROM table_name
WHERE columnN LIKE pattern;
SQL IN Operator
The IN operator allows you to specify multiple values in a WHERE clause.
IN Syntax
SELECT column_name(s)
FROM table_name
WHERE column_name IN (value1, value2, ...);
SQL BETWEEN Operator
BETWEEN Syntax
SELECT column_name(s)
FROM table_name
WHERE column_name BETWEEN value1 AND value2;
SQL Aliases
SQL aliases are used to give a table, or a column in a table, a temporary name.
Alias Column Syntax
SELECT column_name AS alias_name
FROM table_name;
Alias Table Syntax
SELECT column_name(s)
FROM table_name AS alias_name;
SQL Joins
A JOIN clause is used to combine rows from two or more tables, based on a related column between them.
SQL LEFT JOIN Keyword The LEFT JOIN keyword returns all records from the left table (table1), and the matching records from the right table (table2). The result is 0 records from the right side, if there is no match.
LEFT JOIN Syntax
SELECT column_name(s)
FROM table1
LEFT JOIN table2
ON table1.column_name = table2.column_name;
SQL RIGHT JOIN Keyword
The RIGHT JOIN keyword returns all records from the right table (table2), and the matching records from the left table (table1). The result is 0 records from the left side, if there is no match.
RIGHT JOIN Syntax
SELECT column_name(s)
FROM table1
RIGHT JOIN table2
ON table1.column_name = table2.column_name;
FULL OUTER JOIN Syntax
SELECT column_name(s)
FROM table1
FULL OUTER JOIN table2
ON table1.column_name = table2.column_name
WHERE condition;
SQL Self Join
A self join is a regular join, but the table is joined with itself.
Self Join Syntax
SELECT column_name(s)
FROM table1 T1, table1 T2
WHERE condition;
SQL UNION Operator]
The UNION operator is used to combine the result-set of two or more SELECT statements.
UNION Syntax
SELECT column_name(s) FROM table1
UNION
SELECT column_name(s) FROM table2;
SQL GROUP BY Statement
The GROUP BY statement groups rows that have the same values into summary rows, like "find the number of customers in each country".
GROUP BY Syntax
SELECT column_name(s)
FROM table_name
WHERE condition
GROUP BY column_name(s)
ORDER BY column_name(s);
SQL HAVING Clause
The HAVING clause was added to SQL because the WHERE keyword cannot be used with aggregate functions.
HAVING Syntax
SELECT column_name(s)
FROM table_name
WHERE condition
GROUP BY column_name(s)
HAVING condition
ORDER BY column_name(s);
The SQL EXISTS Operator
The EXISTS operator is used to test for the existence of any record in a subquery.
EXISTS Syntax
SELECT column_name(s)
FROM table_name
WHERE EXISTS
(SELECT column_name FROM table_name WHERE condition);
SQL ANY and ALL Operators
The ANY and ALL operators allow you to perform a comparison between a single column value and a range of other values.
ANY Syntax
SELECT column_name(s)
FROM table_name
WHERE column_name operator ANY
(SELECT column_name
FROM table_name
WHERE condition);
SQL SELECT INTO Statement
The SELECT INTO statement copies data from one table into a new table.
SELECT INTO Syntax
Copy all columns into a new table:
SELECT *
INTO newtable [IN externaldb]
FROM oldtable
WHERE condition;
Copy only some columns into a new table:
SELECT column1, column2, column3, ...
INTO newtable [IN externaldb]
FROM oldtable
WHERE condition;
The SQL INSERT INTO SELECT Statement
INSERT INTO SELECT Syntax
Copy all columns from one table to another table:
INSERT INTO table2
SELECT * FROM table1
WHERE condition;
Copy only some columns from one table into another table:
INSERT INTO table2 (column1, column2, column3, ...)
SELECT column1, column2, column3, ...
FROM table1
WHERE condition;
CASE Syntax
CASE
WHEN condition1 THEN result1
WHEN condition2 THEN result2
WHEN conditionN THEN resultN
ELSE result
END;
Single Line Comments
-- Single Line Comments