-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.sh
70 lines (49 loc) · 2.59 KB
/
setup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#setup.sh VNC_USER_PASSWORD VNC_PASSWORD NGROK_AUTH_TOKEN
#disable spotlight indexing
sudo mdutil -i off -a
#Create new account
sudo dscl . -create /Users/KrypticBit
sudo dscl . -create /Users/KrypticBit UserShell /bin/bash
sudo dscl . -create /Users/KrypticBit RealName "KrypticBit"
sudo dscl . -create /Users/KrypticBit UniqueID 1001
sudo dscl . -create /Users/KrypticBit PrimaryGroupID 80
sudo dscl . -create /Users/KrypticBit NFSHomeDirectory /Users/vncuser
sudo dscl . -passwd /Users/KrypticBit $1
sudo dscl . -passwd /Users/KrypticBit $1
sudo createhomedir -c -u akhil > /dev/null
#Enable VNC
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -configure -allowAccessFor -allUsers -privs -all
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -configure -clientopts -setvnclegacy -vnclegacy yes
#VNC password - http://hints.macworld.com/article.php?story=20071103011608872
echo $2 | perl -we 'BEGIN { @k = unpack "C*", pack "H*", "1734516E8BA8C5E2FF1C39567390ADCA"}; $_ = <>; chomp; s/^(.{8}).*/$1/; @p = unpack "C*", $_; foreach (@k) { printf "%02X", $_ ^ (shift @p || 0) }; print "\n"' | sudo tee /Library/Preferences/com.apple.VNCSettings.txt
#Start VNC/reset changes
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -restart -agent -console
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate
#Enable Performance mode
sudo nvram boot-args="serverperfmode=1 $(nvram boot-args 2>/dev/null | cut -f 2-)"
#Enable Multi-Session
sudo /usr/bin/defaults write .GlobalPreferences MultipleSessionsEnabled -bool TRUE
defaults write "Apple Global Domain" MultipleSessionsEnabled -bool true
#Disable Screen-Lock
defaults write com.apple.loginwindow DisableScreenLock -bool true
defaults write com.apple.loginwindow AllowList -string '*'
#install ngrok
brew install --cask ngrok
#install chrome
#brew install --cask google-chrome
#install TeamViewer
brew install --cask teamviewer
brew install --cask firefox
brew install --cask folx
#IDE
#brew install --cask intellij-idea-ce
#brew install --cask android-studio
#Reduce Motion and Transparency
defaults write com.apple.Accessibility DifferentiateWithoutColor -int 1
defaults write com.apple.Accessibility ReduceMotionEnabled -int 1
defaults write com.apple.universalaccess reduceMotion -int 1
defaults write com.apple.universalaccess reduceTransparency -int 1
defaults write com.apple.Accessibility ReduceMotionEnabled -int 1
#configure ngrok and start it
ngrok authtoken $3
ngrok tcp 5900 --region=in &