Monday, July 30, 2018

Convert multiple text files to UTF encoding

If you have multiple files and want to convert them all into UTF (without BOM), you can try this PowerShell script.

Get-ChildItem . -recurse -File -filter *.txt* | % {
        $MyFile = Get-Content -Raw $_.Fullname
        $MyPath = $_.Fullname
        [System.IO.File]::WriteAllLines($MyPath, $MyFile, [System.Text.UTF8Encoding]($False))
}
[System.IO.File]::WriteAllLines is used instead of the more commonly used Out-File because the latter outputs UTF8-BOM instead of plain UTF.

Monday, May 21, 2018

What's my Dell Service Tag

Recently come across this command which allow me to get the service tag for my Dell machine without crawling under my desk.

The command is

wmic bios get serialnumber

http://www.dell.com/support/article/uk/en/ukbsdt1/sln268357/how-to-locate-system-service-tag-using-command-prompt?lang=en

I have tried it on other brands too.  As it seems, it works for Acer machines too.

Tuesday, May 15, 2018

SMB3

I have issues to browse Windows Shares on my network ever since Windows retired SMB1.  Today I came across this post and its solution fixes my problem.

To make Windows shares browsable again, I added this line to /etc/samba/smb.conf

client max protocol = SMB3
This line should be put right after the line

workgroup = WORKGROUP
 Now I can browse and open share folders on my Windows machines in the network as it used to be.

Saturday, February 17, 2018

Reset Windows Updates

Windows update can mess up sometimes.  Even there is an option in Windows 10 for attempting to fix this issue, in my experience it isn't as good as old solutions found on TechNet.

Anyway, if you have similar Windows Update issue like myself, you may want to use the script found on this TechNet article at:

https://gallery.technet.microsoft.com/scriptcenter/Reset-Windows-Update-Agent-d824badc