Skip to content

Instantly share code, notes, and snippets.

View skinkie's full-sized avatar

Stefan de Konink skinkie

View GitHub Profile
@rasbt
rasbt / whisper-audio-to-text.py
Created January 26, 2023 17:46
Transcribes audio files using OpenAI Whisper
# Setup:
# conda create -n whisper python=3.9
# conda activate whisper
# https://github.com/openai/whisper
# pip install git+https://github.com/openai/whisper.git
# Usage:
# python whisper-audio-to-text.py --audio_dir my_files --out_dir texts
import argparse
@saurabhnanda
saurabhnanda / tuning-postgres-zfs.md
Last active August 2, 2023 06:06
Tuning Postgres + ZFS

Tuning ZFS + Postgres to outperform EXT4 + Postgres

Please refer to ZFS 2-3x slower than EXT4 to see how ZFS defaults + Postgres defaults severely underperform EXT4 defaults + Postgres defaults (and also to know more about the system on which these benchmarks were performed). This page documents how to tune ZFS + Postgres to give better performance for the tpcb-like benchmark.

BIG FAT WARNING

Please do not copy these settings blindly because I am myself not clear on why/how these settings had the impact they did. For example, I cannot explain why full_page_writes=off independently did not give that much boost, nor did an optimized PG configuration. However, putting both of them together gave a 2-4x boost compared to baseline numbers.

Benchmark results

@benchonaut
benchonaut / README.md
Last active February 1, 2021 10:58
LineageOS WIKO Lenny3

Hey, this is just a bunch of hints for enabling lineageOS on WIKO Lenny3

ro.product.brand=WIKO ro.product.name=V3702AN ro.product.device=V3702AN

Factory Mode (PWR+VOLDOWN) dies with TWRP SP-Tool won't work until you enter dev mode and enable "Unlock Bootloader"

>SuperSU taken was UPDATE-SuperSU-v2.76-20160630161323.zip (beta sounded ugly)

@c060604
c060604 / exif.py
Created May 23, 2017 03:00
User python and piexif to write some gps info into jpg pictures.
import os
import piexif
from fractions import Fraction
def to_deg(value, loc):
"""convert decimal coordinates into degrees, munutes and seconds tuple
Keyword arguments: value is float gps-value, loc is direction list ["S", "N"] or ["W", "E"]
return: tuple like (25, 13, 48.343 ,'N')
"""
@zhanglongqi
zhanglongqi / pyqt_model_view.py
Last active September 22, 2023 00:19
Example of how to use `QDataWidgetMapper` and `QAbstractTableModel` to customize your own widget and your own model.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from PyQt5.QtWidgets import (QWidget, QDataWidgetMapper,
QLineEdit, QApplication, QGridLayout, QListView)
from PyQt5.QtCore import Qt, QAbstractTableModel, QModelIndex
class Window(QWidget):
def __init__(self, parent=None):
@danielfaust
danielfaust / samsung_remote.py
Created May 30, 2011 04:12
Samsung TV Remote Control Python Script
import time
import socket
import base64
src = '192.168.1.2' # ip of remote
mac = '00-AB-11-11-11-11' # mac of remote
remote = 'python remote' # remote name
dst = '192.168.1.3' # ip of tv
app = 'python' # iphone..iapp.samsung