Skip to content

Instantly share code, notes, and snippets.

View cosimo's full-sized avatar
🇳🇴

Cosimo Streppone cosimo

🇳🇴
View GitHub Profile
@thomwolf
thomwolf / fast_speech_text_speech.py
Last active October 18, 2024 21:06
speech to text to speech
""" To use: install LLM studio (or Ollama), clone OpenVoice, run this script in the OpenVoice directory
git clone https://github.com/myshell-ai/OpenVoice
cd OpenVoice
git clone https://huggingface.co/myshell-ai/OpenVoice
cp -r OpenVoice/* .
pip install whisper pynput pyaudio
"""
from openai import OpenAI
import time
@ovrnt
ovrnt / install_gpu_ubuntu_2204.sh
Created January 29, 2024 05:00
Yam Peleg's Ubuntu 22.04 “CUDA + GPU Drivers + CuDNN and everything else” installer (https://twitter.com/Yampeleg/status/1751823896800583924)
#!/bin/bash
# Verify if GPU is CUDA-enabled
lspci | grep -i nvidia
# Remove previous NVIDIA driver installation
sudo apt-get purge nvidia* -y
sudo apt remove nvidia-* -y
sudo rm /etc/apt/sources.list.d/cuda* -y
sudo apt-get autoremove && sudo apt-get autoclean -y
@tylermorganwall
tylermorganwall / submarine_cable_map.R
Last active November 14, 2024 09:57
Submarine Cable Map Dataviz
library(geojsonsf)
library(sf)
library(rayrender)
#Data source: https://github.com/telegeography/www.submarinecablemap.com
cables = geojson_sf("cable-geo.json")
cablescene = list()
counter = 1
for(i in 1:length(cables$geometry)) {
@cosimo
cosimo / disable_cb_access_scanner.sh
Created June 24, 2021 13:24
Disable the Couchbase Bucket Access Scanner to avoid micro outages
#!/bin/bash
#
# Disables the Couchbase access scanner on a list of buckets
# Access scanner can cause short outages when buckets are very large.
#
set -e -x
USER='Administrator'
@andreaso
andreaso / listen-on-totp-range.network
Created May 22, 2021 06:45
Not-entirely-serious SSH TOTP implementation, inspired by https://twitter.com/kistel/status/1395375108315824130.
# /etc/systemd/network/listen-on-totp-range.network
[Match]
Name = lo
[Route]
Destination = 2001:db8:67c1:22::/64
Type = local
@mikoim
mikoim / Sennheiser_MOMENTUM_True_Wireless_2_Linux.md
Last active October 15, 2024 21:27
Sennheiser MOMENTUM True Wireless 2 on Linux with BlueZ 5 and PulseAudio

Sennheiser MOMENTUM True Wireless 2 on Linux with BlueZ 5 and PulseAudio

Unfortunately, it does not work as out of box. After applying following workarounds, finally, it works.

  • Fedora 32 x86_64
  • Linux kernel 5.7.10 vanilla
  • PulseAudio 13.99 + pulseaudio-module-bluetooth-freeworld (for proprietary codecs aptX)
  • BlueZ 5.54

😱🙀😱🙀😱

[Unit]
Description=Proper folding at home service unit
After=network.target
[Service]
Type=simple
User=fahclient
WorkingDirectory=/var/lib/fahclient
ExecStart=/usr/bin/FAHClient /etc/fahclient/config.xml
NoNewPrivileges=yes
@JuneKelly
JuneKelly / BaselineTest.txt
Created December 12, 2017 13:45
Full text of the Baseline Test from Blade Runner 2049
A blood black nothingness began to spin.
Began to spin.
Let's move on to system.
System.
Feel that in your body.
#!/bin/sh
# Enumerate all interrupts used by either the default or a specified
# network interface, and map them to separate CPUs. Each CPU that gets
# assigned interrupts will also have its C-states deeper than C1
# disabled to reduce the probability of rx queue overflow.
#
# TODO: NUMA interrupt scheduling.
#
@cosimo
cosimo / check-powerdns-running.sh
Created May 12, 2015 13:17
Check if powerdns is alive and well
#!/bin/bash
#
# Powerdns sometimes will stall and keep two pipe backend processes
# for no apparent reason, and fill the logs with "Unable to bind to UDP socket"
# events. When that happens, then DNS service becomes unresponsive and
# doesn't answer queries.
#
# This script tries to detect such condition and will exit with a
# high status code (> 90) or zero if everything looks good.
#