Skip to content

Commit

Permalink
(OS) mac: dev frustrations
Browse files Browse the repository at this point in the history
  • Loading branch information
SensehacK committed Jul 10, 2024
1 parent cee8056 commit 54e6014
Show file tree
Hide file tree
Showing 6 changed files with 135 additions and 5 deletions.
16 changes: 14 additions & 2 deletions os/mac/Compression.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,19 @@


Zip Split Files
https://smallbusiness.chron.com/split-zip-files-os-x-56155.html

Splitting already zip file into 100MB files.
[Source](https://smallbusiness.chron.com/split-zip-files-os-x-56155.html)

```sh
zip MyArchive.zip --out SplitArchive.zip -s 100m
```

## Zip Password protected


```sh
zip -er file_name_output /Users/macStudio_Player.txt /Users/no3_5.dmg
```

> zip MyArchive.zip --out SplitArchive.zip -s 100m
[article | imore](https://www.imore.com/how-create-and-password-protect-zip-file-macos)
2 changes: 2 additions & 0 deletions os/mac/README_mac.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

[[disable_gatekeeper]]

[disk_utility](disk_utility.md)

[fresh_install](fresh_install.md)

[[hidden_files]]
Expand Down
17 changes: 15 additions & 2 deletions os/mac/codesign_app.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,19 @@ Apple removed app's certificate, so the app will crash. The current solution is

Run in Terminal

> codesign --force --deep --sign - /Applications/name.app
```sh
codesign --force --deep --sign - /Applications/name.app

You could use 'sudo' for escalated permissions.
```
You could use 'sudo' for escalated permissions.


## Cannot Open the program

If the error “Cannot open the program” appears, enter in the terminal (the application should be in the “Programs” folder):

```sh
xattr -cr /Applications/AppName.app && codesign --force --deep --sign - /Applications/AppName.app
```

The update has been completed. Please uninstall and reinstall completely.
78 changes: 78 additions & 0 deletions os/mac/disk_utility.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@


## NTFS


Mounting NTFS

Utilizing app called [Mounty](https://www.mounty.app/)

```sh
brew install --cask macfuse
brew install gromgit/fuse/ntfs-3g-mac
brew install --cask mounty
```

Had to enable / disable system extensions for macOS.


## Storage


You can check why your macOS is low on storage.

Few good links about macOS caching about everything in its system directory.
One single Xcode installation can go up to 60gigs of storage. This is pretty bad for apple hardware where Memory costs like Caviar be it Volatile (RAM, L1.*x Cache) or Non Volatile (Disk / SSD / ROM).

Luckily apple provides us two options

- One is there System Preferences -> Storage with some option to delete unused storage and cleanup extra support libraries.
- It tries to upsell iCloud Storage packages to offload mac / device storage to Cloud. Seamless integration or anti competitive - forced planned obsolescence type of stuff. You can be the judge.


I recommend few things

- [Daisy disk](https://daisydiskapp.com/)
- [Clean my Mac](os/mac/disk_utility#Clean%20my%20Mac)
- Terminal commands
- Disable Time Machine
- Delete old iOS / iPhone backups
- Enable [hidden_files](hidden_files.md)

### Support Files

Delete Phone old OS device support files, for example if you had an iOS / iPadOS / Apple TV / Vision Pro or any apple development device on a specific OS and then you upgraded from iOS 16.4 -> iOS 17.4 then Xcode or macOS has old iOS 16.4 device support files for Obj-C / Swift Headers or just for debugging symbols. That's why every time you connect a new device to xcode -> it performs this process of `Preparring for Device support`

Turns out if you have like 4 - 7 development devices for one Xcode the storage support files goes up to 20Gigs+ usually each device + OS combo accounting for 2 - 4 gigs.
You can delete them in `Apple -> System preferences app -> Developer -> Delete Device Support Files`


### Terminal Commands

`du` (disk usage) and `df` (disk free) commands


```sh
df -h | grep Gi

# Output
# /System/Volumes/Data 124Gigs
```

This grabs space occupied by `Gigs` and then you can sort that data

```sh
du -h /System/Volumes/Data | grep "G\t" | sort
```

and if you want breakdown of the folders / directory use

```sh
du -h -d 1
```

### Clean my Mac

[Clean my Mac - MacPaw](https://cleanmymac.com/)
Just make sure to disable everything else like analytics, full disk scanning, protection stuff etc & auto login. I usually use this app once in 30 days.

6 changes: 6 additions & 0 deletions os/mac/mac_commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ For checking your reboots
last reboot
```

## Keeping mac Alive

```sh
caffeinate
```


## Checking Mac Application Bundle ID

Expand Down
21 changes: 20 additions & 1 deletion os/mac/mac_os_quirks.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,23 @@ Enter your password to allow this.
sudo chown -R $USER /Applications/Slack.app
```

Or if you
Or if you



## Search with Default browser


Add automator / workflow and set it in default browser
[Stack Exchange | MacOS - system preferences](https://apple.stackexchange.com/questions/10999/search-in-google-always-open-safari-instead-of-default-browser)


Create a workflow for automator

[super user | create a shortcut for search with google](https://superuser.com/questions/369934/mac-os-x-lion-chrome-shortcut-for-search-with-google)

maybe try this app but i didn't fully config it to check whether it works perfectly
[Velja macOS app](https://apps.apple.com/ca/app/velja/id1607635845?mt=12)

Location of Automator script.
Automator Quick Actions are saved into /Users/username/Library/Services. By default, Workflows are saved in the **Workflows folder in the local library**

0 comments on commit 54e6014

Please sign in to comment.