Skip to content

Instantly share code, notes, and snippets.

@stuaxo
Last active July 31, 2018 14:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stuaxo/3275947a0cb9ef22c322f00764811c62 to your computer and use it in GitHub Desktop.
Save stuaxo/3275947a0cb9ef22c322f00764811c62 to your computer and use it in GitHub Desktop.
Set up cloud foundry python to run interactively
vh="/home/vcap/deps/0"; for fn in $vh/env/*; do f=`basename $fn` && grep -q "/deps/0" $fn && cmd="export $f=/home/vcap$(sed "s#^/[^/]*/[^/]*##" $fn)" || cmd="export $f=$(cat $fn)" && echo $cmd; $cmd; done; export LD_LIBRARY_PATH=$LIBRARY_PATH; export PATH=$vh/bin:$PATH
# Above is a oneliner that sets environment variables to use the installed python in cloudfoundry
#
# It sets environment variables from the files in /home/vcap/deps/0/envs and strips the /tmp/contents... prefix from the paths
# It then sets the PATH and LD_LIBRARY_PATH
#
# Then you can run python and it will run the installed version.
@stuaxo
Copy link
Author

stuaxo commented Feb 21, 2018

Only use one kind of quote

@stuaxo
Copy link
Author

stuaxo commented Feb 21, 2018

Don't use backquotes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment