17
brew China mirrors
China blocks git, so we need to use mirrors for brew.sh install
Tsinghua and Aliyun both host mirrors. Aliyun seems faster, so we will use that below.
USTC Mirror – https://mirrors.ustc.edu.cn/help/brew.git.html
Aliyun Mirror – https://mirrors.aliyun.com/homebrew/
#install brew from ustc
/bin/bash -c “$(curl -fsSL https://mirrors.ustc.edu.cn/misc/brew-install.sh)”
#install tap for brew cask upgrade mirror
brew tap –custom-remote –force-auto-update buo/cask-upgrade https://gitcode.com/gh_mirrors/ho/homebrew-cask-upgrade/
#set aliyun mirror for brew and update
export HOMEBREW_INSTALL_FROM_API=1
export HOMEBREW_API_DOMAIN=”https://mirrors.aliyun.com/homebrew-bottles/api”
export HOMEBREW_BREW_GIT_REMOTE=”https://mirrors.aliyun.com/homebrew/brew.git”
export HOMEBREW_CORE_GIT_REMOTE=”https://mirrors.aliyun.com/homebrew/homebrew-core.git”
export HOMEBREW_BOTTLE_DOMAIN=”https://mirrors.aliyun.com/homebrew/homebrew-bottles”
brew update
#alternately use ustc
export HOMEBREW_BREW_GIT_REMOTE=”https://mirrors.ustc.edu.cn/brew.git”
export HOMEBREW_CORE_GIT_REMOTE=”https://mirrors.ustc.edu.cn/homebrew-core.git”
export HOMEBREW_BOTTLE_DOMAIN=”https://mirrors.ustc.edu.cn/homebrew-bottles”
export HOMEBREW_API_DOMAIN=”https://mirrors.ustc.edu.cn/homebrew-bottles/api”
brew update
#add aliyun mirror permanently into zsh
echo ‘export HOMEBREW_INSTALL_FROM_API=1’ >> ~/.zshrc
echo ‘export HOMEBREW_API_DOMAIN=”https://mirrors.aliyun.com/homebrew-bottles/api”‘ >> ~/.zshrc
echo ‘export HOMEBREW_BREW_GIT_REMOTE=”https://mirrors.aliyun.com/homebrew/brew.git”‘ >> ~/.zshrc
echo ‘export HOMEBREW_CORE_GIT_REMOTE=”https://mirrors.aliyun.com/homebrew/homebrew-core.git”‘ >> ~/.zshrc
echo ‘export HOMEBREW_BOTTLE_DOMAIN=”https://mirrors.aliyun.com/homebrew/homebrew-bottles”‘ >> ~/.zshrc
source ~/.zshrc
#update brew, casks
brew update; brew upgrade; brew cu -af;
Journalctl keeps logs on the servers for systemd.
The default settings can lead to too much disk space use. Logs are good to have, but the default settings are unlimited, and if you do not watch out they can get up to gigabytes in size. A more reasonable default is 100M, as this will still allow you to debug any non-running systemd scripts and not take up too much valuable disk space.
To reduce journalctl disk usage, we can clean up the un-needed logs, and optionally reduce the disk space needed to keep logs.
To Show disk usage:
journalctl --disk-usage
To clean up disk usage (to 100M in size):
journalctl --vacuum-size=100M
To make this the default for future, we can edit the systemd journald settings and set the logs to a more reasonable size.:
pico /etc/systemd/journald.conf
//Uncomment the SystemMaxUse line and set to 100M
SystemMaxUse=100M
//Save and exit CTRL O, CTRL X, Enter to save
//Finally restart systemd
systemctl restart systemd-journald
Note: Logs can be seen by checking one of the running services. These usually sit in /etc/systemd/system or /etc/systemd/user.
e.g. to check php 8.3 fpm service logs
journalctl -xeu php8.3-fpm.service
Archives
- November 2024
- November 2019
- October 2019
- August 2019
- April 2019
- February 2017
- September 2016
- June 2016
- May 2016
- September 2015
- August 2015
- June 2015
- April 2015
- December 2014
- October 2014
- September 2014
- July 2014
- June 2014
- April 2014
- October 2013
- July 2013
- May 2013
- April 2013
- March 2013
- January 2013
- December 2012
- October 2012
- August 2012
- July 2012
- June 2012
- May 2012
- April 2012
- March 2012
- December 2011
- November 2011
- October 2011
- September 2011
- July 2011
- May 2011
- April 2011
- March 2011
- February 2011
- January 2011
- December 2010
- November 2010
- October 2010
- September 2010
- August 2010
- July 2010
- June 2010
- May 2010
- April 2010
- March 2010
- February 2010
- January 2010
- December 2009
- November 2009
- October 2009
- May 2009
- April 2009
- March 2009
- February 2009
- January 2009
- December 2008
- November 2008
- October 2008
- September 2008
Categories
- Apple
- Arcade Machines
- Badges
- BMW
- China Related
- Cool Hunting
- Exploits
- Firmware
- Food
- General Talk
- government
- IP Cam
- iPhone
- Lasers
- legislation
- MODx
- MySQL
- notice
- qmail
- requirements
- Reviews
- Service Issues
- Tao Bao
- Technical Mumbo Jumbo
- Things that will get me censored
- Travel
- Uncategorized
- Useful Info