2020年11月5日 星期四

My Favorite Git Setting (for Ubunut)


1. Add the following in ~/.bash_profile


#! /bin/bash
#-----------------------------------------------------------------
# Bash autocompletion for Git

if [ -f ~/.git-completion.sh ]; then
   source ~/.git-completion.sh
fi

if [ -f ~/.git-prompt.sh ]; then
   source ~/.git-prompt.sh
fi

# PS1 may be replaced
 PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\][\w]\[\033[0m\]\[\033[1;36m\]$(__git_ps1)\[\033[0;33m\]\[\033[0m\]$ '
#PS1='\[\033[01;32m\]\u@\h\[\033[00m\]: \[\033[01;34m\]\w \[\033[0m\]\[\033[1;36m\] $(__git_ps1)\[\033[0;33m\]\[\033[0m\]$ '
#PS1='[\u@\h \W$(__git_ps1 " (%s)")]\$ '
#PS1="[\[\033[1;32m\]\w\[\033[0m\]] \[\033[0m\]\[\033[1;36m\]\$(git_branch)\[\033[0;33m\]\$(git_since_last_commit)\[\033[0m\]$ "
#PS1="[\[\033[1;32m\]\w\[\033[0m\]] \[\033[0m\]\[\033[1;33m\]\$(__git_ps1)\[\033[0;33m\]\[\033[0m\]$ "


2. Download  https://github.com/git/git/blob/master/contrib/completion/git-completion.bash 

and rename by git-completion.sh

3. download https://github.com/git/git/blob/master/contrib/completion/git-prompt.sh

$ mv git-completion.sh ~/.git-completion.sh
$ mv git-prompt.sh ~/.git-prompt.sh
$ chmod 775 .git-completion.sh
$ chmod 775 .git-prompt.sh


4. 

$ source ~/.bashrc

or


$ source ~/.bash_profile

Reference result




2019年11月13日 星期三

DEBUGGING ARDUINO SKETCHES WITH ATMEL STUDIO 7 (How to install hardware debug tool for ATMEL Studion 7)









Refer to :
1. http://www.solutions-cubed.com/electronic-design-blog/debugging-arduino-sketches-with-atmel-studio-7/

Arduino IDE (Windows app version vs conventional version)

1. The Arduino IDE from Windows app store do not have conventional directory. It's directory is on
   Windows hides windows store apps in c:/users/YourUserName/AppData(hidden folder)/Local/Packages
2. App version of Arduino IDE is not good to translate Arduino sketch file(*.ino) to ATMEL Studio 7 (*.cpp).
3. Suggestion: Removed app version of Arduino IDE and install conventional Arduino IDE from https://www.arduino.cc/en/main/software

2019年9月24日 星期二

AC6 STM32 Eclipse


Run System Workbench for STM32
1. load workspace
    PS: You may delete workspace if you need.

2. Open Projects from File System

3. Import Projects From File System or Archive


4. Build Code to check project is OK or not.



2019年6月24日 星期一

VT-x is not available for VirtualBox in Windows 10

1. rum cmd as administrator
2. cmd: bcdedit /set hypervisorlaunchtype off
3. cmd: dism.exe /Online /Disable-Feature:Microsoft-Hyper-V
4. cmd: Dism /Online /Cleanup-Image /RestoreHealth
5. cmd: sfc /scannow
6. Close cmd
7. run PowerShell as Administrator
8. PowerShell: Disable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-All
9. Restart














Refer to:
1. https://ugetfix.com/ask/how-to-disable-hyper-v-in-windows-10/




2019年3月15日 星期五

Passwordless SSH access

1. Check for existing SSH keys

# ls ~/.ssh


2. Generate new SSH keys

# ssh-keygen


3. Check for SSH keys

# ls ~/.ssh


4. Copy your pulic key to server

# ssh-copy-id <username>@<ip-address>

or

# cat ~/.ssh/id_rsa.pub | ssh <username>@<ip-address> 'mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys' 



Refer to:
1. https://www.raspberrypi.org/documentation/remote-access/ssh/passwordless.md
2. https://askubuntu.com/questions/46930/how-can-i-set-up-password-less-ssh-login

2019年3月7日 星期四

2019年3月4日 星期一

The default password of root for Centos 7.


There is no password. Password-based login as "root" is initially disabled. You need to login to to your default (admin) account using SSH and your key, and then run "sudo passwd root" to set a password on the "root" account. Otherwise you have to reset root password during reboot.