If using Catalina
sudo mkdir -p /System/Volumes/Data/nix
sudo chown -R `whoami` /System/Volumes/Data/nix
echo "nix\t/System/Volumes/Data/nix" | sudo tee /etc/synthetic.conf
# sudo apt-get install libfontenc1 xfonts-75dpi xfonts-base xfonts-encodings xfonts-utils openssl build-essential libssl-dev libxrender-dev git-core libx11-dev libxext-dev libfontconfig1-dev libfreetype6-dev fontconfig -y | |
# https://github.com/wkhtmltopdf/wkhtmltopdf/releases | |
if [ "$(uname -s)" = "Darwin" ]; then | |
# For Mac | |
cd ~ | |
wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox-0.12.5-1.macos-cocoa.pkg | |
sudo installer -verbose -pkg wkhtmltox-0.12.5-1.macos-cocoa.pkg -target / |
sudo mkdir -p /System/Volumes/Data/nix
sudo chown -R `whoami` /System/Volumes/Data/nix
echo "nix\t/System/Volumes/Data/nix" | sudo tee /etc/synthetic.conf
Tested using PyCharm PyCharm 2018.3.7 (Professional Edition).
Note: Commands that are being run, need to be run in nix shell
Python:
which python
and update this in Preferences -> Project: project_name
-> Project Interpreter ->
Gear Icon -> Add -> Virtual Environment -> Existing Environment -> ...
-> Add.Rust:
""" | |
Middleware to log `*/api/*` requests and responses. | |
""" | |
import socket | |
import time | |
import json | |
import logging | |
request_logger = logging.getLogger(__name__) |
dir="$1" | |
for f in "$dir"/*; do | |
#filename="${cat '$f'}" | |
filename=${f:13:10} # string of length 10 from index 13 | |
arrIN=(${filename//-/ }) # split by "-" | |
reversefilename="${arrIN[2]}-${arrIN[1]}-${arrIN[0]}" | |
reversef="journal/2021/${reversefilename}.md" | |
mv $f $reversef | |
#echo $reversefilename | |
done |