1. Setup ODBC on your Mac (including Apple Silicon)
Install brew
unixodbc
package from brew
works for Apple Silicon
# Running multipass on a mac (M1) | |
# minconda won't work since the conda does not support a linux os on M1 | |
# use pyenv to get the python version need (3.12 here) | |
# use python venv to creat a virtual environment | |
# install pyenv | |
sudo apt update; sudo apt install build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev curl libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev | |
curl https://pyenv.run | bash |
1. Setup ODBC on your Mac (including Apple Silicon)
Install brew
unixodbc
package from brew
works for Apple Silicon
# Got ... | |
# | |
#ImportError: dlopen(/Users/erikvw/miniconda3/envs/edc-dev/lib/python3.9/site-packages/cups.cpython-39-darwin.so, 0x0002): Symbol not found: _libiconv | |
# Referenced from: /Users/erikvw/miniconda3/envs/edc-dev/lib/python3.9/site-packages/cups.cpython-39-darwin.so | |
# Expected in: /usr/lib/libiconv.2.dylib | |
# | |
# | |
# Before building pycups ... | |
# install cups from brew |
AWS_ACCESS_KEY_ID=
AWS_DEFAULT_ACL=None
AWS_ENABLED=False
AWS_LOCATION=mocca/static
AWS_S3_CUSTOM_DOMAIN=
AWS_S3_ENDPOINT_URL=
AWS_SECRET_ACCESS_KEY=
AWS_STORAGE_BUCKET_NAME=
CDN_ENABLED=False
export PS1="\u@\h:\w$ " | |
function parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\*\1/' | |
} | |
if [ "$color_prompt" = yes ]; then | |
PS1='\[\033[01;36m\]\u@\[\033[00m\]:\[\033[01;33m\]\w\[\033[0;35m\]-($(parse_git_branch))\[\033[00m\]\$ ' | |
else | |
PS1='\u@\h:\w$(parse_git_branch)\$ ' |
. "$HOME/.duplicity/.env_variables.conf" | |
duplicity list-current-files $AWS_ENDPOINT/$AWS_BUCKET | |
unset AWS_ACCESS_KEY_ID | |
unset AWS_SECRET_ACCESS_KEY | |
unset AWS_ENDPOINT | |
unset AWS_BUCKET | |
unset GPG_KEY | |
unset PASSPHRASE |
# restores archive file to the given folder. | |
# then run mysql dbname < archive_file.sql | |
. "$HOME/.duplicity/.env_variables.conf" | |
# note will fail if file exists | |
duplicity --verbosity info \ | |
--encrypt-sign-key=$GPG_KEY \ | |
--log-file $HOME/.duplicity/info.log \ | |
--file-to-restore $1 \ |
export AWS_ACCESS_KEY_ID= | |
export AWS_SECRET_ACCESS_KEY= | |
export AWS_BUCKET= | |
export AWS_ENDPOINT= | |
export GPG_KEY= | |
export PASSPHRASE= | |
export DB_NAME= | |
export DB_DATE=$(date +%Y%m%d%H%M%S) | |
export BACKUP_DIR=$HOME/mysql_backup/ | |
export DB_FILE=$BACKUP_DIR$DB_NAME-$DB_DATE.sql |
#!/bin/bash | |
# ###################################################### | |
# Use duplicity to backup all files in BACKUP_DIR | |
# | |
# 1. run mysqldump | |
# 2. transfer all *.sql files to AWS_BUCKET w/ duplicity | |
# 3. remove all files older than 7 days | |
# | |
# ###################################################### |
migrate="" | |
update_permissions="" | |
update_ubuntu="" | |
green=`tput setaf 2` | |
reset=`tput sgr0` | |
eval "$(conda shell.bash hook)" | |
read -p "Version? [master]" version | |
if [ "${version}" = "" ]; then |