Last active 3 weeks ago

paulcoding810 revised this gist 5 months ago. Go to revision

2 files changed, 187 insertions

app-config.md(file created)

@@ -0,0 +1,51 @@
1 + ## macos
2 +
3 + - settings -> keyboard shortuts -> services -> disable searching
4 + - settings -> keyboard shortuts -> mission control -> mission control {swtich to desktop nth}
5 + - settings -> display -> {reduce motion,increase contrast}
6 + - settings -> desktop & dock -> Mission control -> {diable rerrangement,separate spaces}
7 + - settings -> desktop & dock -> Desktop & dock -> {diable animate application,recent apps}
8 + - sudo mdutil -i off / -> disable spotlight indexing
9 +
10 + ## iterm
11 +
12 + - settings -> profiles -> other actions -> import json as profile
13 + - Settings -> Advanced -> Scroll wheel sends arrow keys when in alternate screen mode: FALSE
14 + - Preferences → Profiles → Keys → Keyboard Behavior-> Natural Text Editing
15 +
16 + ## android studio
17 +
18 + - tools -> create commandline launcher
19 + - logcat -> ⚙️ -> modify views
20 + - settings -> keymaps -> version control systems -> git -> Annotate = ctl + shf + b
21 + - build -> build tools -> gradle -> enable parallel gradle model fetching
22 + - Preferences -> Appearance & Behavior -> System Settings -> max
23 + - commit -> ⋮ -> configure local change -> staging area
24 + - commit -> 👁️ -> group by directory
25 +
26 + ## firefox
27 +
28 + - about:preferences#privacy -> Firefox Data Collection and Use -> disable
29 + - about:preferences#privacy -> Custom history -> Uncheck all
30 +
31 + ## mate
32 +
33 + - view -> show file browser -> project folder -> (dropdown) use \* as project folder
34 + - settings -> terminal -> shell support insatll
35 +
36 + ## vscode
37 +
38 + - settings gui -> "search: exclude" -> add "\**/*lock.yaml"
39 + - \> Install 'code' command in PATH" command
40 +
41 + ## zed
42 +
43 + - /> cli: install cli binary
44 +
45 + ## dbeaver
46 +
47 + - window -> show view -> query manager
48 +
49 + ## tailscale
50 +
51 + https://login.tailscale.com/admin/machines -> Disable key expiry (trusted server)

backup-mac.sh(file created)

@@ -0,0 +1,136 @@
1 + #!/bin/bash
2 +
3 + # Color Utilities
4 + function green() { printf "\033[32m%s\033[0m\n\n" "$1"; }
5 + function orange() { printf "\033[38;5;208m%s\033[0m\n" "$1"; }
6 + function red() { printf "\033[91m%s\033[0m\n" "$1"; }
7 + function blue() { printf "\033[38;5;27m%s\033[0m\n" "$1"; }
8 +
9 + # Constants
10 + BACKUP_DIR="$HOME/backups"
11 + FILENAME="$BACKUP_DIR/$(date +%d_%m_%Y).tar"
12 +
13 + # Create backup directory if it doesn't exist
14 + function ensure_backup_dir() {
15 + if [[ ! -e "$BACKUP_DIR" ]]; then
16 + blue "Creating backup directory."
17 + mkdir -p "$BACKUP_DIR"
18 + fi
19 + }
20 +
21 + # Handle existing backup file
22 + function check_existing_backup() {
23 + if [[ -f "$FILENAME" ]]; then
24 + orange "$FILENAME already exists!"
25 + read -rp "Do you want to remove the existing backup file? (y/n) : " answer
26 + [[ $answer == 'y' ]] && rm "$FILENAME" || exit 1
27 + fi
28 + }
29 +
30 + function generate_config_files() {
31 + green "Preparing iterm2 & brew config ..."
32 +
33 + local brew_file="$HOME/Brewfile"
34 + local iterm2_file="$HOME/iterm.itermexport"
35 +
36 + brew bundle dump --force --file="$brew_file"
37 +
38 + if [[ ! -f "$brew_file" ]]; then
39 + orange "$brew_file doesn't exist!"
40 + read -rp "Do you want to continue? (y/n): " answer
41 + [[ "$answer" == "y" ]] || exit 1
42 + fi
43 +
44 + tar -rpf "$FILENAME" "$brew_file"
45 +
46 + if [[ ! -f "$iterm2_file" ]]; then
47 + orange "$iterm2_file doesn't exist!"
48 + read -rp "Do you want to continue? (y/n): " answer
49 + [[ "$answer" == "y" ]] || exit 1
50 + fi
51 +
52 + tar -rpf "$FILENAME" "$iterm2_file" && rm "$iterm2_file"
53 + }
54 +
55 + # Backup dotfiles
56 + function backup_dotfiles() {
57 + green "Backing up dotfiles..."
58 + find "$HOME"/.* -maxdepth 0 -type f -exec tar -rpf "$FILENAME" {} +
59 + }
60 +
61 + # Exclude large config dirs and create gzipped archive of .config
62 + function backup_config_gz() {
63 + tar -rpf "$FILENAME" "$HOME/.config/git"
64 + tar -rpf "$FILENAME" "$HOME/.config/rclone"
65 + tar -rpf "$FILENAME" "$HOME/.config/telebit"
66 + tar -rpf "$FILENAME" "$HOME/.config/yarn/global/package.json"
67 +
68 + tar -rpf "$FILENAME" "$HOME/.gnupg/*.gpg"
69 + tar -rpf "$FILENAME" "$HOME/.gradle/gradle.properties"
70 + tar -rpf "$FILENAME" "$HOME/.android/debug.keystore"
71 + }
72 +
73 + # Append selected items to tar archive
74 + function backup_specific_items() {
75 + green "Backing up specific items..."
76 + tar -rpf "$FILENAME" --exclude=".git" "$HOME/.zsh"
77 + tar -rpf "$FILENAME" "$HOME/.ssh"
78 + tar -rpf "$FILENAME" $HOME/Library/LaunchAgents/local.*
79 + tar -rpf "$FILENAME" $HOME/Data/launchd/*/*.sh
80 + tar -rpf "$FILENAME" "$HOME/Library/Developer/Xcode/UserData/KeyBindings"
81 + tar -rpf "$FILENAME" --exclude="*.log" "$HOME/.aria2"
82 + tar -rpf "$FILENAME" /etc/hosts /etc/paths
83 + # tar -rpf "$FILENAME" /etc/postfix
84 + # tar -rpf "$FILENAME" /etc/apache2/**/*.conf
85 + }
86 +
87 + # Backup command output (defaults, crontab, brew list)
88 + function backup_system_state() {
89 + crontab -l >crontab.txt && tar -rpf "$FILENAME" crontab.txt && rm crontab.txt
90 + defaults read >defaults.txt && tar -rpf "$FILENAME" defaults.txt && rm defaults.txt
91 + brew list >homebrew.txt && tar -rpf "$FILENAME" homebrew.txt && rm homebrew.txt
92 + }
93 +
94 + # Append list of backed-up files
95 + function add_backup_log() {
96 + {
97 + echo "Save location: https://onedrive.live.com/?id=5FC8AF0024B02AE9%2118898&cid=5FC8AF0024B02AE9"
98 + echo -e "\n\nBackup List:\n"
99 + tar -tvf "$FILENAME"
100 + } >backup_log.txt
101 + tar -rpf "$FILENAME" backup_log.txt
102 + rm backup_log.txt
103 + }
104 +
105 + # Validate final backup size
106 + function validate_backup_size() {
107 + local size size_mb
108 + size=$(stat -f "%z" "$FILENAME")
109 + size_mb=$(echo "scale=2; $size / 1024 / 1024" | bc)
110 + blue "$FILENAME has size ${size_mb} MB"
111 +
112 + if [[ $size -gt 24000000 ]]; then
113 + red "Backup > 24 MB, aborting."
114 + exit 1
115 + else
116 + green "Done!"
117 + fi
118 + }
119 +
120 + # === Main Execution ===
121 + ensure_backup_dir
122 + check_existing_backup
123 + cd "$HOME" || exit 1
124 + generate_config_files
125 + backup_dotfiles
126 + backup_config_gz
127 + backup_specific_items
128 + backup_system_state
129 + add_backup_log
130 + validate_backup_size
131 +
132 + exit 0
133 +
134 + # Restore with:
135 + # sudo tar -xvf <backup_filename>.tar -C /
136 + # brew bundle install --file=~/Brewfile

admin revised this gist 5 months ago. Go to revision

1 file changed, 6 insertions, 5 deletions

mac-install.sh

@@ -98,22 +98,24 @@ brew install --cask maccy
98 98 brew install --cask flameshot
99 99 brew install --cask vlc
100 100 brew install --cask localsend
101 + brew install --cask lunar # brightness
102 + brew install --cask ghostty
101 103
102 - # brew install --cask ghostty
104 + # brew install --cask jurplel/tap/instant-space-switcher # spaces
103 105 # brew install --cask xcodes
104 106 # brew install --cask devtoys
105 107 # brew install --cask hiddenbar
106 108 # brew install --cask swiftbar trex multi // create web application
107 - # brew install --cask rectangle
108 109 # brew install --cask alt-tab
109 110 # brew install --cask pusher
110 111 # brew install --cask sequel-ace
111 - # brew install --cask keycastr # keycast
112 + # brew install --cask keycastr # keystroke visualizer
112 113 # brew install --cask linearmouse
113 114 # brew install --cask iconizer
114 115 # brew install --cask kap
115 116 # brew install --cask --no-quarantine middleclick
116 - # brew install --cask amethyst // tiling window
117 + # brew install --cask amethyst rectangle // tiling window
118 + # brew tap duongductrong/snapzy https://github.com/duongductrong/Snapzy && brew install --cask snapzy # screenshot
117 119
118 120 # https://caddy.community/t/caddy-on-mac-os-as-homebrew-service-autostart-on-system-startup/16940/2
119 121 brew install caddy
@@ -253,4 +255,3 @@ exit
253 255 [window managers] https://www.raycast.com/ | https://github.com/nikitabobko/AeroSpace
254 256 [video] https://github.com/HandBrake/HandBrake
255 257 [stats, monitor] https://github.com/exelban/stats
256 - [terminal] https://github.com/ghostty-org/ghostty

admin revised this gist 5 months ago. Go to revision

1 file changed, 4 insertions, 1 deletion

mac-install.sh

@@ -250,4 +250,7 @@ exit
250 250 [network monitor] https://github.com/GyulyVGC/sniffnet
251 251 [slideshow] https://github.com/gobbledegook/creevey
252 252 [editor]https://github.com/sinelaw/fresh
253 - [window managers] https://www.raycast.com/ | https://github.com/nikitabobko/AeroSpace
253 + [window managers] https://www.raycast.com/ | https://github.com/nikitabobko/AeroSpace
254 + [video] https://github.com/HandBrake/HandBrake
255 + [stats, monitor] https://github.com/exelban/stats
256 + [terminal] https://github.com/ghostty-org/ghostty

admin revised this gist 5 months ago. Go to revision

1 file changed, 1 insertion

mac-install.sh

@@ -250,3 +250,4 @@ exit
250 250 [network monitor] https://github.com/GyulyVGC/sniffnet
251 251 [slideshow] https://github.com/gobbledegook/creevey
252 252 [editor]https://github.com/sinelaw/fresh
253 + [window managers] https://www.raycast.com/ | https://github.com/nikitabobko/AeroSpace

admin revised this gist 5 months ago. Go to revision

1 file changed, 5 insertions, 13 deletions

mac-install.sh

@@ -31,18 +31,11 @@ brew install gh
31 31 gh auth login
32 32
33 33 ## zsh
34 - blue "Installing zsh"
35 - sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
36 -
37 - local ZSH_CUSTOM="$HOME/.oh-my-zsh/custom/plugins"
38 - git clone --depth 1 -- https://github.com/zsh-users/zsh-autosuggestions.git $ZSH_CUSTOM/zsh-autosuggestions
39 - git clone --depth 1 -- https://github.com/zsh-users/zsh-syntax-highlighting.git $ZSH_CUSTOM/zsh-syntax-highlighting
40 - git clone --depth 1 -- https://github.com/zdharma-continuum/fast-syntax-highlighting.git ${ZSH_CUSTOM}/fast-syntax-highlighting
41 - git clone --depth 1 -- https://github.com/marlonrichert/zsh-autocomplete.git $ZSH_CUSTOM/zsh-autocomplete
42 - git clone --depth 1 -- https://github.com/Aloxaf/fzf-tab $ZSH_CUSTOM/fzf-tab
34 + bash -c "$(curl --fail --show-error --silent --location https://raw.githubusercontent.com/zdharma-continuum/zinit/HEAD/scripts/install.sh)"
43 35
44 36 ## brew
45 37 blue "Installing apps"
38 +
46 39 brew install git git-gui
47 40 brew install mos ffmpeg
48 41 brew install fastlane
@@ -102,12 +95,12 @@ git lfs install --system
102 95
103 96 brew install --cask swiftformat-for-xcode
104 97 brew install --cask maccy
105 - brew install --cask xcodes
106 98 brew install --cask flameshot
107 99 brew install --cask vlc
108 100 brew install --cask localsend
109 - brew install --cask ghostty
110 101
102 + # brew install --cask ghostty
103 + # brew install --cask xcodes
111 104 # brew install --cask devtoys
112 105 # brew install --cask hiddenbar
113 106 # brew install --cask swiftbar trex multi // create web application
@@ -169,7 +162,7 @@ npm install -g terminalizer
169 162
170 163 # disk-space-analyzer
171 164 curl https://download.nektony.com/download/diskexpert/disk-space-analyzer.dmg -O
172 - open disk-space-analyzer.dmg
165 + open disk-space-analyzer.dmg > /dev/null 2&>1 &
173 166
174 167 ## sublime text
175 168
@@ -177,7 +170,6 @@ ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/loca
177 170
178 171 ## fzf
179 172 brew install fzf
180 - $(brew --prefix)/opt/fzf/install
181 173
182 174 ## dotfiles
183 175 blue "Config dotfiles https://www.atlassian.com/git/tutorials/dotfiles"

admin revised this gist 10 months ago. Go to revision

1 file changed, 1 insertion

mac-install.sh

@@ -257,3 +257,4 @@ exit
257 257 [server] https://github.com/lollipopkit/flutter_server_box
258 258 [network monitor] https://github.com/GyulyVGC/sniffnet
259 259 [slideshow] https://github.com/gobbledegook/creevey
260 + [editor]https://github.com/sinelaw/fresh

admin revised this gist 10 months ago. Go to revision

1 file changed, 1 insertion

mac-install.sh

@@ -106,6 +106,7 @@ brew install --cask xcodes
106 106 brew install --cask flameshot
107 107 brew install --cask vlc
108 108 brew install --cask localsend
109 + brew install --cask ghostty
109 110
110 111 # brew install --cask devtoys
111 112 # brew install --cask hiddenbar

admin revised this gist 1 year ago. Go to revision

1 file changed, 1 insertion

mac-install.sh

@@ -94,6 +94,7 @@ brew install source-highlight
94 94 brew install rbenv
95 95 brew install jq
96 96 brew install yq
97 + brew install scrcpy
97 98
98 99 brew install git-lfs
99 100 git lfs install

admin revised this gist 1 year ago. Go to revision

1 file changed, 14 insertions, 12 deletions

mac-install.sh

@@ -100,22 +100,24 @@ git lfs install
100 100 git lfs install --system
101 101
102 102 brew install --cask swiftformat-for-xcode
103 - brew install --cask rectangle
104 - brew install --cask alt-tab
105 103 brew install --cask maccy
106 - brew install --cask hiddenbar
107 - brew install --cask swiftbar trex multi // create web application
108 104 brew install --cask xcodes
109 - brew install --cask devtoys
110 - brew install --cask pusher
111 105 brew install --cask flameshot
112 - brew install --cask linearmouse
113 - brew install --cask iconizer
114 - brew install --cask kap
115 - brew install --cask --no-quarantine middleclick
116 - brew install --cask sequel-ace
117 - brew install --cask keycastr # keycast
118 106 brew install --cask vlc
107 + brew install --cask localsend
108 +
109 + # brew install --cask devtoys
110 + # brew install --cask hiddenbar
111 + # brew install --cask swiftbar trex multi // create web application
112 + # brew install --cask rectangle
113 + # brew install --cask alt-tab
114 + # brew install --cask pusher
115 + # brew install --cask sequel-ace
116 + # brew install --cask keycastr # keycast
117 + # brew install --cask linearmouse
118 + # brew install --cask iconizer
119 + # brew install --cask kap
120 + # brew install --cask --no-quarantine middleclick
119 121 # brew install --cask amethyst // tiling window
120 122
121 123 # https://caddy.community/t/caddy-on-mac-os-as-homebrew-service-autostart-on-system-startup/16940/2

admin revised this gist 1 year ago. Go to revision

1 file changed, 1 insertion, 1 deletion

mac-install.sh

@@ -252,4 +252,4 @@ exit
252 252 [software] https://github.com/objective-see/KnockKnock
253 253 [server] https://github.com/lollipopkit/flutter_server_box
254 254 [network monitor] https://github.com/GyulyVGC/sniffnet
255 -
255 + [slideshow] https://github.com/gobbledegook/creevey