Skip to content

Instantly share code, notes, and snippets.

View gravitymonkey's full-sized avatar

gravitymonkey gravitymonkey

View GitHub Profile
@gravitymonkey
gravitymonkey / gist:04393648c7f8f6a116a2e4d331e6d60b
Created May 23, 2024 16:12
Mistral 0.3 (May '24) with Ollama for Function Calling (ish)
# here's the RAW curl from their example in a copy/paste format to see the TOOLS response
curl -X POST http://localhost:11434/api/generate -H "Content-Type: application/json" -d '{
"model": "mistral",
"prompt": "[AVAILABLE_TOOLS] [{\"type\": \"function\", \"function\": {\"name\": \"get_current_weather\", \"description\": \"Get the current weather\", \"parameters\": {\"type\": \"object\", \"properties\": {\"location\": {\"type\": \"string\", \"description\": \"The city and state, e.g. San Francisco, CA\"}, \"format\": {\"type\": \"string\", \"enum\": [\"celsius\", \"fahrenheit\"], \"description\": \"The temperature unit to use. Infer this from the users location.\"}}, \"required\": [\"location\", \"format\"]}}}][/AVAILABLE_TOOLS][INST] What is the weather like today in San Francisco [/INST]",
"raw": true,
"stream": false
}'
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@gravitymonkey
gravitymonkey / voice_app.py
Last active September 23, 2020 15:04
script to play with google's AIY voice device
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@gravitymonkey
gravitymonkey / terminal_color_stuff.sh
Last active June 20, 2020 20:18
Terminal App setup for diff colors per environment
# get .colors.csv from here, drop it in your ~ directory
# https://gist.github.com/avillafiorita/9e626ce370e1da6c6373/revisions
# add this to .bash_profile
# remember to source .bash_profile before you use it.
# Wrapping ssh command with extra functionality
ssh() {
# list python licenses
sudo -s
pip3 install -U pip-licenses
exit
pip-licenses
# list javascript/npm licenses
npm install -g license-checker
license-checker --production --csv --direct
@gravitymonkey
gravitymonkey / gist:b1b5a604663a5c8acda0c47ab7c26604
Last active October 10, 2022 11:52
How to clean sensitive stuff out of a repo with BFG
# Check for secrets/passwords in a given repo https://github.com/dxa4481/truffleHog
truffleHog --regex --entropy=False https://github.com/gravitymonkey/your-service.git
# trufflehog is good, but there are a lot of tools for this kind of thing, maybe you want to use more than one!
# If it's got some bad stuff going on :( then you can fix it with BFG!
# before you do all of this, especially if you're going to edit old commits with BFG
# BE SURE TO LET THE USERS KNOW, so that they can keep the branch clean and know that they
# will need to update after this process is over
# set it to python 2
rm /usr/bin/python
ln -s /usr/bin/python2.7 /usr/bin/python
python --version
yum update
# set it to python 3
rm /usr/bin/python
Verifying that +gravitymonkey is my blockchain ID. https://onename.com/gravitymonkey
@gravitymonkey
gravitymonkey / mcjs_1
Created April 23, 2012 17:56
javascript to do stuff in minecraft
println(MinecraftJavascript.plugin.getServer().getIp());
@gravitymonkey
gravitymonkey / gist:2406023
Created April 17, 2012 13:40
100 most common english words, as a java string array
String[] common = {"the","of","and","a","to","in","is","you","that","it","he","was","for","on","are","as","with","his","they","I","at","be","this","have","from","or","one","had","by","word","but","not","what","all","were","we","when","your","can","said","there","use","an","each","which","she","do","how","their","if","will","up","other","about","out","many","then","them","these","so","some","her","would","make","like","him","into","time","has","look","two","more","write","go","see","number","no","way","could","people","my","than","first","water","been","call","who","oil","its","now","find","long","down","day","did","get","come","made","may","part"};