AWS doesn’t natively support shrinking an EBS volume — especially not a root volume. But with a little low-level Linux work and some patience, I successfully reduced a 200GB root volume down to just 20GB on a live EC2 instance.
Here’s the complete step-by-step process I followed, in case you ever need to do the same.
The Situation
– OS: Ubuntu on EC2 – Root volume: 200GB (over-allocated) – Goal: Shrink to 20GB without rebuilding the system from scratch – Challenge: AWS doesn’t allow shrinking EBS volumes directly
The Solution: Copy and Boot from a New, Smaller Volume
Attach a New Blank Volume
Create a 20GB EBS volume and attach it to the instance (default naming will usually be /dev/nvme1n1).
Identify the New Device
Run: lsblk
Confirm the new volume appears as /dev/nvme1n1 and has no partitions.
Then run: update-grub update-initramfs -c -k all grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=ubuntu --recheck --no-floppy
Exit and Unmount Everything
exit for dir in run dev sys proc; do sudo umount /mnt/newroot/$dir; done sudo umount /mnt/newroot/boot/efi sudo umount /mnt/newroot/boot sudo umount /mnt/newroot
Swap the Volumes
Stop the instance Detach the old 200GB volume Detach the 20GB volume Reattach the 20GB volume as /dev/nvme0n1
Boot and Verify
After starting the instance: lsblk df -h / cat /etc/fstab
Ensure / is mounted from nvme0n1p3 and fstab UUIDs match.
Clean Up and Celebrate
Delete the old volume to reduce cost Optionally create an AMI of the new setup
When managing Office 365, especially during domain migrations or hybrid setups, it’s critical to ensure every user has a corresponding @onmicrosoft.com alias. This alias helps avoid delivery issues and supports fallback routing if needed.
Today, we’ll walk through how to check if users are missing the @onmicrosoft.com alias — and automatically add it if needed.
Let’s dive in.
What This Script Will Do:
Pull all mailboxes from Microsoft 365.
Check if their primary email is from your main domain (e.g., yourdomain.com).
If so, make sure they also have a yourdomain.onmicrosoft.com alias.
If missing, add the alias automatically.
Log everything into a clean, auditable table.
# Connect to Exchange Online
Connect-ExchangeOnline -UserPrincipalName youradmin@yourdomain.com
# Define your domains
$primaryDomain = "yourdomain.com"
$onMicrosoftDomain = "yourdomain.onmicrosoft.com"
# Initialize a results array
$results = @()
# Get all mailboxes
$users = Get-Mailbox -ResultSize Unlimited
foreach ($user in $users) {
$userPrincipalName = $user.UserPrincipalName
# Only process users whose primary address is @yourdomain.com
if ($userPrimaryAddress = $user.EmailAddresses | Where-Object { $_ -cmatch "^SMTP:.*@$primaryDomain$" }) {
# Extract the local part (before the @)
$localPart = ($userPrimaryAddress -replace "SMTP:", "").Split("@")[0]
$expectedAlias = "$localPart@$onMicrosoftDomain"
# Check if alias already exists
$hasAlias = $user.EmailAddresses | Where-Object { $_ -match [regex]::Escape($expectedAlias) }
if (-not $hasAlias) {
Write-Host "Adding alias $expectedAlias to $userPrincipalName" -ForegroundColor Yellow
# Add the missing alias
Set-Mailbox $user.Identity -EmailAddresses @{add="smtp:$expectedAlias"}
$results += [PSCustomObject]@{
UserPrincipalName = $userPrincipalName
PrimaryEmail = $userPrimaryAddress
AddedAlias = $expectedAlias
Action = "Alias Added"
}
}
else {
$results += [PSCustomObject]@{
UserPrincipalName = $userPrincipalName
PrimaryEmail = $userPrimaryAddress
AddedAlias = $expectedAlias
Action = "Alias Already Exists"
}
}
}
else {
$results += [PSCustomObject]@{
UserPrincipalName = $userPrincipalName
PrimaryEmail = "N/A"
AddedAlias = "N/A"
Action = "Skipped (Not $primaryDomain)"
}
}
}
# Display the results
$results | Format-Table -AutoSize
# Optional: Export results to CSV for auditing
$timestamp = Get-Date -Format "yyyyMMdd-HHmmss"
$results | Export-Csv -Path "AliasUpdateReport_$timestamp.csv" -NoTypeInformation
Script Summary
Step
Action
1
Connects to Exchange Online.
2
Filters users with a primary @yourdomain.com address.
3
Checks if their @yourdomain.onmicrosoft.com alias already exists.
4
Adds the alias if missing.
5
Logs everything to the screen and to a CSV file.
Pro Tips
Always test first: Run the script with the Set-Mailbox line commented out if you want a dry run.
This script only adds aliases — it never modifies the user’s primary email or login.
The CSV file gives you a full audit trail you can save for compliance purposes.
Safety Features
✅ Only users in your @yourdomain.com are affected. ✅ Existing aliases are never duplicated. ✅ No disruption to user mail flow.
Conclusion
This approach ensures every user has a matching @onmicrosoft.com alias, keeping your environment clean, compliant, and ready for future migrations or backup routing needs.
If you’re managing a hybrid environment, tenant migration, or simply cleaning up your domain setup, this script will save you hours of manual work.
Preheat your oven to 350°F (175°C). Line a baking sheet with parchment paper.
In a large mixing bowl, cream the butter until soft and smooth. Add the brown sugar and mix until well combined.
Beat the egg well and mix it into the butter-sugar mixture. Stir in the sweet cider until incorporated.
In a separate bowl, sift together the flour, cinnamon, allspice, nutmeg, cloves, salt, and baking soda.
Gradually add the dry ingredients to the wet mixture, 1/3 at a time, mixing well after each addition. Cover the dough with plastic wrap and refrigerate for at least 1 hour (or up to 2-3 days for enhanced flavor).
Remove half of the dough from the refrigerator. On a lightly floured surface, roll out the dough to your desired thickness and cut it into shapes using cookie cutters.
Place the cookies on the prepared baking sheet, leaving about 2 inches (5 cm) between them.
Bake in the preheated oven for 12-15 minutes, or until the edges are golden.
Transfer the cookies to a wire rack to cool completely. Repeat the process with the remaining dough.
Swap memory is a location on hard disk to be used as Memory by the operating system. When the operating systems detects that main memory is low and required more RAM to run applications properly it check for swap space and transfer files there. In general terms, swap is a part of the hard disk used as RAM on the system.
This tutorial will help you to Add Swap on Debian 11/12 Linux system.
How to Create Swap in Debian 11
Use the below steps to create and enable Swap memory on your Debian 11 system via command line.
Check that no Swap memory is enabled on your system. You can see the swap memory details by running the following commands.
sudo swapon -s
free -m
Check Available Swap Memory
Now, create a file to use as swap in your system system. Make sure you have enough free disk available to create new file. Also keep the swap just up to 2x of the memory on your system. My Debian system have 2GB of main memory. So we will create a swapfile of 4GB in size.
sudo fallocate -l 4G /swapfilechmod 600 /swapfile
Now use the mkswap command to convert file to use for swap memory.
sudo mkswap /swapfile
Then activate the swap memory on your system.
sudo swapon /swapfile
You have successfully added swap memory to your system. Execute one of the below commands to view current active swap memory on your system:
sudo swapon -s
free -m
Swap is Added to your System
Make Swap Permanent
After running above commands, Swap memory is added to your system and operating system can use when required. But after reboot of system swap will deactivate again.
You can make it permanent by appending the following entry in /etc/fstab file. Edit fstab file in editor:
vim /etc/fstab
and add below entry to end of file:
/swapfile none swap sw 0 0
Save file and close. Now Swap memory will remain activate after system reboots.
Configure Swappiness
Now change the swappiness kernel parameter as per your requirement. It tells the system how often system utilize this swap area.
Edit /etc/sysctl.conf file:
sudo vim /etc/sysctl.conf
append following configuration to end of file
vm.swappiness=10
Now reload the sysctl configuration file
sudo sysctl -p
Conclusion
Now the operating system can use swap memory in case of low physical memory. In this tutorial, you have learned to create and enable Swap memory on Debian 11/12 Linux system.
Download MacOS Unlocker for VMware Workstation Download
Install VMware Workstation Player, accepting the defaults
Extract the downloaded MacOS Unlocker for VMware Workstation
Inside the extracted file, right click Unlocker.exe > Run as administrator
Click the Patch button
Wait for patching to complete before continuing
Creating the Sonoma VM
Launch VMware Workstation Player
Click Continue to use Workstation Player for free for non-commercial use
Click Finish
Click Create a New Virtual Machine on the right side of the application
Select Installer disc image file (iso) > Browse to and select the downloaded MacOS Sonoma .iso > Click Next
Select Apple Mac OS X and macOS 13 > Click Next
Name the VM MacOS14 and set the path to store the VM files > Click Next
Adjust the disk size if necessary > Click Next
Click Finish
Open File Explorer and navigate to the VM files
Edit the .vmx file in a text editor
Search for board-id.reflectHost and set the value to “FALSE” board-id.reflectHost = "FALSE"
Search for ethernet0.virtualDev and set the value to “vmxnet3” ethernet0.virtualDev = "vmxnet3"
Then paste the following options at the bottom of the file board-id = “Mac-AA95B1DDAB278B95” hw.model.reflectHost = “FALSE” hw.model = “MacBookPro19,1” serialNumber.reflectHost = “FALSE” serialNumber = “C01234567890”
Right click on the MacOS14 VM > Power On
Installing MacOS Sonoma
After an initialization sequence the MAC OS Setup should start
Select a Language > Click the next arrow
Select Disk Utility
Select the VMware Virtual SATA Hard Drive Media > Click Erase
Name the drive MacOS > Set the Format to APFS > Click Erase
Click Done > Close Disk Utility
Click Install macOS
Click Continue > Click Agree > Click Agree again
Select the MacOS disk > Click Install
Wait while Mac OS installs files, the VM will reboot several times
Select your Country or Region > Click Continue
Confirm your languages and keyboard layout > Click Continue
Click Not Now on the Accessibility screen
Click Continue on the Data & Privacy screen
Select Not Now on the Migration Assistant screen
Select Set Up Later and then Skip on the Apple ID screen
Click Agree > Agree again
Enter a name, user name, password > Click Continue
Click Continue > Select Use or Don’t Use for Location Services
Pick a timezone > Click Continue
Uncheck Share Mac Analytics with Apple > Click Continue
Click Set Up Later on the Screen Time screen
Pick a theme > Click Continue
Welcome to MacOS 14 Sonoma
Install VMware Tools (optional, but recommended)
Right click the Install MacOS disc on the desktop > Eject
On the VMware toolbar click Player > Removable Devices > CD/DVD > Settings
Click Browse next to ISO Image File > Browse to the extracted Unlocker files tools > Select darwin.iso
Click the Connected checkbox
Click OK
Inside the VM, double click the mounted VMware tools and run the installer
When prompted, go into the Security settings and scroll to the bottom > Click Allow next to VMware > Reboot
After rebooting double click the mounted VMware tools and run the installer again
After the install succeeds, reboot again
Original article taken from: https://i12bretro.github.io/tutorials/0602.html
You can use the SFC (System File Checker) and DISM (Deployment Image Servicing and Management) commands to check and repair the integrity of system files and Component Store of your Windows (Windows Server) image. These tools can be extremely useful if your Windows is unstable, won’t boot, errors appear when you try to run built-in apps or services, after a virus infection, etc.
In this article, we’ll take a look at how to use the SFC /ScanNow, DISM /Online /Cleanup-Image /RestoreHealth, or Repair-WindowsImage -Online -RestoreHealth commands to repair image and system files on Windows 10/11 and Windows Server 2022/2019/2016.
SFC /ScanNow: Using System File Checker to Repair Windows System Files
It is recommended to use the DISM command to restore Windows after you have checked the integrity of your system files using the SFC tool. The sfc /scannow command scans protected system files and if they are missing or corrupted it tries to restore their original copies versions the Windows Component Store (C:\Windows\WinSxS folder).
The SFC tools writes all its activities to the %windir%\logs\cbs\cbs.log . All SFC entries in the CBS.log file are tagged with [SR]. To select only SFC-related entries from the log, run the command:
If sfc /scannow command returns the error “Windows Resource Protection found corrupt files but was unable to fix some of them“, it is likely that the tool could not get the necessary files from the Windows Component Store (see the image below).
In this case, you can try to repair the Component Store of your Windows image using the DISM.exe command.
The DISM (Deployment Image Servicing and Management) tool is available in all versions of Windows starting from Vista.
After repairing the Windows image, you can try using SFC to restore your system files.
Check Windows Component Store Health Using DISM
The DISM /Cleanup-Image /CheckHealth switch is used to scan the Windows image for errors and fix them. DISM commands must be run from the elevated command prompt.
Run the following command to check if there are any flags of corruption of the Windows image Component Store (not applicable for Windows 7/Server 2008R2). This command checks the CBS flag set by one of the system maintenance processes.
DISM /Online /Cleanup-Image /CheckHealth
This command doesn’t perform a full scan of the Component Store. The command only checks if your Windows image is flagged as corrupted and if it is possible to fix it. No changes are made to the image.
In this example, the command has returned that the Windows 10 image has no corruptions:
No component store corruption detected.
The operation completed successfully.
To run a full scan of the Windows Component Store health, run the command:
DISM /Online /Cleanup-Image /ScanHealth
The command to check the Windows image can take quite a long time (10-30 minutes). And will return one of three results:
No component store corruption detected – DISM found no errors in the component store;
The component store is repairable – DISM has encountered errors in the Component Store and can fix them;
The component store is not repairable – DISM cannot fix the Windows Component Store (try using a newer version of DISM or you will have to restore a Windows image from a backup, reset or completely reinstall your Windows instance).
In order to use DISM /ScanHealth switch on Windowds 7 and Windows Server 2008, you have to install the KB2966583 update. Otherwise, you will see the message: “Error 87. The ScanHealth option is not recognized in this context”.
In some cases, the DISM /ScanHealth returns the following errors:
DISM Error 1726 – “The remote procedure call failed”;
DISM Error 1910 – “The object exporter specified was not found”.
It definitely means that your Windows image is corrupted and needs to be repaired.
Repair Windows Image Using DISM /RestoreHealth
To fix corruption in the Windows image Component Store, you must use the RestoreHealth option of the DISM command. This option will allow you to fix errors found in the Windows image, automatically download and replace files of damaged or missing components with original versions of files from Windows Update (your computer must have direct Internet access). Run the command:
DISM /Online /Cleanup-Image /RestoreHealth
In Windows 7/2008 R2, this command looks different: DISM.exe /Online /Cleanup-Image /ScanHealth
The process of scanning and repairing the Component Store may take quite a long time (30 minutes or more). DISM will automatically download and replace the files of corrupted or missing components with original file versions from Windows Update servers.
If the repair has been successful, the following message will appear:
The restore operation completed successfully.
DISM /RestoreHealth: The Source Files Could Not Be Found
If your computer (server) has no direct Internet access (located behind a proxy, or have used internal WSUS to get security and build updates) or Windows Update service is disabled/damaged (how to repair Windows Update client), then the following errors appear when repairing the Component Store:
0x800f0906 – The source files could not be downloaded. Use the source option to specify the location of the files that are required to restore the feature;
0x800f0950 – DISM failed. No operation was performed;
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.
In all of these cases, you can use alternative ways to get the source Component Store files. It can be:
Installation disk/USB flash drive/ISO image;
Mounted wim/esd file;
Folder \sources\SxS from the installation disk;
The install.wim (esd) file with the Windows installation image.
You can specify a WIM or an ESD file with the original Windows installation image to be used as a source to repair the system files. Suppose, you have mounted an installation Windows 11 ISO to the virtual drive D:.
In our case, the Windows 11 Pro image in the install.wim file has ImageIndex = 6.
To repair the Component Store from a local WIM/ESD file using the local source files (without using Windows Update online services), run the following command (remember to specify the Windows version index in the image file):
The following errors can appear when running the DISM /RestoreHealth command:
Error: 50: DISM does not support servicing Windows PE with the /Online option – this means your DISM thinks you are using a WinPE image. To fix this, remove the registry key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\MiniNT;
DISM Error 87: make sure the DISM command is written correctly, make sure you are using the DISM version for your Windows version (usually when booting in WinPE/ WinRE).
You can find the DISM log of scanning and repair of the system files here: C:\Windows\Logs\CBS.log.
After the component store has been repaired, you can run the system file checker tool (sfc /scannow). It is likely that it will be able to restore the damaged or missing system files (Windows Resource Protection found corrupt files and successfully repaired them).
If the SFC.exe doesn’t detect any damage to the system files, a message will appear
Windows Resource Protection did not find any integrity violations.
Repair-WindowsImage: Repairing Windows Image Component Store with PowerShell
The version of PowerShell in Windows 10/11 and Windows Server 2016/2019/2022 has a cmdlet similar to the DISM commands discussed above. To scan the Windows component store and find any corruptions, run this command:
Repair-WindowsImage -Online –ScanHealth
If no errors are found in the Component Store, the following message appears:
ImageHealth State: Healthy
To repair Windows Component Store files, run:
Repair-WindowsImage -Online -RestoreHealth
If you don’t have direct Internet access, this command may hang during the image repairing process. You can restore the system components from the local Windows image file (install.wim/install.esd) copied from the Windows 10 installation ISO image. Here you also need to specify the Windows version index in the wim file as the recovery source:
Boot your device from the Windows installation image (you can use the Media Creation Tool to create a bootable Windows USB stick) and press Shift + F10 on the initial Windows install screen;
To check the drive letters assigned in WinPE, run the command diskpart -> list vol (in my example, the drive letter C:\ is assigned to the disk, on which Windows is installed, and I will use it in the next commands);
Check the system files and repair the corrupted ones with the command: sfc /scannow /offbootdir=C:\ /offwindir=C:\Windows
To repair the offline Windows image, use the following command (I am using a WIM file with the Windows 10 installation image from which the computer is booted as a source to restore my offline Windows image): Dism /image:C:\ /Cleanup-Image /RestoreHealth /Source:D:\sources\install.wim
If there is not enough free space on the target disk, you will need a separate drive, e. g., F:\, on which you will create an empty folder mkdir F:\scratch . Perform a repair of the component store using the scratch dir with the command: Dism /image:C:\ /Cleanup-Image /RestoreHealth /Source:D:\sources\install.wim /ScratchDir:F:\scratch
Tip. Here are some useful DISM parameters an administrator must know:
Under HKLM:\Software\Microsoft\IntuneManagementExtension\Win32Apps\ there is a GUID that represents every user that has been evaluated on the machine, and under each user is the GUID for the application. Delete either the GUID for the app (Which can be easily determined as it is part of the URL when viewing the application in intune) or delete youe user GUID (or all if unsure) and then restart the management service.
All apps will re evaluate , and your install counters will be reset ?.
On Windows 10/Windows Server 2016/2019, you can manage network connection location from the PowerShell. Run the elevated PowerShell console.
Now use the Get-NetConnectionProfile cmdlet to get a list of network adapters on your computer and their associated network profiles.
In my example, there is only one physical network adapter on a computer with a Public network location type (in the NetworkCategory value, you can see the following types of network profiles: Public, Private or DomainAuthenticated).
Let’s try to change the assigned network profile for the NIC. We need to get the index assigned to this network card. In this example, InterfaceIndex is 8.
Name : Network 2
InterfaceAlias : Ethernet0
InterfaceIndex : 8
NetworkCategory : Public
IPv4Connectivity : Internet
IPv6Connectivity : NoTraffic
After you get the network adapter index, you can change the network type to Private: