This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1- install net framework 3.5 | |
# E:\ this path of mounted windows iso file | |
Add-WindowsCapability -Online -Name NetFx3~~~~ -Source E:\Sources\SxS | |
2- remove quick assist | |
Remove-WindowsCapability -Online -Name $(Get-WindowsCapability -Online -Name *quickassist*).Name | |
2.2- turn off useless windows "Features" | |
2.3- Disable Reserved Storage | |
WindowsReservedStorageState -State Disabled |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Create bootable windows vhd/vhdx image and maybe even linux | |
1- you need an intermediate virtual disk to write the acronis backup image | |
2- create a fat32 partition at the beginning of the disk --BUT DO NOT SET THE TYPE TO EFI PARTITION JUST YET-- | |
3- write the acronis image to the partition after the fat32 partition | |
4- use easy uefi to put efi boot files inside the fat32 partition | |
5- change the fat32 partition type to efi partition | |
6- create an empty vhd/vhdx image and add the vhd file as a virtual disk to the virtual machine. you can not add vhdx as virtual disk to the virtual machine. so just create vhdx disk | |
7- copy the intermediate virtual disk to the virtual vhd/vhdx disk using MiniTool Partition | |
8- mount the vhd/vhdx disk image and rebuild the EFI partition inside the disk image using easyuefi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#break the service so that it can never start | |
$registryPath = "HKLM:\SYSTEM\CurrentControlSet\Services\WinDefend" | |
Set-ItemProperty -Path $RegistryPath -Name ImagePath -Value null | |
$key = Get-Item -Path $registryPath | |
$users = @("TrustedInstaller", "ALL APPLICATION PACKAGES", "CREATOR OWNER", "SYSTEM", "Administrators", "Users") | |
foreach ($user in $users) { | |
$acl = Get-Acl -Path $registryPath | |
$rule = New-Object System.Security.AccessControl.RegistryAccessRule($user, "FullControl", "Deny") | |
$acl.AddAccessRule($rule) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const replaceOnDocument = (pattern, string, {target = document.body} = {}) => { | |
[target,...target.querySelectorAll("*:not(script):not(noscript):not(style)")] | |
.forEach(({childNodes: [...nodes]}) => nodes | |
.filter(({nodeType}) => nodeType === document.TEXT_NODE) | |
.forEach((textNode) => textNode.textContent = textNode.textContent.replace(pattern, string))); | |
}; | |
replaceOnDocument(/€/g, "$"); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this is a list of regular expression to extract ASCII or replace non ascii | |
#extract ascii | |
[ -~]+ | |
#replace non ascii | |
[^\t\r\n\x20-\x7E]+ | |
#replace non ascii | |
[^a-z0-9``~!@#$%^&*()\-_=+\[\]{}\\|;:'"<>,./?\r\n]+ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.\adb.exe shell am broadcast -a clipper.get | foreach {[regex]::match($_,'(?<=data=").*(?="$)').value} (Any line that does not match the regex will exist as an empty line in the output) | |
$String = .\adb.exe shell am broadcast -a clipper.get | |
[regex]::matches($String, '(?<=data=").*(?="$)').Value (The slightly longer version does not have the issue of the shorter version) | |
in powershell match returns an array of matched results | |
foreach is needed to iterate over the array |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gnome-disk-image-mounter --writable file.img | |
OR | |
1- sudo fdisk -l disk.img | |
2- value of the offset is (disk start number) * 512 | |
3- sudo mount -v -o offset=VALUE -t ext4 /path/to/image /mount/dir | |
sudo kpartx -a -v file.img | |
It is a decent alternative if gnome-disk-image-mounter does not exist for whatever reason. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The [count] and [skip] parameters scale with the [bs] parameter the default bs value is 512 bytes | |
you can use 1K or 1M, but it uses the binary units | |
and use [iflag=fullblock] to copy the fullblocks | |
The skipped size is [bs * skip] | |
The output size is [bs * count] | |
[fullblock] and [sync] are mandatory to be used. more info about the flags at the end | |
[skip] is optional, it is only used when you want to image a partition in the middle of the disk |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
certutil -generateSSTFromWU roots.sst | |
certutil -addstore "Root" "roots.sst" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I know it is weird. And it is in reverse. But it is the way things are in XPath | |
preceding in XPath means after | |
following in XPath means before | |
//a[preceding::ol[@class='work index group']] | |
means to select only an (a) element that is after (ol) element with a class of "work index group" | |
if you have an XPath like this |
NewerOlder