usb connection script - Raspberry Pi Q&A, Help & Troubleshooting

Hello
I am going to write a script that will run another script When the USB device is connected.
I used a rule called 99-my-usb-rule.rules in /etc/udev/rules.d
All the work I did and the error log are all in the attached image file
Can anyone help me?
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}

debug your commands/scripts in shell first , to see if they run and do what you want them to.
bash -x ./script.sh ( for detailed debugging )
then running from udev script just like running from crontab
is a very sterile environment unlike a login shell.
do "/usr/bin/env > /tmp/udev-env.txt" from udev script to see what it set and what is not.
vs "env > /tmp/login-env.txt" from a login shell , which would have all sorts of things set besides paths that might be missing etc...
and you are also not specifying any devices ( do you want script to run on all usb device connections? )
lookup udev rules if you want something a bit more specific.
also you do not need /bin/bash if you have shebang #!/bin/bash as first line of your script
just execute your /path/to/script.sh ( make sure it is an executable )

Related

[How To] Simplified webtop terminal access

Please look in this thread for more complete details.
***** ***** ***** ***** ***** ***** ***** *****
For those of you looking to get terminal access on your webtop, here's a simplified set of instructions. You'll need:
A rooted Atrix.
Some kind of terminal access. I ended up using the Android Terminal Emulator that’s in the market; I would imagine that other terminals would work, as well as something like adbWireless.
Run the following commands on the terminal:
su
/usr/bin/sudo -u adas bash
export DISPLAY=:0
/osh/usr/bin/.lxterminal
And then, you too can end up with this!
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
P.S. I'm not responsible for any havoc you wreak after getting a terminal running.
P.P.S. droidbird has figured out how to add additional programs to the dock, so you should be able to add LXTerminal to the dock after that.
Thanks worked nicely, though still fuzzy with the link you posted to get the terminal icon on the dock any how to explained more clearly?
Please close in favour of this thread.

[Q]CWM The system cannot find the path specified

I'm having a problem installing CWM on my unit
XPERIA SP C5302 running on stock .205 rooted with towelroot ( this is my first time rooting )
i have my phone connected to my PC with USB Debugging checked
and followed the steps on this thread
but whenever i run the install.bat file and choose the 1st option
i always end up with "The system cannot find the path specified
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Help please~
help
someone help! im facing the same problem
Hi, go DOS mode in the directory where you extracted the archive .. there is an ADB directory. Steps in this directory the command: adb devices .. if you have an answer with number, then your phone is connected...
Problem is not with the device. It is with the recovery. Retry the download. Some file might be deleted by antivirus or something? Check it out. It can't find a file it is looking for.
PS: Press thanks if I helped you!
Check if you have the ADB directory .. Option 1 uses. Look Attachment

Create Zip or Tar archive on Tasker [SOLVED]

Hi all!
I'm facing some problems when I try to create a zip or tar compressed file from any single file or directory (what I'm actually looking for now) with shell code. How is done it on Android?
Note: I have latest version of Busybox Pro installed.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
I know these commands, also I can't see zip ones on mine (are not installed)
I have this error while trying to compress by tar command:
Well done!
I have fixed the error by changing the syntaxis shell code: cd /dir && tar -cvf file.xxx FileOrFolder ; gzip -x file.xxx
-v = as the code is executed in tasker it would not need this argument, but have added it because I'll give an export function data to a variable.
.x = because I want to compress the file.
.xxx = I have not put directly the obvious: .tar, because I would like to later use 3 container types (.zip, .rar, .tar).
Thanks for your help!

Android Studio 4.2.1 Setting Default Emulator Size on Startup

Hello, I hope I am in the right place for this question. As a new learner, I ask a question or two with reference to a how to page that seems to have become depreciated but very close to my desired goal of setting the default size of an android device emulator.
THIS page described how to manage the default size of the device emulator.
At 2:54 in the video it shows that activating "telnet server". That has however been disabled in the latest 21H2 version of Win 10.
So I an thinking the needed command is just slightly different rather than using at 6:24 the telnet localhost 5554 (which now requires authentication - no probs it tells how to do it on the new win 10 version).
There there is no "window" function to add the "window scale 0.2" command at 7:02.
So that is where I get lost.
I was able to do every thing but the cmd list i got did not have the "window" in the list. This is what my list looks like:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
I hope this is enough for a more experienced android studio user can help me out with.
So, to deflect the standard suggestion of resizing by simply click-dragging the emulator, not my best goal, I would like the default size be set so that is not required every time I open the emulator.
Thanks very lots. Cheers for any help.
CC

【Guide】Disable ZRAM in moto stock rom permanently

【Guide】Disable ZRAM in moto stock rom permanently
This method is only tested in moto stock oreo 8.1.0 os. Just follow the steps below:
1. Use 'Magisk' to root your device.
2. Use 'MT Manager'( or Root Explorer ) app open /system/build.prop
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
3.Search: zram
Then I see the following code lines
# Create zram disk
ro.vendor.qti.config.zram=true
Add something before this command 'ro.vendor.qti.config.zram=true'.
For example, I add '# ' before it '# ro.vendor.qti.config.zram=true'. Then the creating zram command doesn't work anymore.
Save it.
5. Long press build.prop file, and tap the ’attribute‘ (’属性‘)
Because the MT Manager app doesn't have any setting to change language to english. So I provide all the screenshots for you.
6. Change its permission (权限——’更改‘)
7. Type ’0644‘
8. Restart your device. And the ZRAM has gone permanently.
Before: (Screenshot from 'DevCheck' app)
After:
I haven't found how to disable the ZRAM in the third party rom yet, such as lineageos or the others. If someone knows how to make it, welcome to share with us.

Categories

Resources