## to get the ip address of a network:
curl ifconfig.me
## to use kepler:
http://10.10.10.249:8080/
## to tunnel to mapc network when at their office:
ssh -L 5432:localhost:5434 10.10.10.249
## when at school use this ip to connect:
ssh -L 127.0.0.1:5434:0.0.0.0:5434 -N ubuntu@104.207.208.49
ubuntu@104.207.208.49's password:Mapc1234
insert into python:
engine = sqlalchemy.create_engine("postgresql://postgres@127.0.0.1:5434/limedata")
## MAPC grapphopper:
tunnel:
ssh -L 127.0.0.1:8005:0.0.0.0:8000 -N ubuntu@104.207.208.49
then:
http://127.0.0.1:8005/maps/
## to use ogr to change geojson to shapefile:
ogr2ogr -F "ESRI Shapefile" filename.shp lime_lines_263_264.json
##
eval "$(/home/bita/anaconda3/bin/conda shell.bash hook)"
### To add base permanently to the home directory/ls -a/ ---> .bashrc
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi
# added by Anaconda3 5.3.1 installer
# >>> conda init >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$(CONDA_REPORT_ERRORS=false '/home/bita/anaconda3/bin/conda' shell.bash hook 2> /dev/null)"
if [ $? -eq 0 ]; then
\eval "$__conda_setup"
else
if [ -f "/home/bita/anaconda3/etc/profile.d/conda.sh" ]; then
. "/home/bita/anaconda3/etc/profile.d/conda.sh"
CONDA_CHANGEPS1=false conda activate base
else
\export PATH="/home/bita/anaconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda init <<<
## To connect to the database:
psql -U bita -d limedatadb
psql -h 0.0.0.0 -p 5434 -U postgres ---> this one has postgis on it when in the 10.10.10.249 server
## to split the propulsion_type column:
right( "propulsion_type" , length( "propulsion_type" ) -(strpos( "propulsion_type" , ','))) --> 'electric_assist']'
left("pro_", strpos("pro_", ']')-1)
final: left(right( "propulsion_type" , length( "propulsion_type" ) -(strpos( "propulsion_type" , ','))-1), strpos(right( "propulsion_type" , length( "propulsion_type" ) -(strpos( "propulsion_type" , ','))), ']')-2)
"kd" LIKE '''electric'''
## Generetaing a public key
ssh-keygen -t rsa -b 4096
## and then add the output of the below to the server config file
cat ~/.ssh/id_rsa.pub
## to change view of your server
~/.bashrc
export PAGER=less
export LESS="-S"