Skip to content

Instantly share code, notes, and snippets.

View m0zgen's full-sized avatar

/:) m0zgen

View GitHub Profile
# Reference: https://superuser.com/questions/513159/how-to-remove-systemd-services
systemctl stop [servicename]
systemctl disable [servicename]
rm /etc/systemd/system/[servicename]
rm /etc/systemd/system/[servicename] # and symlinks that might be related
rm /usr/lib/systemd/system/[servicename]
rm /usr/lib/systemd/system/[servicename] # and symlinks that might be related
systemctl daemon-reload
systemctl reset-failed
# Get the latest version of pushgateway from prometheus.io, then download and extract:
$ wget https://github.com/prometheus/pushgateway/releases/download/v0.8.0/pushgateway-0.8.0.linux-amd64.tar.gz
$ tar -xvf pushgateway-0.8.0.linux-amd64.tar.gz
# Create the pushgateway user:
$ useradd --no-create-home --shell /bin/false pushgateway
# Move the binary in place and update the permissions to the user that we created:
$ cp pushgateway-0.8.0.linux-amd64/pushgateway /usr/local/bin/pushgateway
$ chown pushgateway:pushgateway /usr/local/bin/pushgateway
@m0zgen
m0zgen / macps_stop_mds_stores.txt
Created December 6, 2024 16:07
fix mds_stores high CPU
If the Spotlight is indexing data on your Mac, the mds and mds_stores will cost a relatively high CPU at that duration
1. Turning off indexing on all drives: `sudo mdutil -a -i off`
2. Stop `mds` service: `sudo launchctl stop /System/Library/LaunchDaemons/com.apple.metadata.mds.plist`
## Additional steps:
- Use [Raycast](https://www.raycast.com/)
- Disable Spotlight hotkey: System Preferences > Keyboard > Keyboard Shortcuts… > Spotlight > Uncheck “Show Spotlight search”
## Syscalls
```
sudo syscallbypid.d
```
## FS Usage
```
sudo fs_usage
```