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
import requests | |
import json | |
import os | |
import time | |
import yaml | |
import argparse | |
import re | |
from datetime import datetime | |
OPENROUTER_API_BASE = "https://openrouter.ai/api/v1" |
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
SAMBANOVA_API_KEY= | |
GEMINI_API_KEY= | |
HUGGINGFACE_API_KEY= | |
HYPERBOLIC_API_KEY= | |
OPENAI_API_KEY= | |
GROQ_API_KEY= | |
XAI_API_KEY= | |
OPENROUTER_API_KEY= | |
COHERE_API_KEY= | |
TOGETHERAI_API_KEY= |
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 | |
CLIENT_DB="$HOME/Library/Application Support/CloudDocs/session/db/client.db" | |
[[ -e $CLIENT_DB ]] || { echo "db not found"; exit 1; } | |
mapfile -t ITEM_IDS < <(sqlite3 "$CLIENT_DB" <<-EOS | |
SELECT throttle_id | |
FROM client_sync_up | |
EOS | |
) |
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 | |
echo "Begin environment relocation." | |
NEW_ENV_DIR=$1 | |
BASE_ENV=$(conda info --base) | |
######################################### | |
# | |
# Install jq locally | |
# |
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
#===================================================================== | |
To Apply the Cron Job in Docker: | |
1️⃣ Edit the cron file: | |
echo "10 * * * * root ansible-playbook -i /ansible/inventory-switches.ini /ansible/switch-version.yml >> /var/log/ansible-cron.log 2>&1" > /etc/cron.d/ansible-cron | |
2️⃣ Set permissions and reload cron: | |
chmod 0644 /etc/cron.d/ansible-cron |
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
Enable systemd-networkd debugging | |
mkdir -p /etc/systemd/system/systemd-networkd.service.d/ | |
Create Drop-In /etc/systemd/system/systemd-networkd.service.d/10-debug.conf with following content: | |
[Service] | |
Environment=SYSTEMD_LOG_LEVEL=debug | |
And restart systemd-networkd service: | |
systemctl daemon-reload |
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 | |
function cleanLine() { | |
local line key field | |
line="$1" | |
key="$2" | |
field="$3" | |
echo "$line" | jq -r "$key" | tr -d 'BbIi' | awk "{print toupper(\$$field)}" | numfmt --from=auto | |
} |
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
services: | |
tailscale: | |
image: tailscale/tailscale:latest | |
environment: | |
- TS_HOSTNAME=mitmproxy | |
- TS_STATE_DIR=/var/lib/tailscale | |
- TS_USERSPACE=false | |
volumes: | |
- ./tailscale:/var/lib/tailscale | |
- /dev/net/tun:/dev/net/tun |
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
# Simple FFMPEG scripts I use to convert videos or audios | |
# The ones with h264_nvenc codec only work with NVidia graphic cards. You also need to install the drives to use them | |
# The hevc_nvenc codec is pretty fast but the output file size is terrible. So I won't include that in. (Special thanks to Erfan Mojibi) | |
# The libx265 provides better quality to file size. So we can increase the crf in it (source: https://trac.ffmpeg.org/wiki/Encode/H.265#ConstantRateFactorCRF) | |
# The tag is provided by @alirezahabib | |
# Simple convert from webm to mp4. ACC audio codec at 128kb/s. Change 24 to change the quality (higher is worse) | |
ffmpeg -i in.webm -r 10 -vf "scale=-2:720" -c:v h264_nvenc -cq:v 24 -profile:v high -c:a aac -b:a 128k -strict experimental out.mp4 | |
ffmpeg -i in.webm -r 10 -vf "scale=-2:720" -c:v libx264 -crf 24 -c:a aac -b:a 128k -strict experimental out.mp4 | |
ffmpeg -i in.webm -r 10 -vf "scale=-2:720" -c:v libx265 -crf 28 -c:a aac -b:a 128k -tag:v hvc1 -strict experimental out.mp4 |
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/osascript | |
# Required parameters: | |
# @raycast.schemaVersion 1 | |
# @raycast.title Screenshot resize | |
# @raycast.mode silent | |
# Optional parameters: | |
# @raycast.icon 📸 | |
# @raycast.packageName Utilities |
NewerOlder