```
# Check current swap size
cat /proc/swaps
sudo swapoff -a
# Create new swap file
sudo fallocate -l 16G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
# Check again
cat /proc/swaps
```
Random useful tech stuffs I write to remind myself. Hopefully useful for you!
```
# Check current swap size
cat /proc/swaps
sudo swapoff -a
# Create new swap file
sudo fallocate -l 16G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
# Check again
cat /proc/swaps
```
Let say you have a project A that depends on an open-source library B:
A -> B
Now for your own need, you need to enhance library B in order to fit your need. So you fork it as B2:
B -> B2
While you're waiting for the maintainer of B to approve your PR, how do you configure your project A to make use of B2? Turns out it's pretty easy! Here's the step:
Once your change made it to the original repository, simply remove the replace directive! Golang is just so sweet, isn't it? :)
Source:
https://stackoverflow.com/questions/72312460/how-to-replace-a-go-module-with-a-major-version-to-a-fork-master
I recently gotten a MacBook M2 and noticed that my external monitor would start flickering when connected to it for a period of time. If the flicker is left alone, it would leave some marks on the screen (ghosting). For a while I thought that perhaps my monitor is broken (I've had it for 3 years without any problem with Intel MacBook), but it turns out that there are some people reported the same issue. Such as here.
Here's the solution that works for me:
1. Adjust external monitor brightness to at least 75% (you can use this handy freemium tool called Lunar)
2. Change external monitor color profile to "Generic RGB Profile" under display setting.
So far I've not seen the flickering with the aforementioned settings.