import os
from openai import OpenAI
from pprint import pprint
from IPython.display import display, Markdown| description | Beast Mode with web fetching | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| tools |
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # http://editorconfig.org | |
| # directory where .editorconfig resides is top level of project | |
| root = true | |
| [*] | |
| indent_style = space | |
| indent_size = 2 | |
| end_of_line = lf | |
| charset = utf-8 | |
| trim_trailing_whitespace = true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // this works in the browser console, | |
| // when the modal dialog is visible | |
| // after clicking on the "i" button for a frontendusergroup | |
| function filterTableRows(tableDiv) { | |
| if (!tableDiv) { console.error(`selector 'div.table-fit' not found!`); return; } | |
| const table = tableDiv.querySelector('table'); | |
| if (!table) { console.error(`table contains no data`); return; } | |
| const headers = table.querySelectorAll('thead th'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| url=$1 | |
| # if no url is provided, exit | |
| if [ -z "$url" ]; then | |
| echo "No URL provided" | |
| exit 1 | |
| fi | |
| subtitle_url=$(yt-dlp -q --skip-download --convert-subs srt --write-sub --sub-langs "en" --write-auto-sub --print "requested_subtitles.en.url" "$url") | |
| content=$(curl -s "$subtitle_url" | sed '/^$/d' | grep -v '^[0-9]*$' | grep -v '\-->' | sed 's/<[^>]*>//g' | tr '\n' ' ') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| export WEBKIT_DISABLE_DMABUF_RENDERER=1 && /opt/cisco/anyconnect/bin/vpnui | |
| # | |
| # Fix for Cisco AnyConnect VPN client GUI startup bug on Linux | |
| # AnyConnect 4.10.05111 displays blank page instead of SSO login | |
| # https://community.cisco.com/t5/vpn/anyconnect-4-10-05111-displays-blank-page-instead-of-sso-login/td-p/4648440 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| curl -LOC myurl | |
| # - L: folllow redirects | |
| # - O: use Original Remote Filename | |
| # - C: Continue interrupted downloads | |
| wget -bc myurl | |
| # -b : do it in background | |
| # -c : continue broken downloads |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Speech to text with Whisper model using OpenAI API | |
| # Assumes that the OpenAI API key is set as an environment variable | |
| # Usage: ./speech2text-whisper.sh input_audio_file | |
| # Check if an input argument is provided and validate the file extension | |
| if [ -z "$1" ]; then | |
| echo "Error: No input file provided. Please specify an audio file (MP3, WAV, etc.) as the first argument." | |
| exit 1 | |
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| RECRAFT_API_KEY=YOU_MUST_REPLACE_THIS_WITH_YOUR_API_KEY | |
| now=$(date +"%Y%m%d_%H%M%S") | |
| logo_description_outfile=logo_description_$now.svg | |
| temp_response_file=response_$now.json |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| RECRAFT_API_KEY=... | |
| now=$(date +"%Y%m%d_%H%M%S") | |
| # Check if an input argument is provided and validate the file extension | |
| if [ -z "$1" ]; then | |
| echo "Error: No input file provided. Please specify a Webp, PNG or JPG file as the first argument." | |
| exit 1 | |
| fi |
NewerOlder