babashka

mal 2025-06-05T03:55:14.311139Z

Anyone messed around with this online Codex thing https://chatgpt.com/codex? I got bb to run - took all day the struggle was real.. šŸ˜„ but to save you a day… Environment variables (now some of these aren’t needed as they were to try get clj to work - rlwraps got some issues): term dumb INSIDE_EMACS 1 JAVA_OPTS -http://Djavax.net.ssl.trustStore=/usr/local/share/ca-certificates/custom-truststore.jks -http://Djavax.net.ssl.trustStorePassword=$truststorepw BABASHKA_JAVA_OPTS -Dhttps.proxyHost=proxy -Dhttps.proxyPort=8080 Secrets: truststorepw INSERTYOURPASSWORDHERE Setup Script:

# since container image "universal" is based on Ubuntu 24.04
# clj <3's rlwrap
# rlwrap invoked via clj -h isn't happy with terminal width of 0...
# didnt work: stty cols 80 rows 24 will have to keep trying, back to work...

# aight bb has issues with the certs in this environment cuz its proxy has its own
# from curl -v  -o /dev/null
# * Uses proxy env variable no_proxy == 'localhost,127.0.0.1,::1'
# * Uses proxy env variable https_proxy == ''
# ... PKIX path building failed: unable to find valid certification path
# workaround
# 1. Identify path to the cert (from earlier)
CERT=/usr/local/share/ca-certificates/envoy-mitmproxy-ca-cert.crt
# 2. Create a JVM-compatible truststore
keytool -importcert -noprompt -trustcacerts \
  -alias mitmproxy \
  -file $CERT \
  -keystore /usr/local/share/ca-certificates/custom-truststore.jks \
  -storepass $truststorepw
# now to run bb or set in environment variables above...
# JAVA_OPTS="-Djavax.net.ssl.trustStore=/usr/local/share/ca-certificates/custom-truststore.jks -Djavax.net.ssl.trustStorePassword=$truststorepw" bb test.clj
# Or globally:
# export JAVA_OPTS="-Djavax.net.ssl.trustStore=..."
apt-get update -qq && \
apt-get install -y --no-install-recommends rlwrap ca-certificates && \
apt-get clean && rm -rf /var/lib/apt/lists/*
# install clojure (java 21 on system already)
# curl -L  install.sh | bash -s -- --prefix /usr/local
# curl -L -O 
# curl -L -O 
# chmod +x posix-install.sh
# sudo ./posix-install.sh
# set the version once so you can reuse it
### curl -L -O 
### chmod +x linux-install.sh
### sudo ./linux-install.sh
# bb looking for this version of clojure above latest is listed at 
# 
ver=1.12.0.1530
## dest="/root/.deps.clj/$ver/ClojureTools"
# make sure the destination directory is there
## mkdir -p "/root/.deps.clj/$ver"
## mkdir -p "$dest"
# download the ZIP/jar
## curl -L "" \
##      -o  "$dest/clojure-tools.zip" && 
## unzip -q "$dest/clojure-tools.zip" -d "/root/.deps.clj/$ver/"
# cd $dest
# ls -al
# let's do some java
which java
java --version
# let's do some clojure!!! 
clojure_version="1.12.0.1530"
curl -O 
chmod +x ./linux-install-$clojure_version.sh
sudo ./linux-install-${clojure_version}.sh
mkdir -p /root/.deps.clj/1.12.0.1530/ClojureTools
cd /root/.deps.clj/1.12.0.1530/ClojureTools
curl -LO 
unzip clojure-tools.zip
# let's do some ba*bash*ka
# see maven thru proxy
export HTTPS_PROXY=
export HTTP_PROXY=
curl -sLO 
chmod +x install
./install
bb -e '(+ 1 2 3)'
## or 
# echo '(println "It works!")' > test.clj
# bb test.clj

mal 2025-06-05T04:04:19.847979Z

the output… with the password scrubbed (not sure I even needed the keystore in the end since I ended up downloading the clojure tools in the setup script)

borkdude 2025-06-05T08:49:46.883359Z

Thanks for sharing. Next time please include the full screen of code you pasted in this channel in the gist too :)

šŸ‘ 1
mal 2025-06-05T13:02:33.774969Z

It was late I’d been at it all day I did’t want to Fermat’s last theorem it. :)

šŸ˜† 2