This repo contains notes for myself that I'd rather not spend time googling again.
- pyenv and venv for windows instructions and accompanying video
- new pyenv virtual env method
- clone or create new repo
- You can check if you already have the python version required by running
pyenv version
. If not you need to install withpyenv install x.y.z
you can see all the available versions withpyenv install --list
. I had the issue wherepyenv install --list
did not show the required version. I followed the 2nd advice in this GH Issue first tobrew upgrade pyenv
since I installed it w/ brew. However, this didn't work. Therefore I followed the first advice to getpyenv update
to work by following instruction to clone pyenv update and then ranpyenv update
which worked. - Interestingly the command below will then control both the python version and your virtual env. Don't try to set the local python version with
pyenv local x.y.z
- open in vscode
pyenv virtualenv 3.x.x name-of-repo
this will create a pyenv managed virtual environment inside the pyenv directory (not repo directory) - however from an project you can just call
pyenv activate name-of-venv
to activateit - for jupyter you will need to to
pip install ipykernel
in correct activated envpython -m ipykernel install --user --name name-of-env --display-name "name-of-env"
. Example:python -m ipykernel install --user --name ds-raster-pipeline s --display-name "ds-raster-pipelines"
- Then when you open jupyter/jupyter lab the kernel will be recognized....Note you can have just one version of jupyter installed in you base pyenv version and when you open it you will be able to access the kernels after following steps 1 & 2. I only realized I hadn't done this so I had to run:
a.
pyenv deactivate
- >pyenv which python
(to make sure i was in pyenv/3.11.4 but not project specific venv) ->pip install jupyterlab
- followed R-studio/CRAN directions for installing R
- as of 2022-09-25 Rstudio dependencies create issue Rstudio desktop installation for Ubuntu. Browsing revealed some work-arounds, but simplest option seemed to be to download directly from daily builds for Ubuntu which should work out of box. This solution was posted here.
- I downloaded
rstudio-2022.07.3-578-amd64.deb
which worked fine For getting packages up and running I followed this link... but basically: - To use
install.packages()
you need to installr-base-dev
via terminal withsudo apt install r-base-dev
- Some R packages (i.e tidyverse) depend on non R packages which should be installed via terminal first with:
sudo apt install libcurl4-openssl-dev libssl-dev libxml2-dev
- Open multiple QGIS instances at once: in terminal -
open -n /Applications/QGIS.app
- I updated QGIS and non of the layers in my local postgres db would load. Running
brew upgrade abseil
seemed to have resolved it! will report back if it broke other processes/apps
-
ssh-keygen -t rsa -b 4096 -C "<personal file comment>" -f ~/.ssh/<personal file name>
-
eval $(ssh-agent -s)
-
ssh-add ~/.ssh/<personal file name>
-
clip < ~/.ssh/<personal public name (i.e .pub)
-
go to github -> settings -> ssh key -> paste
-
ssh -T git@github.com
(should say successful) -
Repeat above steps to make another ssh key and add it to the other GH acccount
-
I tried editing config file in ~/.ssh/ folder as directed, but it does not yet seem to be picking the instructions correctly
-
at this stage I need to keep using
ssh-add
correct rsa file prior to pushing to the correct GH - it does not seem to automatically register the rsa/creds -
unclear if user would auto chage -- it seems by running global config --user.email=xxx@yyy.org this fixes ... however restarting computer also semeed to sort i out
-
first time pushing the
-u
flag seems critical (didn't work without):git push -u origin master
-
git remote set-url origin
can be used to change remote rather than removing and adding
- easier -- pretty much just follow instructions on github docs here, but basically set up the config file as in this youtube video... should look into keychain
- Important When using
git remote set-url origin
orgit clone
you need to use ssh url and include yourHost
listed in config file (12:20 in video) within the ssh url. Hint leave personal/default just as github.com and you wont need to change the url. In this case will just modify when using other accounts
- ssh-keygen -t ed25519 -C
"youremail@domain.com"
- Enter file in which to save the key (/home/{user}/.ssh/id_ed25519):
/home/{user}/.ssh/{custom_name}
- eval "$(ssh-agent -s)"
- ssh-add ~/.ssh/{custom_name} (should then say identity added)
cat ~/.ssh/{custom_name}.pub
copy contents to clipboard and make new key in GH setting- test authentication with
ssh -T git@github.com
- How to undo commit + push (from here) :
git reset --hard HEAD^
, thengit push -f
--hard
will restore to state of last commit--soft
will restore workind directory to state just before last commit (useful if you want to fix staging/commit messages)- to just unstage changes run
git reset HEAD
-- won't remove from directory just staging
- Instructions on removing .DS_Store from git tracking
- to quickly amend previous commit w/ new change (Note danger in doing this if actively collaborating):
git commit --amend --no-edit
->git push -f
I've trouble shot this same problem more than once even though it's very simple. When tar_load_everything()
gives error it's often because targets/names are no longer in pipeline. Quickest fix is targets::tar_prune()
- downloaded qgis
- homebrew install postgresql
- installed pgadmin 4 from dmg
- combine these
- https://dev.to/letsbsocial1/installing-pgadmin-only-after-installing-postgresql-with-homebrew-part-2-4k44
- https://stackoverflow.com/questions/61576670/databases-in-psql-dont-show-up-in-pgadmin4#:~:text=Try%20menu%20File%20%2D%3E%20Preferences%2C,option%20is%20at%20the%20bottom.&text=and%20then%20you%20will%20see%20your%20database%20without%20changing%20PgAdmin%20preferences.
caffeinate -i -s Rscript -e 'targets::tar_make()'
caffeinate -i -s Rscript run.R
Sometimes when running a background process in terminal that require a lot of files open in memory can run into error. In this case
-
ulimit -n 100000
# 100000 is just an example and likely way more than enough, probably smart to adjust to less. -
After updatin R to silicon arm64 version I could now longer run R out of the terminal (i.e
caffeinate -i -s Rscript -e 'targets::tar_make()'
) . This seemed to be b/c it was not correctly identifying the.libPaths()
. I messed around with.zshrc
quite a bit, but eventually only solution was justbrew uninstall r
to get rid of the homebrew version. At the time I updated to arm version it was not on hombrew.
1+fn+F13 (should be able to find mac forum add link here)
browser()
does not work interactively to debugflex_dashboard()
instead usermarkdown::run("my-dashboard.Rmd")
GH issue