|
16 | 16 | - [Keyboard shortcuts](#keyboard-shortcuts) |
17 | 17 | - [Install Apps](#install-apps) |
18 | 18 | * [Software and Tools on Windows](#software-windows) |
| 19 | + * [VirtualBox Setup and Network](#vbox-setup) |
19 | 20 | * [Online Tools](#online-tools) |
20 | 21 |
|
21 | 22 |
|
|
81 | 82 | uname -a |
82 | 83 | system_profiler SPSoftwareDataType |
83 | 84 | 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 |
86 | 86 | ``` |
87 | 87 |
|
88 | 88 | * Arrange windows / menu bar / finder / mission control |
|
101 | 101 | * moving cursor to beginning and end of line (Terminal) |
102 | 102 | - `Fn+←`: `Home`, Send Text: `\001` (no modifier) |
103 | 103 | - `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) |
104 | 106 | * screenshot: |
105 | 107 | - `Cmd+Shift+3`: copy screen to file; |
106 | 108 | - `Cmd+Shift+Alt+3`: copy screen to clipboard. |
|
837 | 839 | - [Xtreme](https://sourceforge.net/projects/xdman/) |
838 | 840 |
|
839 | 841 | * 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) |
842 | 842 | - [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/) |
843 | 846 |
|
844 | 847 | * Homebrew [brew.sh](http://brew.sh/) |
845 | 848 |
|
|
850 | 853 | brew install tree |
851 | 854 | ``` |
852 | 855 |
|
| 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 | +
|
853 | 879 | * MongoDB |
854 | 880 |
|
855 | 881 | - install |
|
967 | 993 | - [tmate](https://tmate.io/): `brew install tmate` |
968 | 994 | - [Tunnelblick](https://tunnelblick.net/) |
969 | 995 | - [Unarchiver](http://wakaba.c3.cx/s/apps/unarchiver.html) |
| 996 | + - Oracle [VirtualBox](https://www.virtualbox.org/) |
970 | 997 | - [VMware Fusion for Mac](https://www.vmware.com/products/fusion.html) |
971 | 998 | - [Wine](https://www.winehq.org/) |
972 | 999 | - [PlayOnMac](https://www.playonmac.com) |
|
1246 | 1273 | <br/><a name="command-lines"></a> |
1247 | 1274 | ### Command lines |
1248 | 1275 |
|
| 1276 | + - basic info |
| 1277 | +
|
| 1278 | + ``` |
| 1279 | + cat /proc/cpuinfo # for processor info |
| 1280 | + cat /proc/meminfo # for RAM status |
| 1281 | + ``` |
| 1282 | +
|
1249 | 1283 | - check installed packages |
1250 | 1284 |
|
1251 | 1285 | ``` |
|
1641 | 1675 | sudo tar -xvf go$VERSION*.$OS*-$ARCH*.tar.gz |
1642 | 1676 | sudo mv go /usr/local |
1643 | 1677 | # 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 |
1646 | 1680 | export PATH=$GOPATH/bin:$GOROOT/bin:$PATH |
1647 | 1681 | # test go |
1648 | 1682 | go version |
|
1811 | 1845 |
|
1812 | 1846 |
|
1813 | 1847 |
|
| 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 | +
|
1814 | 1881 | <br/><a name="online-tools"></a> |
1815 | 1882 | ## Online tools |
1816 | 1883 |
|
|
0 commit comments