@ECHO OFF CLS SETLOCAL ENABLEDELAYEDEXPANSION SET /A RETRY_IMAP=0 SET /A MAX_RETRIES=3 SET EXCH_IMAP= MSExchangeImap4 REM To check current status of the service. :check_imap SC QUERY %EXCH_IMAP% | FIND "RUNNING" >NUL IF %ERRORLEVEL%==0 ( ECHO Exchange IMAP4 Service is Running. GOTO end ) REM To start the service if the status is stopped. ECHO Exchange IMAP4 Service is Stopped. SC START %EXCH_IMAP% TIMEOUT /T 10 >NUL REM To re-check the service status again for confirmation. SC QUERY %EXCH_IMAP% | FIND "RUNNING" >NUL IF %ERRORLEVEL%==0 ( ECHO Exchange IMAP4 Service is Running. GOTO end ) REM Retrying to start the service with a maximum of 3 retries only. SET /A RETRY_IMAP+=1 IF !RETRY_IMAP! LSS %MAX_RETRIES% ( ECHO Retrying Start %EXCH_IMAP% (Attemp: !RETRY_IMAP!). GOTO check_imap ) ELSE ( ECHO Max Retries Reached for %EXCH_IMAP%, will stop retrying. GOTO end ) :end EXIT |
Apr 15, 2025
Windows 10/11 : Batch File to Start and Check Windows Services
Nov 18, 2024
NextCloud Install in Ubuntu Server
sudo wget https://download.nextcloud.com/server/releases/latest.zip
|
sudo apt install libmagickcore-6.q16-6-extra php php-apcu php-bcmath php-cli php-common php-curl php-gd php-gmp php-imagick php-intl php-mbstring php-mysql php-zip php-xml -y |
sudo apt install mariadb-server -y |
sudo mysql_secure_installation |
CREATE DATABASE nextcloud; SHOW DATABASES; GRANT ALL PRIVILEGES ON nextcloud.* TO 'ncuser'@'localhost' IDENTIFIED BY 'ncpass'; FLUSH PRIVILEGES; QUIT; |
sudo phpenmod apcu bcmath gmp imagick intl |
sudo apt install unzip -y |
sudo unzip latest.zip |
sudo cp nextcloud demo.com |
sudo mv demo.com /var/www/ |
sudo chwon -R www-data:www-data /var/www/demo.com |
<VirtualHost *:80> ServerAdmin webmaster@local.com ServerName demo.com DocumentRoot /var/www/demo.com <Directory /var/www/demo.com> Options MultiViews FollowSymlinks AllowOverride All Order allow,deny Allow from all </Directory> ErrorLog /var/log/apache2/demo.com/error.log TransferLog /var/log/apache2/demo.com/access.log <IfModule mod_headers.c> Header always set Strict-Transport-Security "max-age=15552000; includeSubDomains" </IfModule> </VirtualHost> |
memory_limit = 512M upload_max_filesize = 512M max_execution_time = 360 post_max_size = 512M date.timezone = Asia/Kuala_Lumpur opcache.enable = 1 opcache.interned_strings_buffer = 16 opcache.max_accelerated_files = 10000 opcache.memory_consumption = 128 opcache.save_comments = 1 opcache.revalidate_freq = 1 |
sudo a2enmod dir env headers mime rewrite ssl |
sudo nano /etc/php/8.3/mods-available/apcu.ini |
apc.enable_cli = 1 |
sudo certbot --apache |
sudo chmod +x /var/www/demo.com/occ |
sudo /var/www/demo.com/occ db:add-missing-indices |
sudo chmod -x /var/www/demo.com/occ |
sudo chmod 660 /var/www/demo.com/config/config.php |
sudo chown root:www-data /var/www/demo.com/config/config.php |
sudo nano /var/www/demo.com/config/config.php |
'memcache.local' => '\OC\Memcache\APCu', 'default_phone_region' => 'MY', 'maintenance_window_start' => 1, 'filelocking.enabled' => true, 'memcache.locking' => '\OC\MemCache\APCu', |
sudo systemctl restart apache2 |
sudo crontab -u www-data -e |
00 * * * 1 php -f /var/www/demo.com/cron.php |
sudo rm -R /var/www/demo.com/core/skeleton/Templates |
sudo /var/www/demo.com/occ config:app:set workflowengine user_scope_disabled --value yes |
sudo apt install redis php-redis -y |
sudo systemctl enable redis |
sudo systemctl start redis |
sudo nano /var/www/demo.com/config/config.php |
'memcache.local' => '\OC\Memcache\Redis', 'memcache.locking' => '\OC\Memcache\Redis', 'redis' => array( 'host' => '/var/run/redis/redis.sock'. 'port' => 0, 'timemout' => 0.0, ), |
sudo nano /etc/redis/redis.conf |
unixsocket /var/run/redis/redis.sock unixsocketperm 660 |
sudo usermod -aG redis www-data |
sudo systemctl restart redis |
'memcache.distributed' => '\OC\Memcache\MemCached', |
sudo -u www-data truncate /var/www/demo.com/data/nextcloud.log --size=0 |
Aug 16, 2024
Windows : Microsoft Edge Browser with Script
Set Edge = CreateObject("WScript.Shell") Edge.Run "msedge.exe https://demo.com" |
Set Edge = CreateObject("WScript.Shell") Edge.Run "msedge.exe https://demo.com", 3, false |
Jul 18, 2024
Windows : DISM Error "0x800f081f"
Error: 0x800f081f The source files could not be found. Use the "Source" option to specify the location of the files that are required to restore the feature. For more information on specifying a source location, see http://go.microsoft.com/fwlink/?LinkId=243077. The DISM log file can be found at C:\Windows\Logs\DISM\dism.log |
sfc /scannow |
Beginning system scan. This process will take some time. Beginning verification phase of the system scan. Verification 100% complete. Windows Resource Protection found corrupt files but was unable to fix some of them. Details are included in the CBS.Log windir\Logs\CBS\CBS.log. For example C:\Windows\Logs\CBS\CBS.log. Note that logging is currently not supported in offline servicing scenarios. |
dism /online /cleanup-image /scanhealth |
Deployment Image Servicing and Management tool Version: 6.3.9600.19408 Image Version: 6.3.9600.19397 [==============================100.0%============================] Error: 0x800f081f The source files could not be found. Use the "Source" option to specify the location of the files that are required to restore the feature. For more information on specifying a source location, see http://go.microsoft.com/fwlink/?LinkId=243077. The DISM log file can be found at C:\Windows\Logs\DISM\dism.log |
dism /online /cleanup-image /restorehealth /source:D:\sources\install.wim /limitaccess |
dism /online /enable-feature /featurename:NetFX3 /All /Source:D:\sources\sxs /LimitAccess |
Windows 11 : Classic Context (Right-Click) Menu
Feb 21, 2024
Windows 10 : Create Recovery Partition
|
DISKPART>list disk DISKPART>select disk 0
|
DISKPART>list partition DISKPART>select partition 4 |
DISKPART>set id=27 |
DISKPART>set id=06d1-4d40-a16a-bfd50179d6ac DISKPART>gpt attributtes=0X8000000000000001 |
C:\>reagentc /enable |
C:\>reagentc /disable
|
C:\>diskpart
|
DISKPART>list disk DISKPART>select disk 0 |
DISKPART>list partition DISKPART>select partition 4 |
DISKPART>delete partition override |
DISKPART>select partition 4 |
DISKPART>set id=27 |
DISKPART>set id=06d1-4d40-a16a-bfd50179d6ac DISKPART>gpt attributtes=0X8000000000000001 |
C:\>reagentc /enable |
Nov 8, 2023
Batch : Rename Hostname via Batch File
:asktorename REM To ask whether to Rename the Hostname or not. ECHO. ECHO. ECHO. ECHO ╔═════════════════════════════════════════╗ ECHO ║ RENAMING THE HOSTNAME ║ ECHO ╚═════════════════════════════════════════╝ ECHO. CHOICE /M "──────────────► DO YOU WANT TO RENAME THE HOSTNAME " IF ERRORLEVEL 2 GOTO eof IF ERRORLEVEL 1 GOTO askforname GOTO eof REM -------------------------------------------------------------------------------------- :askforname REM To ask User for the preferred hostname. ECHO. ECHO. SET /P NEWNAME="PLEASE TYPE THE NEW HOSTNAME: " ECHO. ECHO " ► ► ► THE NEW HOSTNAME IS ───► %NEWNAME%" CHOICE /M " ► ► ► IS THIS CORRECT " IF ERRORLEVEL 2 GOTO asktorename IF ERRORLEVEL 1 GOTO dorenhost GOTO eof REM -------------------------------------------------------------------------------------- :dorenhost REM To proceed Rename the Hostname as per Input by User. ECHO. ECHO " ► ► ► OK, RENAMING HOSTNAME → %NEWNAME%, PLEASE WAIT..." WMIC COMPUTERSYSTEM where name="%COMPUTERNAME%" CALL RENAME name="%NEWNAME%" TIMEOUT /t 3 /NOBREAK ECHO. ECHO " ► ► ► RENAMING HOSTNAME COMPLETE" ECHO. ECHO "THE NEW HOSTNAME WILL TAKE EFFECT AFTER COMPUTER RESTART" TIMEOUT /t 5 /NOBREAK GOTO eof REM -------------------------------------------------------------------------------------- :eof START SHUTDOWN /r /f /t 10 COLOR >NUL CHCP 437 EXIT /b |
Sep 15, 2023
Windows 11 : Built-In Apps that can be Remove
Write-Host Write-Host "**************************" Write-Host "* Removing Appx Packages *" Write-Host "**************************" Write-Host Write-Host "Removing Zune Video..." Get-AppxPackage -AllUsers *ZuneVideo* | Remove-AppxPackage Start-Sleep -s 5 Write-Host "Removing Zune Music..." Get-AppxPackage -AllUsers *ZuneMusic* | Remove-AppxPackage Start-Sleep -s 5 Write-Host "Removing Microsoft Your Phone..." Get-AppxPackage -AllUsers *YourPhone* | Remove-AppxPackage Start-Sleep -s 5 Write-Host "Removing Xbox Speech..." Get-AppxPackage -AllUsers *XboxSpeech* | Remove-AppxPackage Start-Sleep -s 5 Write-Host "Removing Xbox Identity..." Get-AppxPackage -AllUsers *XboxIdentity* | Remove-AppxPackage Start-Sleep -s 5 Write-Host "Removing Xbox Gaming Overlay..." Get-AppxPackage -AllUsers *XboxGamingOverlay* | Remove-AppxPackage Start-Sleep -s 5 Write-Host "Removing Xbox Game Overlay..." Get-AppxPackage -AllUsers *XboxGameOverlay* | Remove-AppxPackage Start-Sleep -s 5 Write-Host "Removing Xbox App..." Get-AppxPackage -AllUsers *XboxApp* | Remove-AppxPackage Start-Sleep -s 5 Write-Host "Removing Xbox TCUI..." Get-AppxPackage -AllUsers *Xbox.TCUI* | Remove-AppxPackage Start-Sleep -s 5 Write-Host "Removing Windows Maps..." Get-AppxPackage -AllUsers *WindowsMaps* | Remove-AppxPackage Start-Sleep -s 5 Write-Host "Removing Windows Feedback Hub..." Get-AppxPackage -AllUsers *WindowsFeedbackHub* | Remove-AppxPackage Start-Sleep -s 5 Write-Host "Removing Windows Communications Apps..." Get-AppxPackage -AllUsers *windowscommunicationsapps* | Remove-AppxPackage Start-Sleep -s 5 Write-Host "Removing Windows Alarms..." Get-AppxPackage -AllUsers *WindowsAlarms* | Remove-AppxPackage Start-Sleep -s 5 Write-Host "Removing Microsoft People..." Get-AppxPackage -AllUsers *Microsoft.People* | Remove-AppxPackage Start-Sleep -s 5 Write-Host "Removing Solitaire Collection..." Get-AppxPackage -AllUsers *MicrosoftSolitaireCollection* | Remove-AppxPackage Start-Sleep -s 5 Write-Host "Removing Office Hub..." Get-AppxPackage -AllUsers *MicrosoftOfficeHub* | Remove-AppxPackage Start-Sleep -s 5 Write-Host "Removing Windows Get Started..." Get-AppxPackage -AllUsers *GetStarted* | Remove-AppxPackage Start-Sleep -s 5 Write-Host "Removing Windows Get Help..." Get-AppxPackage -AllUsers *GetHelp* | Remove-AppxPackage Start-Sleep -s 5 Write-Host "Removing Bing Weather..." Get-AppxPackage -AllUsers *BingWeather* | Remove-AppxPackage Start-Sleep -s 5 Write-Host "Removing Microsoft Gaming App..." Get-AppxPackage -AllUsers *GamingApp* | Remove-AppxPackage Start-Sleep -s 5 Write-Host "Removing Microsoft Bing News..." Get-AppxPackage -AllUsers *BingNews* | Remove-AppxPackage Start-Sleep -s 5 Write-Host "Removing Microsoft Teams App..." Get-AppxPackage -AllUsers *MicrosoftTeams* | Remove-AppxPackage Start-Sleep -s 5 Write-Host "Removing Microsoft To Dos App..." Get-AppxPackage -AllUsers *Microsoft.Todos* | Remove-AppxPackage Start-Sleep -s 5 Write-Host "Removing Microsoft Power Automate Desktop App..." Get-AppxPackage -AllUsers *Microsoft.PowerAutomateDesktop* | Remove-AppxPackage Start-Sleep -s 5 Write-Host "Removing Microsoft ClipChamp App..." Get-AppxPackage -AllUsers *Clipchamp* | Remove-AppxPackage Start-Sleep -s 5 Write-Host "Removing Microsoft Windows Terminal App..." Get-AppxPackage -AllUsers *WindowsTerminal* | Remove-AppxPackage Start-Sleep -s 5 Write-Host Write-Host "Uninstallation of AppxPackages Completed." Start-Sleep -s 5 Write-Host Write-Host Write-Host "**************************************" Write-Host "* Removing Appx Provisioned Packages *" Write-Host "**************************************" Write-Host Start-Sleep -s 5 Write-Host "Removing AppxProvisioned Zune Video..." Remove-AppxProvisionedPackage -Online -PackageName Microsoft.ZuneVideo_2019.22091.10041.0_neutral_~_8wekyb3d8bbwe Start-Sleep -s 5 Write-Host "Removing AppxProvisioned Zune Music..." Remove-AppxProvisionedPackage -Online -PackageName Microsoft.ZuneMusic_11.2305.4.0_neutral_~_8wekyb3d8bbwe Start-Sleep -s 5 Write-Host "Removing AppxProvisioned Microsoft Your Phone..." Remove-AppxProvisionedPackage -Online -PackageName Microsoft.YourPhone_1.22022.147.0_neutral_~_8wekyb3d8bbwe Start-Sleep -s 5 Write-Host "Removing AppxProvisioned Xbox Speech..." Remove-AppxProvisionedPackage -Online -PackageName Microsoft.XboxSpeechToTextOverlay_1.17.29001.0_neutral_~_8wekyb3d8bbwe Start-Sleep -s 5 Write-Host "Removing AppxProvisioned Xbox Identity..." Remove-AppxProvisionedPackage -Online -PackageName Microsoft.XboxIdentityProvider_12.50.6001.0_neutral_~_8wekyb3d8bbwe Start-Sleep -s 5 Write-Host "Removing AppxProvisioned Xbox Gaming Overlay..." Remove-AppxProvisionedPackage -Online -PackageName Microsoft.XboxGamingOverlay_2.622.3232.0_neutral_~_8wekyb3d8bbwe Start-Sleep -s 5 Write-Host "Removing AppxProvisioned Xbox Game Overlay..." Remove-AppxProvisionedPackage -Online -PackageName Microsoft.XboxGameOverlay_1.47.2385.0_neutral_~_8wekyb3d8bbwe Start-Sleep -s 5 Write-Host "Removing AppxProvisioned Xbox TCUI..." Remove-AppxProvisionedPackage -Online -PackageName Microsoft.Xbox.TCUI_1.23.28004.0_neutral_~_8wekyb3d8bbwe Start-Sleep -s 5 Write-Host "Removing AppxProvisioned Windows Maps..." Remove-AppxProvisionedPackage -Online -PackageName Microsoft.WindowsMaps_2022.2202.6.0_neutral_~_8wekyb3d8bbwe Start-Sleep -s 5 Write-Host "Removing AppxProvisioned Windows Feedback Hub..." Remove-AppxProvisionedPackage -Online -PackageName Microsoft.WindowsFeedbackHub_2022.106.2230.0_neutral_~_8wekyb3d8bbwe Start-Sleep -s 5 Write-Host "Removing AppxProvisioned Windows Communications Apps..." Remove-AppxProvisionedPackage -Online -PackageName microsoft.windowscommunicationsapps_16005.14326.20544.0_neutral_~_8wekyb3d8bbwe Start-Sleep -s 5 Write-Host "Removing AppxProvisioned Windows Alarms..." Remove-AppxProvisionedPackage -Online -PackageName Microsoft.WindowsAlarms_2022.2202.24.0_neutral_~_8wekyb3d8bbwe Start-Sleep -s 5 Write-Host "Removing AppxProvisioned Microsoft People..." Remove-AppxProvisionedPackage -Online -PackageName Microsoft.People_2020.901.1724.0_neutral_~_8wekyb3d8bbwe Start-Sleep -s 5 Write-Host "Removing AppxProvisioned Solitaire Collection..." Remove-AppxProvisionedPackage -Online -PackageName Microsoft.MicrosoftSolitaireCollection_4.12.3171.0_neutral_~_8wekyb3d8bbwe Start-Sleep -s 5 Write-Host "Removing AppxProvisioned Office Hub..." Remove-AppxProvisionedPackage -Online -PackageName Microsoft.MicrosoftOfficeHub_18.2204.1141.0_neutral_~_8wekyb3d8bbwe Start-Sleep -s 5 Write-Host "Removing AppxProvisioned Windows Get Started..." Remove-AppxProvisionedPackage -Online -PackageName Microsoft.Getstarted_2021.2204.1.0_neutral_~_8wekyb3d8bbwe Start-Sleep -s 5 Write-Host "Removing AppxProvisioned Windows Get Help..." Remove-AppxProvisionedPackage -Online -PackageName Microsoft.GetHelp_10.2201.421.0_neutral_~_8wekyb3d8bbwe Start-Sleep -s 5 Write-Host "Removing AppxProvisioned Bing Weather..." Remove-AppxProvisionedPackage -Online -PackageName Microsoft.BingWeather_4.53.33420.0_neutral_~_8wekyb3d8bbwe Start-Sleep -s 5 Write-Host "Removing AppxProvisioned Microsoft Gaming App..." Remove-AppxProvisionedPackage -Online -PackageName Microsoft.GamingApp_2021.427.138.0_neutral_~_8wekyb3d8bbwe Start-Sleep -s 5 Write-Host "Removing AppxProvisioned Microsoft Bing News..." Remove-AppxProvisionedPackage -Online -PackageName Microsoft.BingNews_4.2.27001.0_neutral_~_8wekyb3d8bbwe Start-Sleep -s 5 Write-Host "Removing AppxProvisioned Microsoft Teams..." Remove-AppxProvisionedPackage -Online -PackageName MicrosoftTeams_23231.411.2342.9597_x64__8wekyb3d8bbwe Start-Sleep -s 5 Write-Host "Removing AppxProvisioned Microsoft Power Automate Desktop App..." Remove-AppxProvisionedPackage -Online -PackageName Microsoft.PowerAutomateDesktop_10.0.3735.0_neutral_~_8wekyb3d8bbwe Start-Sleep -s 5 Write-Host "Removing AppxProvisioned Microsoft ClipChamp App..." Remove-AppxProvisionedPackage -Online -PackageName Clipchamp.Clipchamp_2.2.8.0_neutral_~_yxz26nhyzhsrt Start-Sleep -s 5 Write-Host "Removing AppxProvisioned Microsoft To Dos App..." Remove-AppxProvisionedPackage -Online -PackageName Microsoft.Todos_2.54.42772.0_neutral_~_8wekyb3d8bbwe Start-Sleep -s 5 Write-Host "Removing AppxProvisioned Microsoft Windows Terminal App..." Remove-AppxProvisionedPackage -Online -PackageName Microsoft.WindowsTerminal_3001.12.10983.0_neutral_~_8wekyb3d8bbwe Start-Sleep -s 5 Write-Host Write-Host Write-Host "*******************************************************" Write-Host "* Uninstallation of AppxProvisionedPackage Completed. *" Write-Host "*******************************************************" Start-Sleep -s 5 EXIT |
Sep 9, 2023
VMWare : VMWare Tools for Windows XP 32-bit
Sep 5, 2023
Windows : Get Operating System Info in Command Prompt
wmic os get OSArchitecture |
wmic os get Caption /value |
wmic path softwareLicensingService get OA3xOriginalProductKey |
Aug 30, 2023
Windows Terminal : Always Run as Administrator
Aug 11, 2023
Windows 10 : Delete Recovery Partition
NOTE : IT IS RECOMMENDED NOT TO DELETE THIS PARTITION ! DOING SO, YOU WILL NOT HAVE ANY LAST RESORTS IN THE EVENT OF OS ISSUES. |
May 26, 2023
Windows : Fix Windows 7 Update Error 80072EFE
Fix Windows 7 Update Error 80072EFE.
- Windows 7 64-bit --> Windows6.1-KB3138612-x64.msu
- Windows 7 32-bit --> Windows6.1-KB3138612-x86.msu
May 17, 2023
Multi-Boot USB : Ventoy (Open Source)
Ventoy is an open source tool to create bootable USB drive for ISO/WIM/IMG/VHD(x)/EFI files.
With Ventoy, you don't need to format the disk over and over, you just need to copy the ISO/WIM/IMG/VHD(x)/EFI files to the USB drive and boot them directly.
You can copy many files at a time and Ventoy will give you a boot menu to select them. You can also browse ISO/WIM/IMG/VHD(x)/EFI files in local disks and boot them.
Supports x86 Legacy BIOS, IA32 UEFI, x86_64 UEFI, ARM64 UEFI and MIPS64EL UEFI. Most types of OS supported (Windows/WinPE/Linux/ChromeOS/Unix/VMware/Xen etc.)
Official Ventoy Website : https://www.ventoy.net/en/index.html
!!! HAPPY COMPUTING !!!
May 10, 2023
Windows Server : Install & Configure WSUS (Windows Server Update Services)
Windows Server : Install & Configure WSUS (Windows Server Update Services).
WSUS is available freely and is part of Windows Server OS (any edition).
Pre-Requisites :
- Microsoft Report Viewer 2008 Redistributable (https://www.microsoft.com/en-us/download/details.aspx?id=3203).
- Open --> Server Manager
- Click --> Add roles and features
- Scroll down and Select --> Windows Server Update Services
- When Prompted, Click --> Add Features
- Continue to Click --> Next
- Ensure the following is selected --> WID Database & WSUS Services
- Specify WSUS Storage Location (eg. D:\WSUS_Store), ensure sufficient storage spaces is available to store all downloaded updates.
- Continue to Click --> Next
- Until final Click --> Install
- Wait until the Installation Wizard complete.
- Open --> Windows Server Update Services (available inside "Administrative Tools").
- When prompted, ensure the storage location is correct (eg. D:\WSUS_Store), it may a while so please wait until it finishes.
- When completed, Click --> Close
- Optional to join Microsoft Update Improvement Program, Click --> Next
- If this is the first / Primary WSUS, then select --> Synchronize from Microsoft Update
- Proceed to configure "Proxy Server" settings (if any).
- Next is to connect to Microsoft Update server, Click --> Start Connecting
- Once completed, select the language (eg. English) and Click --> Next
- Select the products you want to download the updates for (eg. Windows 10).
- Next is to select the "Classifications" you want, such as Critical Updates, Security Updates etc.
- Configure the synchronization schedules as required.
- Select --> Begin initial synchronization
- Wait until complete.
Apr 21, 2023
Windows Server : Google Chrome Policy for Active Directory GPO
- Download Google Chrome Policy.
- Extract the download file and search for "windows" folder.
- Copy --> "chrome.admx & google.admx" files to Windows Server or to external storage.
- Copy also --> "en-US\chrome.adml & google.adml" files.
- Copy *.admx files to Windows Server "central store" located at --> %serverlogon%\sysvol\[domain name]\Policies\PolicyDefinitions
- Copy *.adml files to --> %serverlogon%\sysvol\[domain name]\Policies\PolicyDefinitions\en-US
- Now open --> Group Policy Management
- Verify "Google" policy is available for configurations.