Talles L

Talles L @tallesl

About: nothing to see here, move along

Location:
Brazil
Joined:
Jul 12, 2020

Talles L
articles - 70 total

Transcribing mp3 files locally with OpenAI's whisper model

#!/usr/bin/env python3 from whisper import load_model # pip install openai-whisper model =...

Learn More 0 0May 17

Creating a solution from the CLI

For folks that are on Windows and Visual Studio (not Code), solution files (.sln) are still pretty...

Learn More 0 0Mar 8

Gemini manual function calling

from logging import basicConfig, ERROR from google.genai import Client from google.genai.types...

Learn More 0 0Feb 19

OpenAI tool calling example

from json import loads from signal import signal, SIGINT from requests import get # pip install...

Learn More 0 0Feb 11

An Alternating Asynchronous Generator in Python

from asyncio import run, sleep class AlternatingGenerator: def __init__(self, gen1, gen2): ...

Learn More 0 0Jan 2

Parsing command-line arguments in C

Parsing on my own: #include <stdbool.h> #include <stdio.h> #include...

Learn More 0 0Dec 29 '24

Quick debugging with gdb

Here's my routine to debug quick stuff on the cli: $ gcc myprogram.c -g -o myprogram $ gdb -tui...

Learn More 0 0Dec 29 '24

Reading UTF-8 char by char in C

Using wchar_t didn't quite worked out in my tests, so handling it on my own: #include...

Learn More 0 0Dec 28 '24

RabbitMQ Refresher

Exchanges & Queues Messages are published to exchanges. Publishers only need to...

Learn More 3 0Dec 24 '24

Handling Python event loop shutdown without exceptions

#!/usr/bin/env python3 from asyncio import gather, new_event_loop, sleep, Event,...

Learn More 0 0Dec 21 '24

Previewing a .npy file

Here's a little script I made to preview some of my (huge) NumPy's .npy files: #! /usr/bin/env...

Learn More 0 0Dec 17 '24

Monitoring Queries on PostgreSQL

I'm used to Redis, and there is a wonderful command called MONITOR that shows the commands being...

Learn More 1 0Dec 1 '24

Suppressing "KeyboardInterrupt" Message on Python Script

from signal import signal, SIGINT signal(SIGINT, lambda _, __: exit()) print('No message or stack...

Learn More 0 0Dec 1 '24

Sampling N Lines From a CSV File

$ sudo apt install csvkit $ csvsql --query "SELECT * FROM myfile ORDER BY RANDOM() LIMIT 3"...

Learn More 0 0Nov 30 '24

Postgres Cheat Sheet

No printable PDF at the moment, sorry :( psql $ psql -U username -d dbname -h hostname...

Learn More 3 0Nov 30 '24

Getting a SQL Table Definition From a CSV File

Make sure you have sqlite3 available: $ sudo apt install sqlite3 Enter fullscreen mode ...

Learn More 0 0Nov 30 '24

Installing Postgres on a Development Machine

Sure, it's quicker and easier to run as a container, I know. But some people sometimes just want to...

Learn More 2 1Nov 30 '24

Large file transfer from VPS to local machine

Transferring files? More often than not, rsync is the answer: rsync --archive --verbose --partial...

Learn More 0 0Nov 20 '24

Using PowerShell for day to day stuff

Thankfully, it's been awhile since I last had to use Windows on my day to day. If I ever have to...

Learn More 1 0Oct 15 '24

Getting to BIOS

My Asus motherboard uses F2 for setup key and F8 for boot selection device key. My MSI one uses DEL...

Learn More 0 0Oct 15 '24

Shut up TensorFlow

I was getting a lot of noise right at the start of my silly Keras+TensorFlow tests: 2024-09-15...

Learn More 6 0Sep 15 '24

Prompting ChatGPT with LangChain

First, set up an virtual environment with needed packages: $ python3 -m venv venv $ venv/bin/pip...

Learn More 0 0Sep 10 '24

Leaving a long script running in the background from a SSH session

nohup ./my-script.sh >> my-output.txt 2>&1 & Enter fullscreen mode ...

Learn More 5 0Sep 9 '24

Profiling a CUDA application with nvprof

Let's create a sample CUDA code first: #include <stdio.h> #include...

Learn More 0 0Sep 5 '24

Qt error when opening ncu-ui

If you got this when callling ncu-ui: Cannot mix incompatible Qt library (5.15.3) with this...

Learn More 0 0Sep 5 '24

Setting and getting clipboard content from terminal

Setting clipboard: $ echo foo | xclip -selection c Enter fullscreen mode Exit...

Learn More 0 0Sep 3 '24

Cleaning up syslog

$ du -h /var/log/syslog 110G /var/log/syslog $ sudo truncate -s 0 /var/log/syslog $ du -h...

Learn More 0 0Sep 2 '24

Plotting Keras training history with Matplotlib

import matplotlib.pyplot as plt def plot_training(history): plt.figure(figsize=(8, 5)) # 8x5...

Learn More 0 0Aug 20 '24

Visualizing a Keras model

This: my_model.summary() Enter fullscreen mode Exit fullscreen mode ...

Learn More 0 0Aug 20 '24

Preventing Keras to allocate unnecessary GPU memory

gpus = tf.config.experimental.list_physical_devices('GPU') for gpu in gpus: ...

Learn More 0 0Aug 19 '24