Friday, 18 December 2020

Export data from stored procedure to CSV

 -- xp_cmdshell must be enabled under server security

DECLARE @cmd as varchar(4000) = 'BCP "Exec BikeStores.dbo.Test" QUERYOUT "D:\1.csv" -c -t\^, -T -S' + @@servername

EXEC master..xp_cmdshell @cmd



Friday, 4 September 2020

Powerwashing the Chromebook

  • Sign out of your Chromebook
  • Press and hold Ctrl + Alt + Shift + r
  • Select Restart
  • In the box that appears, select Powerwash. Continue
  • Follow the steps that appear and sign in with your Google Account


Sunday, 31 May 2020

VMWare Cannot Join to Domain - Domain in Unreachable

When trying to join to a domain in VMware Workstation, domain in unreachable. To resolve this:

1. Open cmd as an administrator
2. Execute the following command: bcdedit /set hypervisorlaunchtype off
3. Restart the host
4. Executing the following command should display the domain names: resolve-dnsname <domain-name>


Saturday, 30 May 2020

Building a Windows Server Core from a Full GUI Install

The Server Core installation installs the operating system in non-GUI with minimal footprint and helps to secure the server running Hyper-V role. The benefits of using core server are:

  • Reduced attack surface
  • Reduced maintenance
  • Consume fewer hardware resources
  • Increased stability due to fewer running applications
  1. Clean install a full Windows Server
  2. Open Powershell as Administrator
  3. Execute the following commands:

    Import-Module ServerManager
    Uninstall-WindowsFeature Server-Gui-Shell-Restart
    Uninstall-WindowsfeatureServer-Gui-Mgmt-Infra-Restart

    Powershell C:\>sconfig.cmd     
    # configure the server

VMWare Unable to run a VM due to Device/Credential Guard

VMware Workstation and Device/Credential Guard are not compatible. VMware Workstation can be run after disabling Device/Credential Guard.

1. Open cmd as an administrator
2. Execute the following command: bcdedit /set hypervisorlaunchtype off
3. Restart the host

Wednesday, 27 May 2020

Bring Data to HTML using D3 JS

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>HTML Data</title>
  <script src='https://cdnjs.cloudflare.com/ajax/libs/d3/5.16.0/d3.js'></script>
</head>
<body>
  <script>
  function GetData() {
 
fetch('https://jsonplaceholder.typicode.com/todos')
  .then(response => response.json())
  .then(json=> d3.select("div")
.selectAll("p")
.data(json)
.enter()
.append("p")
.text(d => d.title));
  }
  GetData();
  </script>
 
  <h1>Hello World</h1>
  <div></div>
</body>
</html>

Create modal using HTML and CSS

<body>   <dialog id = "modal">      <div>        <h1>Title</h1>        <p>Sample Text</p...