Tuesday, December 29, 2020

github will cease support using username/password for login

Github will stop supporting username/password for accessing:
Basic authentication using a password to Git is deprecated and will soon no longer work. 
Visit https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ for more
 information around suggested workarounds and removal dates.
Beginning August 13, 2021, we will no longer accept account passwords when authenticating Git operations
 on GitHub.com. For developers, if you are using a password to authenticate Git operations with GitHub.com
 today, you must begin using a personal access token over HTTPS (recommended) or SSH key by August 13, 
2021, to avoid disruption.
I'm not very familiar with how the token can be used. I assume that is for HTTPS. As I know, for daily pull/
push, SSH key is commonly used. You can follow instruction to generate the RSA key pair, and upload the
public key to Github.  If run into issue, refer to troubleshoot common SSH Problems, especially
Reviewing your SSH keys
If run 'ssh-add -l -E sha256' gives 'The agent has no identities', probably you haven't run ssh-add to add the
 key to ssh-agent. You can run: ssh-add -E sha256, then rerun with '-l'. 
For your exist local repository, may need update the remote url as this:
Check remote url: git remote -v
Update remote url: git remote set-url origin git@github.com:your_github_username/your_proj.git
Note, it is 'git@' but not 'your_username@'.

Tuesday, December 8, 2020

Chicken & egg: Google Account Verify code via SMS

 Recently Google announced policy update which mentioned an email account may get deactivated if not used for a long time. I had registered an email address with a personal name and I don't want to lose it. But I haven't used it for a while since my previous old computer retired. So I tried to log into the account with my new computer. The password still works. Everything looks OK, until when I tried to add the account to my Thunderbird email app, it redirected me to Google website and asked for 6 digital verification code which supposed to be sent to my phone as text message (SMS). However, for some reason, I cannot get the code no matter how many times I tried. It worked before, that's how the phone number got bound with my Gmail account. I got to Google Account management site and did see besides the phone number, I have recovery email and secret question set as recovery method. But, when I trying to change or remove the phone, it prompted me again with code sending to my phone.

Select "More way to verify" doesn't help, it will always go back to the same page: get a verification code with the phone text message. I googled, and found others encountering the same problem, with no solution. Yes, I tried recovery Google Account. Since I have the right current password, it always says recovery success. But, I still cannot get the code, and I cannot change the phone number, and it does not prompt for other way such as phone call as verify method. It's so frustrate, and eventually, I saw this page from Google's FAQ at https://support.google.com/accounts/answer/183723?hl=en&ref_topic=3382296:

Can't change recovery info

If there’s something different about how you’re signing in, you might not have the option to change your recovery info. You can try again:

  • From a device you normally use to sign in.
  • From a location where you normally sign in.
  • The following week from the device that you’re currently using.

So my best luck is: try after a week, with same computer. Hopefully it will work.

Update: I was able to update the setting after couple days later.


Monday, November 16, 2020

Windows 10 webcam remote view from another PC

Because of the COVID-19, lot of software programmer like me chose WFH. For my work, we have development platform connected with monitor, and sometimes I need visually check what is displayed. There is no VNC or remote desktop available on the development board, so I will use a webcam either built-in of a host PC or connect to USB of host PC.

It is a simple task, I just want to stream a webcam view from a lab PC, so I can remotely see what happening there. Two sides both need some setting/configuration to get it work: on the lab PC, need to start a stream server and use the webcam as feed. On my home PC, I need to have a software which can open the streamed video. I have done this on Android, with two popular free app, tinyCam and IP camera viewer: one provides the streaming service, the other provides the viewer on another Android setup.

To get it done on Windows 10, will need install some software on both host side and client side. There is many choice, one easy approach is installing the popular free and open source cross-platform multimedia player, VLC, from https://www.videolan.org/vlc/.

For the host PC, start VLC and select 'Open Capture Device':

Then select Video source from next dialog:

 

And select Stream from the drop list beside the bottom 'Play' button:

 

For  the "Source' dialog, just leave it to the default 'dshow'.

 

For destination setup, select 'HTTP' and make sure click the 'Add' button:

 

The default port would be 8080, and HTTP path would be the root '/', change to proper setting, or leave with the default setting:

 

Click 'next' for all other dialog with default setting, and click 'Stream' in the last dialog to start the stream. It will start the streaming. Grant permission if Windows pop up dialog for permission.

Also, will very likely need to open the port from windows firewall setting to allow external client to access this stream services. This can be done from Control Panel -> Windows Defender Firewall, or search "Windows Firewall" from Windows 10 search box. Then go to "Advanced Settings", select "Inbound rules", scroll to right (better enlarge the window) to see the "Local Port" column and sort the rules. Make sure the port such as the default 8080 is opened. If not, click "New Rule..." from Actions panel on the right to create a new Inbound rule:

  Select TCP and fill in the port:

 

Select 'next' for all other dialog, or uncheck 'Public' for 'When does this rule apply' to make it more secure. And give the new rule a meaningful name and click 'finish' to complete the setting.

 On client side, open VLC and select 'Open Network Stream':

 

Fill in the remote host PC's url with the port number (like below http://lab_pc_r3s4:8080):

 

The protocol 'http' is a must. That's it. The streaming will have some latency, from 10 to 30 seconds, depends on the bandwidth and traffic.

 It is possible to stream with other format, such as WebM, Ogg with which FireFox has built-in support, i.e. the stream can be opened directly inside FireFox (refer to FireFox KB) or Chrome web browser. But keep in mind, this will need a lot of horse power, meaning the host CPU will spend a lot of MIPs for doing the trans-coding, which might be a waste as the streaming may run 24X7.