MISC – Jul 28th, 2014

1. Connect git after a company firewall

D:\Source\releng\target>cd ../../

D:\Source>git clone https://github.com/heroku/devcenter-spring-mvc-hibernate.git

Cloning into ‘devcenter-spring-mvc-hibernate’… fatal: unable to access ‘https://github.com/heroku/devcenter-spring-mvc-hibernat e.git/’: Failed connect to github.com:443; No error

D:\Source>git config –global http.proxy http://www-proxy.xx.xxx.com:xxx

D:\Source>git clone https://github.com/heroku/devcenter-spring-mvc-hibernate.git

Cloning into ‘devcenter-spring-mvc-hibernate’… remote: Counting objects: 241, done. emote: Total 241 (delta 0), reused 0 (delta 0) KiB/s Receiving objects: 100% (241/241), 115.81 KiB | 10.00 KiB/s, done. Resolving deltas: 100% (90/90), done. Checking connectivity… done.

D:\Source>

2. Connect heroku after company firewall

C:\Users\luhuang>heroku login Enter your Heroku credentials. Email: luohua.huang@gmail.com Password (typing will be hidden): ! Unable to connect to Heroku API, please check internet connectivity and tr y again.

C:\Users\luhuang>set HTTP_PROXY=http://www-proxy.xx.xxx.com:xxx

C:\Users\luhuang>set HTTPS_PROXY=http://www-proxy.xx.xxx.com:xxx

C:\Users\luhuang>heroku login Enter your Heroku credentials. Email: luohua.huang@gmail.com Password (typing will be hidden): Authentication successful.

C:\Users\luhuang>

3. ssh keys for Git.

heroku login - It will logon heroku with your account, generate and upload ssh keys to Heroku server if there is not keys on Heroku.
C:\Users\luhuang>git push heroku master
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights - Solution 1: Check your heroku keys using command 'heroku keys'. If no keys, run command 'heroku keys:add to add one" otherwise try solution 2
and the repository exists.
(It is because git look into Program Files (x86)\Git\.ssh for keys.) - Solution 2: copy the keys genenarated from heroku login to dir Program Files (x86)\Git\.ssh).

For GitHub, C:\Users\luhuang\AppData\Local\GitHub\PortableGit_054f2e797ebafd44a30203088cd3d58663c627ef\etc\ssh\ssh_config).

4. My test app on Heroku, http://secure-chamber-3168.herokuapp.com/ (I am using it to refresh my git, cloud concept, and Java Web development skills).

5. VPN bans the port 22.

C:\Users\luhuang>git push heroku master

ssh: connect to host heroku.com port 22: Bad file number fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists.

6. Check which shell is being used and change the shell.

jaxxx@xxxx -> uname -a
SunOS xxxx 5.10 Generic_147441-26 i86pc i386 i86pc
jaxxx@xxxx -> ps -p $$
PID TTY TIME CMD
26872 pts/2 0:00 csh
jaxxx@xxxx -> ls /bin/bash
/bin/bash
jaxxx@xxxx -> exec /bin/bash
bash-3.2$ ps -p $$
PID TTY TIME CMD
26872 pts/2 0:00 bash
bash-3.2$