Skip to content

Instantly share code, notes, and snippets.

View bearlike's full-sized avatar
πŸ„
+1UP

Krishnakanth Alagiri bearlike

πŸ„
+1UP
View GitHub Profile
@bearlike
bearlike / ToolCreator_Prompt_Template.md
Created September 21, 2024 08:43
Prompt Template for creating a new OpenWebUI tool

Below is an example of a tool that can be used with the OpenWebUI LLM. You must understand how the below code works and create a new well-documented tool that provides the desired functionality based on the new user requirement. Functions in the Tools class are exposed to LLM for tool selection. Functions in the Utils class are not exposed to LLM and are meant to be used as development helper functions. The EventEmitter class is used to emit events to the OpenWebUI. The Valves class is used to define the user configuration parameters for the tool. The some_functionality_exposed_to_LLM function is an example of a function that is exposed to the LLM. The some_helper_function_not_exposed_to_LLM function is an example of a function that is not exposed to the LLM. The main function is an example of how to run the tool locally. The main function is not exposed to the LLM. Each function in Tools represents a new exposed function to the LLM. There can be many functions in Tools available for LLM f

@bearlike
bearlike / qb_tool_webui.py
Created September 20, 2024 22:22
Explore Torrents managed by my qBittorrent Instance. Tool for OpenWebUI
"""
title: Explore Torrents managed by my qBittorrent Instance. Tool for OpenWebUI
author: KK
funding_url: https://github.com/bearlike
version: 0.1.3
license: MIT
"""
from qbittorrent import Client
from pydantic import BaseModel, Field
@akaanirban
akaanirban / gist:621e63237e63bb169126b537d7a1d979
Last active March 22, 2022 00:40
Install pyTorch in Raspberry Pi 4 (or any other)

Edit 04/11/2021: This gist is quite old now. The current version of PyTorch is 1.8.1, which is miles ahead of version 1.0.1 that I was trying to install when I wrote this gist. Therefore some of the instructions may not apply, or some dependencies may have changed or bugs taken care of. I do not currently have a Raspberry Pi to verify unfortunately. Please proceed with caution. Further, there are may others who have shared their fixes, and direct links to their wheels down in the comments. Cheers !

Install the prerequisites (the last one for numpy):

sudo apt install libopenblas-dev libblas-dev m4 cmake cython python3-yaml libatlas-base-dev

Increase the swap size:

  • Stop the swap : sudo dphys-swapfile swapoff
  • Modify the size of the swap by editing as root the following file : /etc/dphys-swapfile. Modify the valiable CONF_SWAPSIZE and change its value to CONF_SWAPSIZE=2048
@ruario
ruario / 1-README.md
Last active August 8, 2024 12:41
A script that fetches a ChromeOS image for ARM32 and extracts the Widevine binary, saving it in a compressed archive for use with Vivaldi

The included script 'widevine-flash_armhf.sh' fetches a ChromeOS image for ARM and extracts the Widevine binary, saving it in a compressed archive. Since it downloads a fairly large file (2Gb+ on disk after download) it is recommended that you run the script on a machine that has plenty of disk space.

To install the resultant archive, issue the following on your ARM machine–after copying over the archive if needed:

sudo tar Cfx / widevine-flash-20200124_armhf.tgz

(Where 'widevine-flash-20200124_armhf.tgz' is updated to reflect the actual name of the created archive)

@tycho
tycho / python36-win-arm64.patch
Created March 22, 2018 18:23
Windows 10 ARM64 - Python 3.6
These are the deltas required for the python.props file to build for ARM64 on Windows. You still need to add
the ARM64 platform definitions to the solution/project files before you can build, though.
diff --git a/PCbuild/python.props b/PCbuild/python.props
index 16a7672315..d865c86211 100644
--- a/PCbuild/python.props
+++ b/PCbuild/python.props
@@ -74,7 +74,8 @@
-->
<_RegistryVersion>$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v10.0@ProductVersion)</_RegistryVersion>
@saurabhwahile
saurabhwahile / zerodha_to_moneycontrol.py
Last active November 5, 2024 15:57
Script for importing zerodha stocks in xlsx to moneycontrol csv if you want to use moneycontrol terminal
#You'll still have to manually enter dates here, as the xlsx file from zerodha does not show dates(SIP of stocks causes multiple dates)
#EDIT: Usage python zerodha_to_moneycontrol.py <FILENAME>
import sys
from openpyxl import load_workbook
wb = load_workbook(sys.argv[1])
ws = wb.active
csv_list = [["BSE/NSE/ISIN Code","Buy Date","Buy Quantity","Buy Price",]]
@byrnedo
byrnedo / check_docker_newer_tag.sh
Created April 7, 2016 07:08
Check if newer docker image available.
#!/bin/bash
# ensure running bash
if ! [ -n "$BASH_VERSION" ];then
echo "this is not bash, calling self with bash....";
SCRIPT=$(readlink -f "$0")
/bin/bash $SCRIPT
exit;
fi
@Integralist
Integralist / Code of Conduct.md
Last active December 10, 2021 17:00
Code of Conduct (Template)

Code of Conduct

A code of conduct is a set of rules outlining the social norms and rules and responsibilities of, or proper practices for, an individual, party or organization

Summary

The {NAME} is dedicated to providing a harassment-free working environment for all, regardless of gender, sexual orientation, disability, physical appearance, body size, race, or religion. We do not tolerate harassment of any form. All communication should be appropriate for a professional audience including people of many different backgrounds.

Sexual language and imagery is not appropriate for any communication and/or talks. Be kind and do not insult or put down others. Behave professionally. Remember that harassment and sexist, racist, or exclusionary jokes are not appropriate for {NAME}. Staff violating these rules should be reported to an appropriate line manager.

@rxaviers
rxaviers / gist:7360908
Last active April 27, 2025 13:37
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: πŸ˜„ :smile: πŸ˜† :laughing:
😊 :blush: πŸ˜ƒ :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
πŸ˜† :satisfied: 😁 :grin: πŸ˜‰ :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: πŸ˜€ :grinning:
πŸ˜— :kissing: πŸ˜™ :kissing_smiling_eyes: πŸ˜› :stuck_out_tongue: