Skip to content

Commit 6bde4d5

Browse files
committed
updated kb-dev-setup-notes.md
1 parent 4f32082 commit 6bde4d5

3 files changed

Lines changed: 74 additions & 6 deletions

File tree

demo/java-history.png

845 KB
Loading

demo/kb-dev-setup-notes.md

Lines changed: 73 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
- [Keyboard shortcuts](#keyboard-shortcuts)
1717
- [Install Apps](#install-apps)
1818
* [Software and Tools on Windows](#software-windows)
19+
* [VirtualBox Setup and Network](#vbox-setup)
1920
* [Online Tools](#online-tools)
2021

2122

@@ -81,8 +82,7 @@
8182
uname -a
8283
system_profiler SPSoftwareDataType
8384
system_profiler -detailLevel full # -xml output to XML
84-
cat /proc/cpuinfo # for processor info
85-
cat /proc/meminfo # for RAM status
85+
/usr/sbin/sysctl -a machdep.cpu
8686
```
8787

8888
* Arrange windows / menu bar / finder / mission control
@@ -101,6 +101,8 @@
101101
* moving cursor to beginning and end of line (Terminal)
102102
- `Fn+←`: `Home`, Send Text: `\001` (no modifier)
103103
- `Fn+→`: `End`, Send Text: `\005` (no modifier)
104+
* clear current command line during input
105+
- `ESC` or `Cmd+L`: Send Hex `0x05 0x15` (moving to end and delete line)
104106
* screenshot:
105107
- `Cmd+Shift+3`: copy screen to file;
106108
- `Cmd+Shift+Alt+3`: copy screen to clipboard.
@@ -837,9 +839,10 @@
837839
- [Xtreme](https://sourceforge.net/projects/xdman/)
838840
839841
* Free VPN with kill switch
840-
- Free [TunnelBear](https://www.tunnelbear.com/)
841-
- [Hotspot Shield](https://apps.apple.com/us/app/vpn-hotspot-shield-super-vpn/id443369807)
842842
- [ProtonVPN](https://protonvpn.com/)
843+
- [Hotspot Shield](https://apps.apple.com/us/app/vpn-hotspot-shield-super-vpn/id443369807)
844+
- Free [TunnelBear](https://www.tunnelbear.com/)
845+
- [Windscribe](https://windscribe.com/)
843846
844847
* Homebrew [brew.sh](http://brew.sh/)
845848
@@ -850,6 +853,29 @@
850853
brew install tree
851854
```
852855
856+
* Java
857+
- [Basic guide](https://www.freecodecamp.org/news/how-to-set-up-java-development-environment-a-comprehensive-guide/)
858+
- see [versions history](java-history.png) | [wiki](https://en.wikipedia.org/wiki/Java_version_history)
859+
- [Jabba](https://github.com/shyiko/jabba) - a lightweight version manager
860+
861+
```
862+
brew install jabba
863+
jabba ls-remote
864+
jabba install <version> # ~/.jabba/jdk/
865+
jabba use <version>
866+
```
867+
868+
- [SDKMAN](https://sdkman.io/) - a dev kit manager
869+
870+
```
871+
curl -s "https://get.sdkman.io" | bash
872+
source "$HOME/.sdkman/bin/sdkman-init.sh"
873+
sdk list java
874+
sdk install java 17.0.1-open # sdk install java <version> at ~/.sdkman/candidates/java/
875+
sdk use java 17.0.1-open
876+
java -version
877+
```
878+
853879
* MongoDB
854880
855881
- install
@@ -967,6 +993,7 @@
967993
- [tmate](https://tmate.io/): `brew install tmate`
968994
- [Tunnelblick](https://tunnelblick.net/)
969995
- [Unarchiver](http://wakaba.c3.cx/s/apps/unarchiver.html)
996+
- Oracle [VirtualBox](https://www.virtualbox.org/)
970997
- [VMware Fusion for Mac](https://www.vmware.com/products/fusion.html)
971998
- [Wine](https://www.winehq.org/)
972999
- [PlayOnMac](https://www.playonmac.com)
@@ -1246,6 +1273,13 @@
12461273
<br/><a name="command-lines"></a>
12471274
### Command lines
12481275
1276+
- basic info
1277+
1278+
```
1279+
cat /proc/cpuinfo # for processor info
1280+
cat /proc/meminfo # for RAM status
1281+
```
1282+
12491283
- check installed packages
12501284
12511285
```
@@ -1641,8 +1675,8 @@
16411675
sudo tar -xvf go$VERSION*.$OS*-$ARCH*.tar.gz
16421676
sudo mv go /usr/local
16431677
# add the following to ~/.bashrc
1644-
export GOROOT=/usr/local/go
1645-
export GOPATH=$HOME/go
1678+
export GOROOT="${GOROOT:-$(type -p go|xargs greadlink -f 2>/dev/null|xargs dirname|xargs dirname)}"
1679+
export GOPATH=${HOME}/go
16461680
export PATH=$GOPATH/bin:$GOROOT/bin:$PATH
16471681
# test go
16481682
go version
@@ -1811,6 +1845,39 @@
18111845
18121846
18131847
1848+
<br/><a name="vbox-setup"></a>
1849+
## VirtualBox Setup and Network
1850+
1851+
### Install and Setup
1852+
1853+
```
1854+
brew install virtualbox
1855+
```
1856+
1857+
### Network
1858+
1859+
VBox's implementation of NAT only supports TCP & UDP among all transport layer protocols [[1]](https://www.virtualbox.org/manual/ch06.html#nat-limitations), so VPN via PPTP won't work. As support for bridged networking with wireless interfaces is also limited [[2]](https://www.virtualbox.org/manual/ch06.html#network_bridged). Consider the followings alternative.
1860+
1861+
**Host-only network with Internet** can be achieved with IP routing by host. Good with Windows/Ubuntu host and guests. It should work for MacOS too.
1862+
1863+
In OSX host (e.g. 192.168.8.109), enable ip routing by
1864+
1865+
```
1866+
sudo sysctl -w net.inet.ip.forwarding=1
1867+
```
1868+
1869+
In Win10 guest with host-only adapter (e.g. 192.168.56.10), set default gateway to OSX (e.g. 192.168.56.1), set DNS to router.
1870+
1871+
In router (e.g. 192.168.8.1), add static route via web interface or SSH
1872+
1873+
```
1874+
route add -net 192.168.56.0/24 gw 192.168.8.109
1875+
```
1876+
1877+
Read this [lab manual](http://www.cs.dartmouth.edu/~sergey/cs60/lab3/vm-networking.pdf) (courtesy of CS@Dartmouth) for setting up internet in VBox guest with Host-only Adapter and native NAT by MacOS host.
1878+
1879+
1880+
18141881
<br/><a name="online-tools"></a>
18151882
## Online tools
18161883

tools/bashrc.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ alias hide='chflags hidden'
104104
alias hs='history | grep'
105105
alias ip='echo $(ipconfig getifaddr en0) $(dig +short myip.opendns.com @resolver1.opendns.com)'
106106
alias ipwan='dig +short myip.opendns.com @resolver1.opendns.com # or `curl -s icanhazip.com`'
107+
alias javaenv='java -version && echo JAVA_HOME='`echo ${JAVA_HOME}`
107108
alias ll='ls -al'
108109
alias lll='ls -al -T | sort -f -k9,9' # --time-style=full-iso
109110
alias lln='ls -al | sort -f -k9,9'

0 commit comments

Comments
 (0)