|
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. |
|
325 | 327 | rm -rf **/*.pyc |
326 | 328 | ``` |
327 | 329 |
|
| 330 | + * Disable `.DS_Store` |
| 331 | +
|
| 332 | + ``` |
| 333 | + defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool TRUE |
| 334 | + defaults write com.apple.desktopservices DSDontWriteUSBStores -bool TRUE |
| 335 | + ``` |
| 336 | +
|
328 | 337 | * Disable Airplay |
329 | 338 |
|
330 | 339 | ```bash |
|
837 | 846 | - [Xtreme](https://sourceforge.net/projects/xdman/) |
838 | 847 |
|
839 | 848 | * 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 | 849 | - [ProtonVPN](https://protonvpn.com/) |
| 850 | + - [Hotspot Shield](https://apps.apple.com/us/app/vpn-hotspot-shield-super-vpn/id443369807) |
| 851 | + - Free [TunnelBear](https://www.tunnelbear.com/) |
| 852 | + - [Windscribe](https://windscribe.com/) |
843 | 853 |
|
844 | 854 | * Homebrew [brew.sh](http://brew.sh/) |
845 | 855 |
|
|
850 | 860 | brew install tree |
851 | 861 | ``` |
852 | 862 |
|
| 863 | + * Java |
| 864 | + - [Basic guide](https://www.freecodecamp.org/news/how-to-set-up-java-development-environment-a-comprehensive-guide/) |
| 865 | + - see [versions history](java-history.png) | [wiki](https://en.wikipedia.org/wiki/Java_version_history) |
| 866 | + - [Jabba](https://github.com/shyiko/jabba) - a lightweight version manager |
| 867 | +
|
| 868 | + ``` |
| 869 | + brew install jabba |
| 870 | + jabba ls-remote |
| 871 | + jabba install <version> # ~/.jabba/jdk/ |
| 872 | + jabba use <version> |
| 873 | + ``` |
| 874 | +
|
| 875 | + - [SDKMAN](https://sdkman.io/) - a dev kit manager |
| 876 | +
|
| 877 | + ``` |
| 878 | + curl -s "https://get.sdkman.io" | bash |
| 879 | + source "$HOME/.sdkman/bin/sdkman-init.sh" |
| 880 | + sdk list java |
| 881 | + sdk install java 17.0.1-open # sdk install java <version> at ~/.sdkman/candidates/java/ |
| 882 | + sdk use java 17.0.1-open |
| 883 | + java -version |
| 884 | + ``` |
| 885 | +
|
853 | 886 | * MongoDB |
854 | 887 |
|
855 | 888 | - install |
|
967 | 1000 | - [tmate](https://tmate.io/): `brew install tmate` |
968 | 1001 | - [Tunnelblick](https://tunnelblick.net/) |
969 | 1002 | - [Unarchiver](http://wakaba.c3.cx/s/apps/unarchiver.html) |
| 1003 | + - Oracle [VirtualBox](https://www.virtualbox.org/) |
970 | 1004 | - [VMware Fusion for Mac](https://www.vmware.com/products/fusion.html) |
971 | 1005 | - [Wine](https://www.winehq.org/) |
972 | 1006 | - [PlayOnMac](https://www.playonmac.com) |
|
1246 | 1280 | <br/><a name="command-lines"></a> |
1247 | 1281 | ### Command lines |
1248 | 1282 |
|
| 1283 | + - basic info |
| 1284 | +
|
| 1285 | + ``` |
| 1286 | + cat /proc/cpuinfo # for processor info |
| 1287 | + cat /proc/meminfo # for RAM status |
| 1288 | + ``` |
| 1289 | +
|
1249 | 1290 | - check installed packages |
1250 | 1291 |
|
1251 | 1292 | ``` |
|
1641 | 1682 | sudo tar -xvf go$VERSION*.$OS*-$ARCH*.tar.gz |
1642 | 1683 | sudo mv go /usr/local |
1643 | 1684 | # add the following to ~/.bashrc |
1644 | | - export GOROOT=/usr/local/go |
1645 | | - export GOPATH=$HOME/go |
| 1685 | + export GOROOT="${GOROOT:-$(type -p go|xargs greadlink -f 2>/dev/null|xargs dirname|xargs dirname)}" |
| 1686 | + export GOPATH=${HOME}/go |
1646 | 1687 | export PATH=$GOPATH/bin:$GOROOT/bin:$PATH |
1647 | 1688 | # test go |
1648 | 1689 | go version |
|
1811 | 1852 |
|
1812 | 1853 |
|
1813 | 1854 |
|
| 1855 | +<br/><a name="vbox-setup"></a> |
| 1856 | +## VirtualBox Setup and Network |
| 1857 | +
|
| 1858 | +### Install and Setup |
| 1859 | +
|
| 1860 | + ``` |
| 1861 | + brew install virtualbox |
| 1862 | + ``` |
| 1863 | +
|
| 1864 | +### Network |
| 1865 | +
|
| 1866 | +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. |
| 1867 | +
|
| 1868 | +**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. |
| 1869 | +
|
| 1870 | +In OSX host (e.g. 192.168.8.109), enable ip routing by |
| 1871 | +
|
| 1872 | + ``` |
| 1873 | + sudo sysctl -w net.inet.ip.forwarding=1 |
| 1874 | + ``` |
| 1875 | +
|
| 1876 | +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. |
| 1877 | +
|
| 1878 | +In router (e.g. 192.168.8.1), add static route via web interface or SSH |
| 1879 | +
|
| 1880 | + ``` |
| 1881 | + route add -net 192.168.56.0/24 gw 192.168.8.109 |
| 1882 | + ``` |
| 1883 | +
|
| 1884 | +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. |
| 1885 | +
|
| 1886 | +
|
| 1887 | +
|
1814 | 1888 | <br/><a name="online-tools"></a> |
1815 | 1889 | ## Online tools |
1816 | 1890 |
|
|
0 commit comments