## automation – Automated reboot without root

I’m responsible for an automation lab with many Android phones connected to Linux servers via adb for testing. We have an issue where devices will sometimes disappear from adb which means that someone has to manually find the phone and reboot it before it will come back. I’m interested in finding solutions to reduce this need for manual intervention.

One idea I had was that we could periodically send a ping to the device from the host and if the device did not receive a ping in a specific period it would assume it was disconnected and reboot itself. The issue is that we cannot root these phones so I’m not sure if that is possible.

I do however, have the ability to write and install my own apps on the devices and I don’t need to worry about any playstore rules. Is there anyway I can achieve this without rooting the device?

## security – Extract an ext4 filesystem image *without root access*

On occasion, one gets ext4 images from the internet, and one would like to extract them without root access.

I understand that with root access, one would do a loopback mount. Suppose one does not have root access.

Even if one does have root access, there are reasons why one would perhaps not want to mount some random ext4 filesystem off the internet as root, even if one does specify `nosuid` and `nodev`. For instance, odds are very good that your regular user will not have read access to the entire thing, requiring root access to do even the most basic operation, like ripgrep. This is dumb. There has got to be a better way.

Yes, I’m aware it is impossible to preserve the original permissions when extracting this way, and this should not be done if this filesystem actually needs to be repackaged again with the original permissions.

## recovery mode – Analyzing boot loop Root cause from console-ramoops-0 ( & logcat)

`Boot-looped` and got stuck in powered by android logo. `Logcat` hasnt been much useful. Wanna know what’s causing the stuck.
All I have is this from `/sys/fs/pstore/console-ramoops-0`

``````'android.frameworks.sensorservice@1.0::ISensorManager/default': No such file or directory
``````

I am attaching Entire /sys/fs/pstore/console-ramoops-0

what seems the issue ?
I have TWRP backups of `vendor system boot` that i tinkered restores with. No Luck. This is stock `MIUI ROM` with `TWRP as recovery base` so after flashing dm-verify-no encrypt.zip ( cant recall the exact name ) + certification.zi & permssiver I get past `MIUI` logo but now looping at powered by `android` logo

## How to mount image file without root?

In rooted android phone, ext4 image file is mounted using these commands in android terminal :

``````  #  mknod    /dev/block/loop52  b 7 0
#  losetup  /dev/block/loop52  /sdcard/ext1.img
#  mkdir /mnt/ext
#  mount -t ext4 -o rw,noatime  /dev/block/loop52  /mnt/ext
``````

I have an ext4 image file stored in sdcard.
How can I mount the ext4 image file in my non rooted android phone or Is there any other way to access it ?

## root access – on Android 9 How do I get an audit going back some 10 days about a process that deleted some internal data

I am `magiskally rooted` on my `Android phone` running version 9 `MIUI` 11. In fact I moved to`MIUI`Just a week ago. Had This phone has a replacement of my lost AT&t phone since couple of months and initially installed custom GSI ROM which did not support many frequencies here so moved to stock.

Problem
About 5 days ago my entire WhatsApp internal data the most important of which is the `msgstore.db file` was cleaned out.

was extremely sceptical of MIUI vis-a-vis cleanliness & privacy is concerned and was trying to figure out how to to disable certain MIUI components which I could confirm were spyware.
And then this tragedy happened.
I would like to know which process has done this. I did not disable at that time the `cleaner` app – now it’s disabled.

QUESTION

Is there any way to dig out which process cleaned out my phone I am about just a week away from when this incident happened

What I did
Looked up the `logcat` but I can’t beyond a few days.

what else will tell me the story ? I have `USB debugging` enabled

## Complexity for print root to leaf of a perfect binary tree

In https://www.techiedelight.com/print-all-paths-from-root-to-leaf-nodes-binary-tree/, the code for printing root to leaf for every leaf node is provided below.

They state the algorithm is O(n), but I think it should be O(n log n) where n is the number of nodes. A standard DFS is typically O(n + E), but printing the paths seems to add a log n. Suppose $$h$$ is the height of the perfect binary tree. There are $$n/2$$ nodes on the last level, hence $$n/2$$ paths that we need to print. Each path has $$h + 1$$ (let’s just say it’s $$h$$ for mathematical simplicity) nodes. So we need end up printing $$h * frac{n}{2}$$ nodes when printing all the paths. We know $$h = log_2(n)$$. So \$h * frac{n}{2} =

``````#include <iostream>
#include <vector>
using namespace std;

// Data structure to store a binary tree node
struct Node
{
int data;
Node *left, *right;

Node(int data)
{
this->data = data;
this->left = this->right = nullptr;
}
};

// Function to check if a given node is a leaf node or not
bool isLeaf(Node* node) {
return (node->left == nullptr && node->right == nullptr);
}

// Recursive function to find paths from the root node to every leaf node
void printRootToleafPaths(Node* node, vector<int> &path)
{
// base case
if (node == nullptr) {
return;
}

// include the current node to the path
path.push_back(node->data);

// if a leaf node is found, print the path
if (isLeaf(node))
{
for (int data: path) {
cout << data << " ";
}
cout << endl;
}

// recur for the left and right subtree
printRootToleafPaths(node->left, path);
printRootToleafPaths(node->right, path);

// backtrack: remove the current node after the left, and right subtree are done
path.pop_back();
}

// The main function to print paths from the root node to every leaf node
void printRootToleafPaths(Node* node)
{
// vector to store root-to-leaf path
vector<int> path;

printRootToleafPaths(node, path);
}

int main()
{
/* Construct the following tree
1
/
/
2       3
/      /
4   5   6   7
/
8       9
*/

Node* root = new Node(1);
root->left = new Node(2);
root->right = new Node(3);
root->left->left = new Node(4);
root->left->right = new Node(5);
root->right->left = new Node(6);
root->right->right = new Node(7);
root->right->left->left = new Node(8);
root->right->right->right = new Node(9);

// print all root-to-leaf paths
printRootToleafPaths(root);

return 0;
}
$$```$$
``````

## How to instal Aegir without root access

The Aegir documentation states that root access is required for installation, but I have seen comments suggesting it is possible to instal without root.
If this is correct can anyone point me in the right direction?

Background:
I host a few non profit sites with an Aegir service provider who has provided great service. But the sites have grown and the cost has become a challenge for them. I don’t have the skills for a self-managed server, so I am hoping to be able to find someone to instal on a fully managed server where someone else can maintain it and keep it secure etc.

## Root Domain 301 Redirect Except Checkout Page – 2 Sites Merged

I have a client who is merging his two ecommerce websites into one. The first ecommerce site is about knowledge of the products and second ecommerce website is to buy the product. It is interlinked with each other.

Now, he decided to merge it into one whole website and redirecting everything from second website to this first one except CHECKOUT page. That means, you’ll add to cart the product from the first website but the checkout will be done from second website.

So, my query is – when you are redirecting 301 the whole website from root domain to each and every page, how can you keep checkout page static? won’t that be also redirected?

So, i’m asking here – Is it possible to redirect every page except checkout page?

Thanks.

## external sd – Suddenly most of the files and folders in my sd card are now named “FSCKxxxx.REN”. How to fix this without root?

The most likely cause is your SD card being in the process of “breaking down”: When you connected it to your receiver, it detected problems and ran `fsck` (the File System ChecK utility) to repair it – which found issues with some files and directories, couldn’t figure their names, and thus “saved” what it found using those “cryptic names” (the `FSCK` prefix seems to confirm this, though normally such “recovered blocks” are moved into a `LOST+FOUND` folder).
After having connected the card to your PC using a card reader, the PC again found the card faulty and had to repair things. Of course it couldn’t restore the `FSCK*` files and directories to their original name, as that name was lost. As you correctly discovered, using the `file` command you can determine the file type, rename the files manually, and many, most or (if you’re very lucky) even all or them might be intact.
And next to that, go the described way to identify the `FSCK*` files, which you then can rename to “useful names” and also copy back to the new card.