{"id":223,"date":"2020-06-24T21:08:36","date_gmt":"2020-06-24T20:08:36","guid":{"rendered":"https:\/\/blog.thomarite.uk\/?p=223"},"modified":"2020-07-17T20:21:58","modified_gmt":"2020-07-17T19:21:58","slug":"gcp-basic-debian-vm","status":"publish","type":"post","link":"https:\/\/blog.thomarite.uk\/index.php\/2020\/06\/24\/gcp-basic-debian-vm\/","title":{"rendered":"GCP &#8211; Basic Debian VM"},"content":{"rendered":"\n<p>Template for getting a basic Debian  VM with python virtualenv and pyenv. Run python3 by default<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sudo aptitude update\n$ sudo aptitude dist-upgrade\n\n$ sudo apt-get install -y python3-pip\n$ sudo apt install git\n$ sudo adduser --home \/home\/USER --shell \/bin\/bash USER\n$ sudo usermod -a -G sudo USER\n\n$ vim .bashrc\n\n#\nPython configuration\n#\npyenv\nhttps:\/\/github.com\/yyuu\/pyenv\ngit clone https:\/\/github.com\/yyuu\/pyenv.git ~\/.pyenv\ngit clone https:\/\/github.com\/yyuu\/pyenv-virtualenvwrapper.git ~\/.pyenv\/plugins\/pyenv-virtualenvwrapper\nvirtualenvwrapper\nhttp:\/\/virtualenvwrapper.readthedocs.org\/en\/latest\/\nexport PYENV_ROOT=\"$HOME\/.pyenv\"\nexport PATH=\"$PYENV_ROOT\/bin:$PATH\"\nif [ ! -d \"$PYENV_ROOT\" ];then\ngit clone https:\/\/github.com\/pyenv\/pyenv.git ~\/.pyenv\nfi\nif [ ! -d \"$PYENV_ROOT\/plugins\/pyenv-virtualenvwrapper\" ]; then\nmkdir -p $PYENV_ROOT\/plugins\ngit clone https:\/\/github.com\/yyuu\/pyenv-virtualenvwrapper.git $PYENV_ROOT\/plugins\/pyenv-virtualenvwrapper\nfi\nif type \"pyenv\" &amp;> \/dev\/null; then\neval \"$(pyenv init -)\"\n# TODO: make the prompt work for python and ruby\n__pyversion (){\nif type \"python\" > \/dev\/null; then\npyenv_python_version=$(pyenv version | sed -e 's\/ .*\/\/')\nprintf $pyenv_python_version\nfi\n}\n<code>if pyenv which pip &amp;> \/dev\/null; then pyenv virtualenvwrapper fi export PS1=\"py:\\$(__pyversion)|$PS1\"<\/code>\nfi\nexport PROJECT_HOME=~\/git\nexport PYTHONDONTWRITEBYTECODE=1\nend python\n\n$ bash\n\n$ sudo apt-get install -y --no-install-recommends make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev tcpdump tree\n\n$ pyenv install 3.7.3\n$ pyenv global 3.7.3<\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Template for getting a basic Debian VM with python virtualenv and pyenv. Run python3 by default $ sudo aptitude update $ sudo aptitude dist-upgrade $ sudo apt-get install -y python3-pip $ sudo apt install git $ sudo adduser &#8211;home \/home\/USER &#8211;shell \/bin\/bash USER $ sudo usermod -a -G sudo USER $ vim .bashrc # Python &hellip; <a href=\"https:\/\/blog.thomarite.uk\/index.php\/2020\/06\/24\/gcp-basic-debian-vm\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;GCP &#8211; Basic Debian VM&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,13],"tags":[],"class_list":["post-223","post","type-post","status-publish","format-standard","hentry","category-unix","category-aws"],"_links":{"self":[{"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/posts\/223","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/comments?post=223"}],"version-history":[{"count":1,"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/posts\/223\/revisions"}],"predecessor-version":[{"id":224,"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/posts\/223\/revisions\/224"}],"wp:attachment":[{"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/media?parent=223"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/categories?post=223"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/tags?post=223"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}