Saturday, January 20, 2018

Note to self: How to re-enable terminal escape sequences in new WindowsConsole

Windows 10 "fall creators update" 2017, more precisely known as Windows 10 version 1709, brings with it a new version of the windows console.
This is the terminal that is used to display cmd.exe and PowerShell commandline environments.

Now the new version is nice, amongst other things it has is variable transparency, but it turns off processing terminal escape sequences from Python (and probably a load of other things) by default.

This is how to turn on the processing of terminal escape sequences in Win10 console V2.

Using RegEdit add "VirtualTerminalLevel" as a DWORD to ‘HKCU\Console’ set to value 0x1

restart the console and bob is your uncle.

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 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

Thursday, April 14, 2016

Note to self: How to mount virtualbox shared folders RW, and enable symlinks

So these are two commands to mount shared folder in a linux host on a linux guest so that the guest has full permission in the shared folders.

This first command should be executed on the guest VM

sudo mount -t vboxsf SHARE_NAME /MOUNT_POINT/ -o rw,users,umask=0000

This next command enables symlink creation and should be executed on the host.

VBoxManage setextradata VM_NAME VBoxInternal2/SharedFoldersEnableSymlinksCreate/SHARE_NAME 1 

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)