Showing posts with label windows. Show all posts
Showing posts with label windows. Show all posts

Tuesday, September 10, 2024

Access windows localhost from wsl

To access window's localhost from wsl, you can set networkingMode=mirrored in .wslconfig

Reference:

 https://learn.microsoft.com/en-us/windows/wsl/wsl-config#configuration-settings-for-wslconfig

Monday, June 5, 2023

scp windows recursive copy problem

 In you encounter scp problem when doing a recursive copy from Windows to Linux, try adding the -O parameter.

scp -r -O sample-files/ target-server:/target-path/

Sunday, November 8, 2020

Using icacls.exe command to change the permission of a folder

Use following command to change the permission of a folder:

 C:\folder> icacls FOLDER_NAME /grant user_id:(OI)(CI)(F)


Reference: https://stackoverflow.com/questions/38725364/icacls-permissions-not-applying-as-i-expect


F - Full Access

OI - Inherit file

CI - Inherit sub-folder


Saturday, October 24, 2020

Ubuntu WiFi device disappear with dual boot Windows 10

 When your device is dual boot with Ubuntu and Windows 10, you'll got a chance to lose the WiFi device in Ubuntu.


To fix this issues, try to disable the "Fast Startup" feature in Windows 10.


It solves the problem for me, hope this work for you too.


Friday, August 7, 2020

SQL Developer installation in Windows 10

 Quick suggestion for getting the SQL Developer to work in Windows 10:

  1. Get the SQL Developer (with JRE) edition. I got bad experience when getting SQL Developer to work with my own JDK 1.8 installation in Windows 10. No matter where I copy the MSVCR100.DLL (It always said JAVA_HOME\jre\bin\msvcr100.dll cannot be launched, crazy). So, just get the "with JRE" version.

  2. The font size are crazily small on a high DPI screen. So get a larger font, right-click on the "sqldeveloper.exe", choose "Compatibility > Change high DPI settings > High DPI scaling override > System (Enhanced)"
    (Reference: https://christian-gohmann.de/2018/10/25/running-sql-developer-on-high-dpi-screens/)

Friday, July 24, 2020

Command line to stop Windows 10 updates

To stop Windows 10 updates:

> net stop wuauserv
> net stop bits
> net stop dosvc

Resume it:

> net start wuauserv
> net start bits
> net start dosvc

Sunday, May 10, 2020

OpenShot UI too large on screen in Windows

OpenShot UI could become very large in your Windows if you can set your screen scale to something like 150%.

To resolve this issues, you may adjust the "QT_AUTO_SCREEN_SCALE_FACTOR" value:

Add line SET QT_AUTO_SCREEN_SCALE_FACTOR=0 before launch.exe in the batch file "C:\Program Files\OpenShot Video Editor\launch-win.bat"

Reference: https://github.com/OpenShot/openshot-qt/issues/2443

If you are using the PortableApps's build, you can add the line "QT_AUTO_SCREEN_SCALE_FACTOR=0" under the "[Environment]" in file "OpenShotPortable.ini" in "\OpenShotPortable\App\AppInfo\Launcher"

Wednesday, February 5, 2020

Windows 10 Build 1909 search bar returns nothing but just a black page


The search bar just failed (no result but just a black screen) after Windows 10 Build 1909 update.

Sigh... Windows is still windows.

To solve it, disable the Bing search in Windows:
  1. regedit
  2. Go to "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Search"
  3. Add DWORD "BingSearchEnabled", value = 0
  4. Add DWORD "CortanaConsent", value = 0
  5. Restart





Monday, December 2, 2019

Windows equivalent of "wc -l" command in Linux

To count the number lines of files / stdout in Linux, we uses "wc -l" to achieve. In Windows, we use the following instead:
  • find /c /v ""

For example, suppose we have a file "sample_file.txt" and we want to know the number of lines of that file, we can perform the following:
  • type sample_file.txt | find /c /v ""



Wednesday, October 30, 2019

Export text based file list for the difference between 2 directories (Windows version)

The following is a tutorial for exporting a text-based file list showing the difference between 2 directories (e.g. D:\DirA, D:\DirB):

Step 1: Create a text-based file list for both directories

> cd D:\DirA
> dir /s /b /a:-d > file-list-dir-a.txt
> cd D:\DirB
> dir /s /b /a:-d > file-list-dir-b.txt

Step 2: Use WinMerge to get the difference between the 2 file lists:


Note: To display difference only, you need to set "View > Diff Context > 0 Lines".

Step 3: Copy the difference from WinMerge and create a text file to store it.



Thursday, February 8, 2018

Windows file explorer cached hostname specified in hosts file

The 'hosts' file in Windows allows user to add hostname to IP entries. When you modify the entries in hosts, the file explorer might not reflect the changes immediately. This is because the mapping is already cached in the Workstation service.

Consider the following situation, you may hosts file with the following entry:

192.168.1.100   my_nas

Then you can use \\my_nas\share in the file explorer to view content in \\192.168.1.100\share. Next, you try to modify the entry as following:

192.168.1.101   my_nas

While the command ping my_nas tells you my_nas is now 192.168.1.101, but the file explorer cached the entry, hence \\my_nas\share still points to the old IP (i.e. 192.168.1.100).

To clear this cache, apart from rebooting the machine, user can consider to restart the "Workstation" service instead.




Tuesday, May 16, 2017

Query windows patch via command line

To check if a windows patch (e.g. KB1234567) has been installed, run the following command line:

     C:> wmic qfe | find "1234567"


Wednesday, May 22, 2013

Executing PowerShell script

  1. Check your execution policy:
    PS> Get-ExecutionPolicy
  2. The execution policy is "Restricted" by default
  3. Change it to "Unrestricted"
    PS> Set-ExecutionPolicy Unrestricted
  4. Then you can run your script
    e.g. PS> .\scriptfile.ps1
Ref: http://ithelp.ithome.com.tw/question/10028377

Sunday, January 13, 2013

[Windows] System Update Readiness Tool

To avoid Windows crash during system update, consider using the System Update Readiness Tool before doing the actual update, more information at:

    http://windows.microsoft.com/en-US/windows7/What-is-the-System-Update-Readiness-Tool

Saturday, April 28, 2012

Small HTTP servers for Windows

Some mini size HTTP server software for Windows:
For nginx, if you want to add an alias which point to another location which is not under the root directory, you can put the following in the nginx.conf:

location /web {
    alias   d:/Code/nginx_web;
}
        
This means for locations http://yourhost/web, it is pointing to d:\Code\nginx_web actually.


So what about ProxyPass in nginx? I will try on it tomorrow. Keep update soon.

Thursday, March 8, 2012

Change Windows Update Server URL

Modify the Windows Registry to change the WSUS URL:

\HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\WUServer

Ref: http://technet.microsoft.com/en-us/library/cc708554(v=ws.10).aspx

Wednesday, February 1, 2012

HIde Account at Windows Login Screen


The following steps can hide user account in Windows login screen:

  1. Go to HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts\UserList\, if key not exists, create them.
  2. Add DWORD registry
  3. Set name = User account name (e.g. demouser)
  4. Set value = 0

Done.

Wednesday, January 25, 2012

Command line to get installed software / windows updates information

One can use wmic command to get the list of product installed in Windows:
 c:\> wmic product

You can also specify which data fields you want to retrieve, e.g.:
 c:\> wmic product get caption

We can also use wmic command to get the list of windows updates made on the machine:
 c:\> wmic qfe list

CSP on Apache

To add CSP to root if sort of funny. The following will NOT work for most cases !!     <LocationMatch "^/$">        Header s...