Skip to content

Commit

Permalink
switch to type
Browse files Browse the repository at this point in the history
  • Loading branch information
johnko committed Feb 6, 2025
1 parent f7b9aba commit 15ece52
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 15 deletions.
9 changes: 6 additions & 3 deletions .continue/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,14 @@
}
],
"embeddingsProvider": {
"apiBase": "http://127.0.0.1:11434",
"model": "nomic-embed-text:137m-v1.5-fp16",
"provider": "ollama"
"provider": "ollama",
"title": "embed local network"
},
"models": [
{
"apiBase": "http://192.168.2.74:11434",
"apiBase": "http://127.0.0.1:11434",
"model": "qwen2.5-coder:32b-instruct-q8_0",
"provider": "ollama",
"title": "local network"
Expand Down Expand Up @@ -86,8 +88,9 @@
}
],
"tabAutocompleteModel": {
"apiBase": "http://127.0.0.1:11434",
"model": "qwen2.5-coder:32b-base-q8_0",
"provider": "ollama",
"title": "tab qwen2.5-coder:32b-base-q8_0"
"title": "tab local network"
}
}
4 changes: 2 additions & 2 deletions bin/get-ip
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/usr/bin/env bash
set -euo pipefail

if which ifconfig 2>&1 >/dev/null ; then
if type ifconfig &>/dev/null ; then
ifconfig | grep -v '127\.0\.0\.' | sed -e 's;broadcast.*;;' -e 's;Bcast.*;;' -e 's;netmast.*;;' -e 's;Mask.*;;' | grep -o -E '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}'
elif which networkctl 2>&1 >/dev/null ; then
elif type networkctl &>/dev/null ; then
networkctl status 2>&1 | grep -v -E '(docker|carrier|Link)' | grep -v 'Gateway' | grep ' on ' | grep -o -E '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}'
fi
4 changes: 2 additions & 2 deletions bin/get-nic
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/usr/bin/env bash
set -euo pipefail

if which ifconfig 2>&1 >/dev/null ; then
if type ifconfig &>/dev/null ; then
ifconfig | grep -v -E '(^lo0|lo0 | ::1 | 127\.0\.0\.1 )' | grep -E '(^[a-z]|inet )' | grep -B1 'inet' | sed 's/flags=.*UP,/UP,/' | sed 's/UP,.*//' | sed "s, netmask,\n netmask," | sed "s, broadcast,\n broadcast,"
elif which networkctl 2>&1 >/dev/null ; then
elif type networkctl &>/dev/null ; then
networkctl status 2>&1 | grep -v -E '(docker|carrier|Link)'
fi
2 changes: 1 addition & 1 deletion bin/macos-brew-update.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -euo pipefail

if which brew >/dev/null 2>&1 ; then
if type brew &>/dev/null ; then
if [[ -e Brewfile ]] ; then
set -x
brew bundle || true
Expand Down
11 changes: 11 additions & 0 deletions bin/macos-ollama-server.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash
set -euo pipefail

export OLLAMA_HOST=`get-ip`:11434

if type ollama &>/dev/null ; then
ollama serve
else
echo "ERROR: missing 'ollama'"
exit 1
fi
2 changes: 1 addition & 1 deletion bin/macos-setup/macos-podmandesktop-init.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -euo pipefail

if which podman >/dev/null 2>&1 ; then
if type podman &>/dev/null ; then
set -x
podman machine init
podman machine start
Expand Down
4 changes: 2 additions & 2 deletions bin/setup-python3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ if command -v apt-get >/dev/null 2>&1 ; then
export DEBIAN_FRONTEND=noninteractive
# Dependency for virtualenv
sudo apt-get install --yes build-essential python-dev libffi-dev
which virtualenv || sudo apt-get install --yes python-virtualenv
type virtualenv &>/dev/null || sudo apt-get install --yes python-virtualenv
# Dependency for ansible
sudo apt-get install --yes libssl-dev
fi
Expand All @@ -32,7 +32,7 @@ echo "=> Detecting pip3, pip2 or pip..."
command -v pip >/dev/null 2>&1 && PIP_BIN="pip"
command -v pip3 >/dev/null 2>&1 && PIP_BIN="pip3"

if ! which python | grep -q ${VENV_FOLDER} ; then
if ! type python | grep -q ${VENV_FOLDER} ; then
echo "!! Failed to use venv"
exit 1
fi
Expand Down
4 changes: 2 additions & 2 deletions bin/ubuntu-container.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/usr/bin/env bash
set -eux

if which docker >/dev/null 2>&1 ; then
if type docker &>/dev/null ; then
DOCKER_BIN=docker
else
if which podman >/dev/null 2>&1 ; then
if type podman &>/dev/null ; then
DOCKER_BIN=podman
fi
fi
Expand Down
4 changes: 2 additions & 2 deletions bin/ubuntu-create-cloudinit-iso.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/usr/bin/env bash
set -eux

if which docker >/dev/null 2>&1 ; then
if type docker &>/dev/null ; then
DOCKER_BIN=docker
else
if which podman >/dev/null 2>&1 ; then
if type podman &>/dev/null ; then
DOCKER_BIN=podman
fi
fi
Expand Down

0 comments on commit 15ece52

Please sign in to comment.