Monday, May 16, 2022

Ubuntu on Dell Laptop

I was having problem with Ubuntu installed on my Dell Lattitude laptop. It was freezing randomly and unusable. Found a way to make it stable. Edit GRUB Kernel parameter and add this line: intel_idle.max_cstate=1 i915.enable_dc=0

Monday, April 25, 2022

Passed MS-100

Today, I passed MS-100 exam. Next is MS-101.

Friday, March 18, 2022

Certified Secure Software Lifecycle Professional (CSSLP)

 I have passed the exam and endorsement process and officially CSSLP certified now!


Monday, December 06, 2021

Wednesday, September 22, 2021

Execute PowerShell in Windows Scheduled Task

 There are many ways to execute PowerShell in Windows scheduled tasks:

Option #1

Program/Script: PowerShell.exe

Add arguments (optional): -command "& {& 'C:\path\to\script.ps1'}"

Start in (optional): C:\path\to\

Option #2

Program/Script: PowerShell.exe

Add arguments (optional): -NonInteractive -Noprofile -File "C:\path\to\script.ps1"

Start in (optional): C:\path\to\

Option #1 allows me to have the script to connect to the Internet (server is located behind corporate proxy). 

Sunday, June 27, 2021

Passed AZ-303

 It is official! after passing AZ-303 today, I am now a Microsoft Certified Azure Solutions Architect Expert.




Sunday, May 30, 2021

Passed AZ-304

 Today, I passed AZ-304 exam ! 

One more to go to get Azure Solution Architect Expert

http://aka.ms/AzureCerts_SolutionsArchitect

Monday, April 19, 2021

Microsoft Azure Administrator Associate

 Passed AZ-104 exam today!! 

I am now officially Microsoft Azure Administrator Associate certified!! 



Friday, June 12, 2020

Hyper-V Nested VM

To allow your VM to run Hyper-V role, you need to expose the virtualization extension to the Hyper-V host by running the following PowerShell command:

> Set-VMProcessor -VMname MyVM -ExposeVirtualizationExtensions $true

Friday, May 15, 2020

My QNAP TS-412 had a major issue, 2 of the RAID5 disks decided to fail at the same time. Luckily QNAP was still up and running and allow READ-ONLY access to my data. However, all the iSCSI LUNs are not accessible anymore from my iSCSI clients.

Found the attached document which basically helped me recover my iSCSI LUNs. I copied by iSCSI LUN files to the backup locations and rebuild by NAS volumes. I then follow the procedure #3 in the document to get my iSCSI LUNs back.





















Wednesday, April 15, 2020

Ubuntu DNS Stub Listener #Disable

During setting up PiHole, it requires to listen on DNS (53/TCP, 53/UDP) on the host. Ubuntu version that I am running on (20.04) by default listens on port 53 because it runs as DNS Stub Listener.

PiHole will give errors about Binding error

To disable Ubuntu running as DNS Stub Listener, do the followings:

> sudo vi /etc/systemd/resolved.conf 

un-comment #DNSStubListener=yes 
change it to DNSStubListener=no

> sudo service systemd-resolved restart
> sudo systemctl disable systemd-resolved.service
> sudo systemctl stop systemd-resolved
> sudo mv /etc/resolv.conf /etc/resolv.conf.old
> sudo shutdown -h now -r

Monday, March 02, 2020

Wednesday, January 08, 2020

PowerShell and Excel

I wrote a PowerShell script to start MS Excel process and manipulate an Excel file. This PS works perfectly fine when it is executed interactively by a user account. However when using Windows task scheduler, it throws the following errors:

Microsoft Excel cannot access the file
There are several possible reasons:
The file name or path does not exist.
The file is being used by another program.
The workbook you are trying to save has the same name as a currently open workbook.

In turns out, I need to create a directory named: Desktop
In the following locations:

64-Bit OS
C:\Windows\SysWOW64\config\systemprofile\Desktop

32-Bit OS
C:\Windows\System32\config\systemprofile\Desktop

Tuesday, December 31, 2019

QBE CIO Award 2019


All the hard work is paid for ... QBE Cyber Security team has been recognized for exceptional performance!! 

Friday, November 22, 2019

Tail in PowerShell

 I need to "tail" in PowerShell to view the log and found the following command interesting:

> Get-Content C:\mylog.txt -Wait

If you want to get the latest file and tail it:

> Get-Content ( Get-ChildItem C:\Folder\ | Sort-Object LastWriteTime | Select-Object -Last 1) -Wait

Thursday, September 12, 2019

Active Directory Group Policy by Powershell

 Use the following Powershell to get all the GPO dumped to HTML files

#> Get-GPO -All -Domain mydomain.tld | % { Get-GPOReport -Guid $_.Id -ReportType Html -Domain mydomain.tld | Set-Content C:\Reports\$($_.DisplayName).html }