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
-- Desc: This script will return all keys that do not have a TTL set. | |
-- Usage: redis-cli --eval nottlkeys.lua | |
local nonttl = {} | |
local cursor = "0" | |
local done = false | |
while not done do | |
repeat | |
local result = redis.call("SCAN", cursor, "MATCH", "*", "COUNT", 1000) |
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
SELECT | |
l.* EXCEPT(total_compressed_bytes, data_compressed_bytes), | |
formatReadableSize(total_compressed_bytes) as total_comp | |
FROM ( | |
SELECT | |
name, | |
type, | |
data_compressed_bytes, | |
sum(data_compressed_bytes) OVER (ORDER BY data_compressed_bytes DESC) AS total_compressed_bytes, |
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/sh | |
# Wakeup Script | |
# This script sets the volume to 100% and plays a song from a Spotify playlist. | |
# It is intended to be run by a cron job. | |
PATH="$PATH:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/homebrew/bin:$HOME/.cargo/bin" | |
#SPT="$HOME/.cargo/bin/spt" | |
TARGET_DEVICE="mac" # The device to play the song on | |
# Function to restart the Spotify daemon |
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 python | |
import os | |
import sys | |
from groq import Groq | |
def main(): | |
client = Groq( | |
api_key=os.environ.get("GROQ_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
#!/bin/bash | |
rm -rf /tmp/tls_tst | |
mkdir /tmp/tls_tst | |
pushd /tmp/tls_tst | |
# Generate a private key for the CA | |
openssl genrsa -out ca.key 2048 | |
# Create a self-signed certificate for the CA |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 | |
# Description: A function to use openai's gpt-4-turbo-preview chat completions | |
# to generate responses to input. It uses redis to cache responses for 1 hour | |
# and has a flag to skip cached results. | |
# Usage: ai [-s|--skip-cache] [input] | |
function ai { | |
## check if we should skip cache | |
skip_cache=false | |
while true; do |
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
3024 Day | |
3024 Night | |
Aardvark Blue | |
Abernathy | |
Adventure | |
AdventureTime | |
Afterglow | |
Alabaster | |
AlienBlood | |
Andromeda |

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 | |
# start redis cluster using tmux | |
function create_redis_cluster { | |
mkdir cluster-test | |
cd cluster-test | |
mkdir 7001 7002 7003 7004 7005 7006 || true | |
# create redis cluster | |
for port in 7001 7002 7003 7004 7005 7006 | |
do | |
echo "port $port" > $port/redis.conf |
NewerOlder