Skip to content

Instantly share code, notes, and snippets.

@rasbt
rasbt / video-subtitles-via-whisper.py
Last active March 20, 2025 13:55
Script that creates subtitles (closed captions) for all MP4 video files in your current directory
# Sebastian Raschka 09/24/2022
# Create a new conda environment and packages
# conda create -n whisper python=3.9
# conda activate whisper
# conda install mlxtend -c conda-forge
# Install ffmpeg
# macOS & homebrew
# brew install ffmpeg
# Ubuntu

Build your own private, encrypted, open-source Dropbox-esque sync folder

Prerequisites:

  • One or more clients running a UNIX-like OS. Examples are given for Ubuntu 12.04 LTS, although all software components are available for other platforms as well (e.g. OS X). YMMV
  • A cheap Ubuntu 12.04 VPS with storage. I recommend Backupsy, they offer 250GB storage for $5/month. Ask Google for coupon codes.

Software components used:

  • Unison for file synchronization
  • EncFS for folder encryption
@qoda
qoda / social_users.py
Created August 26, 2011 13:07
social_users.py
#! /usr/bin/env python
import pickle
import re
from db import Database
# instanciate the database class
db = Database(
db_host = '*******',
D, [2011-08-13T22:11:06.310036 #99479] DEBUG -- net.ssh.service.forward[810e839c]: received connection on #<UNIXServer:0x0000010201baf0>
D, [2011-08-13T22:11:06.310289 #99479] DEBUG -- tcpsocket[808a3b28]: queueing packet nr 7 type 90 len 60
D, [2011-08-13T22:11:06.310603 #99479] DEBUG -- tcpsocket[808a3b28]: sent 84 bytes
D, [2011-08-13T22:11:06.337773 #99479] DEBUG -- tcpsocket[808a3b28]: read 52 bytes
D, [2011-08-13T22:11:06.337942 #99479] DEBUG -- tcpsocket[808a3b28]: received packet nr 7 type 91 len 28
I, [2011-08-13T22:11:06.338075 #99479] INFO -- net.ssh.connection.session[810e8518]: channel_open_confirmation: 0 0 2097152 32768
I, [2011-08-13T22:11:06.338156 #99479] INFO -- net.ssh.connection.channel[810df620]: direct channel established
D, [2011-08-13T22:11:09.485092 #99479] DEBUG -- unixsocket[810e23e8]: read 13 bytes
D, [2011-08-13T22:11:09.485237 #99479] DEBUG -- net.ssh.connection.channel[810df620]: read 13 bytes from client, sending over local forwarded connection
D, [2011-08-13T22:11:09.485418
@robbywalker
robbywalker / v1_level3.py
Created October 21, 2010 23:05
David Koblas's one-liner for GPCv1 Level 3
from itertools import combinations, chain
nums = tuple([int(v) for v in "3 4 9 14 15 19 28 37 47 50 54 56 59 61 70 73 78 81 92 95 97 99".split(' ') if v.strip()])
print sum([1 for v in chain(*[combinations(nums, r) for r in range(3, len(nums))]) if sum(v[0:-1]) == v[-1]])