Windows 7 Ultimate SP1 Key Windows 7 Professional SP1 Key Office Professional Plus 2016 Key canada goose outlet www.troilus.es parajumpers belgie parajumpers sale

How to Edit the Hosts File in Mac ?

Edit HOSTS file

  • Launch Terminal, found in /Applications/Utilities/ or launch through Spotlight
  • Type the following command at the prompt:
    sudo nano /private/etc/hosts
    
  • Enter the administrator password when requested, you will not see it typed on screen as usual with the command line
  • Once the hosts file is loaded within nano, use the arrow keys to navigate to the bottom of the hosts file to make your modifications
  • When finished, hit Control+O to save the file
  • Hit ENTER/RETURN to save changes to /private/etc/hosts
  • then hit Control+X to exit out of nano
  • Quit out of Terminal when finished

DNS Flush

Use following command in terminal:

dscacheutil -flushcache

Format Phone Number – SQL Server Function

SELECT dbo.CMN_FmtPhone('1234567891011')
Output: (123) 456-7891 Ext: 011

SELECT dbo.CMN_FmtPhone('1234567820')
Output: (123) 456-7820

CREATE FUNCTION CMN_FmtPhone
(
	@PhoneNumber varchar(15)
)
RETURNS varchar (15)
AS
BEGIN
	Declare @returnValue as Varchar(15)

	SELECT @returnValue =  
			CASE 
			WHEN LEN(LTRIM(RTRIM(@PhoneNumber))) = 10 
				THEN '(' + SUBSTRING(@PhoneNumber, 1, 3) + ')' 
						+ ' ' + SUBSTRING(@PhoneNumber, 4, 3) 
						+ '-' + SUBSTRING(@PhoneNumber, 7, 4) 
			WHEN LEN(LTRIM(RTRIM(@PhoneNumber))) > 10 
				THEN '(' + SUBSTRING(@PhoneNumber, 1, 3) + ')' 
						+ ' ' + SUBSTRING(@PhoneNumber, 4, 3) + '-' 
						+ SUBSTRING(@PhoneNumber, 7, 4) 
						+ ' Ext: ' + SUBSTRING(@PhoneNumber, 11, 5) 
			END

	RETURN @returnValue;

END