Skip to content

Instantly share code, notes, and snippets.

import tempfile
import boto3
import sys
class S3TempFile(object):
def __init__(self, bucket, key):
self.bucket = bucket
self.key = key
@JosephCastro
JosephCastro / lenovo-touchpad.sh
Created June 18, 2020 18:21
Lenovo touchpad works like a mac (something like that)
#!/bin/sh
# this script sets some parameters to get a useable configuration
# these changes are not persistent, you may want to include this in your autostart
# 1 finger = left click, 2 finger = right click, 3 finger = middle click
synclient TapButton2=3
synclient TapButton3=2
synclient ClickFinger2=3
synclient ClickFinger3=2
#! /bin/sh
# With icon indicating the state of the mic
state=`amixer set Capture toggle | gawk 'match($0, /Front Left.*\[(.*)\]/, a) {print a[1]}'`
if [ $state = "off" ]; then
icon="audio-input-microphone-muted-symbolic"
else
icon="audio-input-microphone-symbolic"
fi
notify-send --hint=int:transient:1 -i $icon "Mic switched: $state"
1326255
1333793
1323754
1325052
1314897
1330927
1331741
1317571
1327851
1322509
from langchain.memory.chat_message_histories.redis import RedisChatMessageHistory
from langchain_core.prompts import ChatPromptTemplate
from langchain_openai import ChatOpenAI
from langchain_core.runnables.history import RunnableWithMessageHistory
from langchain_core.output_parsers import StrOutputParser
from langchain_core.messages import HumanMessage, SystemMessage
from langchain_core.prompts import PromptTemplate
from langchain.chains import LLMChain
from google.colab import userdata