Skip to content

Instantly share code, notes, and snippets.

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.
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
[skip] is optional, it is only used when you want to image a partition in the middle of the disk
1-gnome-disk-image-mounter --writable file.img
GREP WILL NOT WORK WITHOUT THE SINGLE QUOTES
JUST LIKE SED USE SINGLE QUOTE AND NEVER USE DOUBLE QUOTES
grep -P 'your regex'
Print a list of matched files with its match string and with its context, The whole file content will be printed, and the matched string will be coloured differently
grep -ri 'regex'
Print a list of matched files without its match string
grep -ril 'regex'
sed -i 's/original/new/g' file.txt
SED WILL NOT WORK WITHOUT THE SINGLE QUOTES
JUST LIKE GREP USE SINGLE QUOTE AND NEVER USE DOUBLE QUOTES
There is only one way to replace multiple strings in a file using sed. Or a multiple file s if you use the find command.
sed -i -e 's/abc/new/g' -e 's/nothing/new/g' theisatest.txt
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, "$");
let show_all_text = document.querySelectorAll('span[style="display: none;"]')
for ( let i=0; i<show_all_text.length; i++)
{show_all_text[i].style=null}
OR
document.querySelectorAll('span[style="display: none;"]').forEach(x=>x.style=null)
MAL updated their website
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]+
To get the desired element from XPath you need
1- the element before the desired element
2- the element after the desired element
3- element attributes
## Any attributes will suffice. I mean any attributes, Not only the very popular ones like [id,class,herf]
## For example
## data-tags attribute from safebooru will work
## You don't need to specify the exact value. You just need to specify part of the value, as long full element attribute contain a part of what you did specify
var db = window.indexedDB.open("/tdlib/dbfs", 21);
db.onsuccess = function(e) {
var db = e.target.result;
var databaseout = db.transaction(["FILE_DATA"]).objectStore("FILE_DATA").index('timestamp').getAll()
databaseout.onsuccess = function(e) {
databaseoutput = e.target.result}
};
adb shell cmd appops set <package_name> NO_ISOLATED_STORAGE allow
adb shell cmd appops set your-package-name android:no_isolated_storage allow