Showing posts with label Windows. Show all posts
Showing posts with label Windows. Show all posts

Friday, January 24, 2020

How to read or edit a large text file in Windows 10?

One of my colleagues needed to open a large XML file (nearly a Gigabyte in size) to review the data and make any corrections to it. She tried Notepad++ as well as Microsoft XML Notepad 2007. It took minutes to load the file. She could barely scroll through the page.

I searched for a free and opensource tool that would do the job. I came across GNU Emacs. It is a powerful editor for the GNU operating system. GNU Emacs for Windows is also available for download, and it works like a charm.




Download Instruction is available at: https://www.gnu.org/software/emacs/download.html

To get a copy of GNU Emacs for Windows, you can visit http://ftp.gnu.org/gnu/emacs/windows/  and download the latest version for your platform. 

For example, on my 64-bit Windows 10 system with an Intel processor, I downloaded emacs-26.3-x86_64.zip. I unzipped the folder at my desired location (C:\Program Files\Emacs) and browsed to the bin folder to launch emacs.exe. I also created a desktop shortcut to emacs.exe.

This editor opened that large XML file without any hesitation. It was easy to work on. I helped my colleague setup this editor on her workstation. She got very excited as she was able to work on the file effortlessly. I am sure you will find this editor exciting too when you run into the same issue my colleague ran into. 


Wednesday, June 12, 2013

Reset Windows / Windows Server / Domain Controller Administrator Password

Step1: Boot from Windows Bootable disk and select "Repair your Computer" Option


Step2: Follow  instructions until you get to following "Command Prompt" Option

Step3: Find which drive has Windows
Check if  C: drive has 'Windows' folder. If not, try D drive
>c:
         c:\>dir
        
        c:\> d:
        d:\> dir

Step4:  Replace Utilman.exe with cmd.exe. Note: Utilman.exe and cmd.exe are located under  Windows/System32
>cd Windows
Windows>cd System32
Windows\system32>move Utilman.exe  Utilman.exe.old
Windows\system32>copy  cmd.exe Utilman.exe
Windows\system32>exit

Step5:  Restart the server

Step6:  Once the booting is done, you are back to the logon screen. Click on the 'Ease of Access' icon

Hurray!!!.... There is your command prompt :)

Step7: Change the user password using command prompt.
>net   user   administrator   *
(Note: Windows doesn't allow easy passwords)

That's it. Now you can login as 'administrator' user

Let's say you want to add new user and add that user to the admin group
>net   user hacker   password123   /add
>net localgroup   administrators   hacker   /add

Don't forget to rename Utilman.exe.old to Utilman.exe.
Windows\system32>move Utilman.exe  Utilman.exe.old

Please use this instruction responsibly for the legitimate purpose.

Monday, January 30, 2012

Windows not syncing with NTP server

NTP (Network Time Protocol) is widely used for computer clock synchronization in  internet. There are various versions of NTP. Latest version as of Jun 2010 is NTPv4 and is well described in RFC5905. NTP4 is modified to accommodate IPv6 and other improvement has been done over NTPv4.

Are you getting 'Peer Unreachable' when you try to syc with NTP server?
Usually there are various reasons behind the problem.

1. Firewall or port filter : Make sure that default UDP port 123 is open. You can test this real quick just by turning off Firewall.

2. Windows Time Service (w32time) not running on the appropriate mode
There are various modes of operation for Windows Time Service as NTP supports several different packet types.
Normally NTP client sends 'client' mode request packets to a NTP server
NTP server responds back with 'server' mode packet with timing information

By default some windows (esp. XP and earlier) sends 'symmetric active' mode packet instead of 'client' mode request packets. 'symmetric active' mode packets is for NTP's peering feature where a pool of computers(peers) are configured to sync their clocks among each others to agree upon a common 'network time', which then can be supplied to the client.

Usually NTP server drops 'symmetric active' mode packets, unless it is told to do so.

Q: How can I switch to 'client' mode of Windows Time Service?

Ans: You have to change the Windows registry and it can be done easily via command line

 w32tm  /config  /manualpeerlist:ntp.myserver.com,0x8  /syncfromflags:MANUAL

Here, ntp.myserver.com is my NTP server

The valid settings for the mode used with the /manualpeerlist switch include the following:
  • 0x01 - use special poll interval SpecialInterval
  • 0x02 - UseAsFallbackOnly
  • 0x04 - send request as SymmetricActive mode
  • 0x08 - send request as Client mode
The mode that Windows Time uses to send requests is set by the following registry subkey:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpServer

0x8  enables 'client' mode for Windows Time Service
syncfromflags:MANUAL  forces Windows Time Service to use manualpeerlist for the time query. 

Make changes effective immediately
w32tm  /config  /update

To resync manually
w32tm /resync


Additional Tips: 
If you want to sync with time server everyday, you can create a new 'Scheduled Task' under Control Panel --> Scheduled Task to run  'w32tm  /resync' everyday at your specified time.

Good Luck!