Thursday, November 23, 2017

Note to Self: How to open the react-native debug menu without the rage-shake


I've been playing around with react-native for a week or so, and I'm liking it.
If you don't know what it is, its basically a toolkit for building mobile apps with, one that makes it easy to achieve good looking apps that integrate with your phone without you having to learn low-level details about how phones work (yay for that!).
One of the great things is that, with Android at least, you can use your own favourite editing tools and the Android SDK and react-native will build your app, install it on your phone, start it running, and attach a debugger to the app and the developer tools in your web browser.
All from one simple command:

react-native run-android

It even has a hot-patch and automatic re-load ability so that the running app updates as you edit your source files.
But one thing has been bugging me like mad, though, there is a "secret" menu of developer options installed in the app, including an option to force a reload, but it requires a "rage-shake" to wake it on the phone.
Or should I say it did.. because if you have your phone tethered with a USB to the Android Debug Bridge (adb) you can issue a keypress signal over adb and bind that to a menu or a keyboard shortcut in your computer. Yes, indeed, open a menu on the phone screen with a press of a key in your editor! All you have to do is to bind this command to a shortcut or key binding, and Bob's your uncle.:

adb shell input keyevent 82 


Sunday, July 30, 2017

Note to self: How to reset windows permissions


We have just copied a big chunk of files off a broken home NAS by mounting the hdd in a windows PC. Luckily this one has a windows format partition on it, the other one doesn't so I'll need to make a bootable Linux USB dongle, probably via https://www.pendrivelinux.com/ and boot from that.

However back to windows, and I can't read any of the files on Win10 because the permissions don't map onto the users and groups in Win10, and UAC doesn't help because it won't allow me to "be" an administrator.

But I found the answer! :-D
Run powershell "as administrator" cd to the broken directory and use this command to recursively reset the permissions to the system default set for a whole tree.:

icacls .\ /reset /T /C /L

If that doesn't work you can take ownership of the tree using this command and then try the icacls (eye cackles?) command again

takeown.exe /F .\ /R


I know nothing, I'm not a fortune teller, and you'd be insane to think that I am. This disclaimer was cribbed from an email footer I once received. It is so ridiculous I had to have it for myself.

Statements in this blog that are not purely historical are forward-looking statements including, without limitation, statements regarding my expectations, objectives, anticipations, plans, hopes, beliefs, intentions or strategies regarding the future. Factors that could cause actual results to differ materially from the forward looking statements include risks and uncertainties such as any unforeseen event or any unforeseen system failures, and other risks. It is important to note that actual outcomes could differ materially from those in such forward-looking statements.

Danny Angus Copyright © 2006-2013 (OMG that's seven years of this nonsense)