Skip to content

Instantly share code, notes, and snippets.

View bossjones's full-sized avatar
💭
Learning every damn thing I can

Malcolm Jones (bossjones/Tony Dark) bossjones

💭
Learning every damn thing I can
View GitHub Profile
@bossjones
bossjones / pip_freeze_ada_latest.txt
Created June 7, 2024 21:53
pip_freeze_ada_latest.txt
aiohttp==3.9.5
aiosignal==1.3.1
annotated-types==0.7.0
anyio==4.4.0
asr_python==0.4.1
async-timeout==4.0.3
attrs==23.2.0
beautifulsoup4==4.10.0
blinker==1.8.2
boto3==1.34.122
from langchain_core.messages import HumanMessage, SystemMessage, AIMessage
from .chat_history import *


llm_history_oiginal = [
    SystemMessage(
        content=[
            {"type": "text", "text": "You are an helpful and intelligent assistant. But converting your text to the speech process can be long so please make short your answers as possible."},
 {"type": "text", "text": "Answer with maximum 3 sentences. Also please feel free to use tools."},
#!/usr/bin/env bash
###
# @Author: Cloudflying
# @Date: 2023-03-27 20:24:49
# @LastEditTime: 2024-05-01 09:14:45
# @LastEditors: Cloudflying
# @Description: Node Init
###
_install() {
@bossjones
bossjones / pre-reqs.zsh
Created May 15, 2024 22:36
pre-reqs.zsh for setting up pyenv etc
#!/usr/bin/env bash
#/ Usage: bin/zsh-dotfiles-prereq-installer [--debug]
export ZSH_DOTFILES_PREP_CI=1
export ZSH_DOTFILES_PREP_DEBUG=1
export ZSH_DOTFILES_PREP_GITHUB_USER=bossjones
export ZSH_DOTFILES_PREP_SKIP_BREW_BUNDLE=1
# Colors
ESC_SEQ="\x1b["
@bossjones
bossjones / async.py
Created May 15, 2024 14:28 — forked from iedmrc/async.py
Python turn sync functions to async (and async to sync)
import functools
import asyncio
from concurrent.futures import ThreadPoolExecutor
def to_async(func):
"""Turns a sync function to async function using event loop"""
@functools.wraps(func)
async def run(*args, loop=None, executor=None, **kwargs):
if loop is None:
@bossjones
bossjones / install_slack_cli.sh
Created April 10, 2024 14:29
install_slack_cli.sh
# Instructions: https://api.slack.com/automation/quickstart
# check permissions of your /usr/local/bin dir (slack needs /usr/local/bin to be owned by the user)
# should look like:
# # before
# ❯ ls -lta /usr/local/ | grep bin
# drwxr-xr-x 20 root wheel 640 Mar 20 10:37 bin
# # after
# ❯ ls -lta /usr/local/ | grep bin
@bossjones
bossjones / example_check_existence_of_command.sh
Created March 20, 2024 15:36
example_check_existence_of_command.sh
#!/usr/bin/env bash
# SOURCE: https://github.com/kodekloudhub/certified-kubernetes-administrator-course/blob/master/kubeadm-clusters/apple-silicon/deploy-virtual-machines.sh
# When VMs are deleted, IPs remain allocated in dhcpdb
# IP reclaim: https://discourse.ubuntu.com/t/is-it-possible-to-either-specify-an-ip-address-on-launch-or-reset-the-next-ip-address-to-be-used/30316
ARG=$1
set -euo pipefail
# Set the build mode
@bossjones
bossjones / get_images_via_chrome_console.js
Created December 12, 2023 03:16
get_images_via_chrome_console.js
function img_find() {
return Array.from(document.getElementsByTagName("img")).map(i => i.src);
}
img_find()
@bossjones
bossjones / weave_scope_plugins.sh
Created December 11, 2023 23:37
install weave scope plugins
docker pull weaveworksplugins/scope-iowait:latest
docker run --rm -ti \
--net=host \
-v /var/run/scope/plugins:/var/run/scope/plugins \
--name weaveworksplugins-scope-iowait weaveworksplugins/scope-iowait:latest
docker pull weaveworksplugins/scope-http-statistics:latest
sudo docker run --rm -it \
--privileged --net=host --pid=host \
-v /lib/modules:/lib/modules \
@bossjones
bossjones / security_onion_logs.sh
Created December 11, 2023 02:12
get all security onion logs
cd /opt/so/log
tail -f $(find . ! \( -name "*.gz" \) -type f -print) | ccze -A