Skip to content

Instantly share code, notes, and snippets.

View bibigon812's full-sized avatar

Dmitriy Yakovlev bibigon812

  • Saint Petersburg, Russia
View GitHub Profile
@bibigon812
bibigon812 / id3_fix.py
Created February 7, 2020 07:33
Fix mp3 id3 tags
import os
import mutagen.id3
tryencodings = ['cp1251']
path = './'
def findMP3s(path):
for child in os.listdir(path):
child = os.path.join(path, child)
if child.lower().endswith(".mp3"):
@bibigon812
bibigon812 / redis_drop_keys_without_ttl.sh
Created July 13, 2018 08:34
Drop all keys without a TTL in Redis
#!/bin/sh
redis-cli keys "*" | while read LINE ; do
TTL=`redis-cli ttl "$LINE"`
if [ $TTL -eq -1 ]; then
echo "$LINE" | redis-cli del
fi
done