Skip to content

Instantly share code, notes, and snippets.

View dvir1994's full-sized avatar
👋

Dvir Chikvashvili dvir1994

👋
View GitHub Profile
import requests
# Constants
ELEVEN_LABS_API_KEY = "XYZ"
ELEVEN_LABS_VOICE_ID = "EXAVITQu4vr4xnSDxMaL" # Voice ID can be found here - https://elevenlabs.io/docs/api-reference/get-voices
ELEVEN_LABS_TTS_API_ENDPOINT = (
f"https://api.elevenlabs.io/v1/text-to-speech/{ELEVEN_LABS_VOICE_ID}"
)
OUTPUT_FILE_PATH = "/tmp/output.mp3"
@dvir1994
dvir1994 / poe_responder.py
Created October 10, 2023 19:19
Expense tracker - TG bot + LLM
import os
import pydub # pip3 install pydub + brew/apt install ffmpeg
import speech_recognition as sr
from telegram import Update, Voice # pip3 install python-telegram-bot
from telegram.ext import Application, ContextTypes, MessageHandler, filters
import datetime
import json
import pyairtable # pip3 install pyairtable
from poe_api_wrapper import PoeApi # pip3 install -U poe-api-wrapper
[general]
state_file = /var/awslogs/state/agent-state
[logstream1]
file = /var/log/secure
log_group_name = SSHfail
log_stream_name = {instance_id}
datetime_format = %b %d %H:%M:%S
We can't make this file beautiful and searchable because it's too large.
"city","city_ascii","lat","lng","country","iso2","iso3","admin_name","capital","population","id"
"Tokyo","Tokyo","35.6897","139.6922","Japan","JP","JPN","Tōkyō","primary","37977000","1392685764"
"Jakarta","Jakarta","-6.2146","106.8451","Indonesia","ID","IDN","Jakarta","primary","34540000","1360771077"
"Delhi","Delhi","28.6600","77.2300","India","IN","IND","Delhi","admin","29617000","1356872604"
"Mumbai","Mumbai","18.9667","72.8333","India","IN","IND","Mahārāshtra","admin","23355000","1356226629"
"Manila","Manila","14.5958","120.9772","Philippines","PH","PHL","Manila","primary","23088000","1608618140"
"Shanghai","Shanghai","31.1667","121.4667","China","CN","CHN","Shanghai","admin","22120000","1156073548"
"São Paulo","Sao Paulo","-23.5504","-46.6339","Brazil","BR","BRA","São Paulo","admin","22046000","1076532519"
"Seoul","Seoul","37.5833","127.0000","Korea, South","KR","KOR","Seoul","primary","21794000","1410836482"
"Mexico City","Mexico City","19.4333","-99.1333","Mexico","MX","MEX","Ciudad de México","primary
sudo apt-get install default-jre -y
## install docker via install docker on ubuntu sh file
sudo apt-get install ruby-full
## docker run -d -p 5000:5000 --restart=always --name registry registry:2
@dvir1994
dvir1994 / ubuntu-desktop-vnc.sh
Created January 16, 2018 11:11
ubuntu install desktop and configure vnc
sudo apt-get update
sudo apt-get install ubuntu-desktop
sudo apt-get install vnc4server
sudo apt-get install gnome-panel
vncserver
#enter password to terminal
vncserver-kill :1
@dvir1994
dvir1994 / install-jenk-master.sh
Created January 15, 2018 15:51
install jenkins master
#!/bin/bash
sudo add-apt-repository ppa:openjdk-r/ppa
sudo apt-get update -y
sudo apt-get install openjdk-7-jdk -y
sudo apt-get install openjre-7-jre -y
wget -q -O - https://pkg.jenkins.io/debian/jenkins-ci.org.key | sudo apt-key add -
sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
sudo apt-get update -y
sudo apt-get install jenkins -y
@dvir1994
dvir1994 / install-docker-ubuntu.sh
Last active January 22, 2018 14:28
install docker ubuntu
#!/bin/bash
sudo apt-get update
sudo apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
@dvir1994
dvir1994 / install-docker.sh
Created January 12, 2018 18:58
install docker on centos 7
#!/bin/bash
sudo yum install -y yum-utils
sudo yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
sudo yum makecache fast
sudo yum -y install docker-ce
sudo systemctl start docker
sudo docker run hello-world