This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo dphys-swapfile swapoff # If you don't want to reboot imediately. | |
sudo systemctl disable dphys-swapfile.service | |
sudo apt purge dphys-swapfile # No need for it now. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Edit or create a file in /etc/docker/daemon.json | |
# Modify or add | |
{ | |
"data-root": "/new/data/root/path" | |
} | |
# Restart docker |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git rebase -r --root --exec "git commit --amend --no-edit --author '[email protected]'" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# First ensure you enabled auto-activation of virtualenvs | |
# https://github.com/pyenv/pyenv-virtualenv | |
# echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.zshrc | |
# Then follow | |
# https://barker.codes/blog/adding-the-virtual-environment-name-to-your-prompt-with-oh-my-zsh/ | |
# May also face this : | |
# https://stackoverflow.com/questions/38928717/virtualenv-name-not-show-in-zsh-prompt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir -p ~/Library/KeyBindings/ | |
touch ~/Library/KeyBindings/DefaultKeyBinding.dict | |
vim DefaultKeyBinding.dict | |
# Insert | |
{ | |
"#," = ("insertText:", "."); | |
} | |
# https://ss64.com/mac/syntax-keybindings.html |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
brew install liblzma-dev | |
git clone https://github.com/pyenv/pyenv.git ~/.pyenv | |
cd ~/.pyenv && src/configure && make -C src | |
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshrc | |
echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zshrc | |
echo 'eval "$(pyenv init -)"' >> ~/.zshrc | |
eval "$(pyenv init -)" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
brew doctor | |
brew update | |
brew install libpq | |
brew link --force libpq |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
brew install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev | |
brew install libreadline-dev libffi-dev libsqlite3-dev wget libbz2-dev pkg-config liblzma-dev git | |
git clone https://github.com/pyenv/pyenv.git ~/.pyenv | |
cd ~/.pyenv && src/configure && make -C src | |
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshrc | |
echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zshrc | |
echo 'eval "$(pyenv init -)"' >> ~/.zshrc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# In /boot/firmware/config.txt (or /boot/config.txt) | |
# After [all], add | |
dtoverlay=disable-wifi | |
dtoverlay=disable-bt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask_login import login_user | |
from flask_login import logout_user | |
from flask_login import current_user | |
from werkzeug.security import check_password_hash | |
class User(Base): | |
__tablename__ = 'user' | |
id = Column(Integer, primary_key=True) |
NewerOlder