Skip to content

Instantly share code, notes, and snippets.

View ryr's full-sized avatar

Roman Ruban ryr

View GitHub Profile
@revolunet
revolunet / ffmpeg-tips.md
Last active April 16, 2025 04:29
ffmpeg tips

libcaca output from your OSX webcam

ffmpeg -f avfoundation -framerate 30 -s "640x480" -i "0" -c:v rawvideo -pix_fmt rgb24 -f caca -s "640x480" output4.mp4

brew install ffmpeg with options

brew install homebrew-ffmpeg/ffmpeg/ffmpeg --with-libcaca

convert to another format, resize withouth quality loss

ffmpeg -i vitrine.mp4 -vf scale=1024:-1 -q:vscale 0 vitrine.avi

@dmitshur
dmitshur / gist:6927554
Last active December 29, 2024 12:06
[Legacy GOPATH mode] How to `go get` private repos using SSH key auth instead of password auth.
@jordan-wright
jordan-wright / check_hosts.py
Last active February 16, 2019 15:38
Fabric Botnet C&C Blog Post
def check_hosts():
''' Checks each host to see if it's running '''
for host, result in execute(run_command, "uptime", hosts=env.hosts).iteritems():
running_hosts[host] = result if result.succeeded else "Host Down"
def run_pg_fouine():
info = host_info[env.host_string]
db_name = info.tags.get('Name')
sudo('perl -pi -e "s/log_min_duration_statement = .*/log_min_duration_statement = 0/" /etc/postgresql/9.*/main/postgresql.conf')
sudo('/etc/init.d/postgresql reload')
time.sleep(30)
sudo('perl -pi -e "s/log_min_duration_statement = .*/log_min_duration_statement = 500/" /etc/postgresql/9.*/main/postgresql.conf')
sudo('/etc/init.d/postgresql reload')
run('tail -n 100000 /var/log/postgresql/postgresql-9.*-main.log > /tmp/pgfouine.txt')
run('gzip -f /tmp/pgfouine.txt')
@maslowivan
maslowivan / gist:1519751
Created December 25, 2011 21:07
city of russia
cityData = ["\u041c\u043e\u0441\u043a\u0432\u0430","\u0410\u0431\u0440\u0430\u043c\u0446\u0435\u0432\u043e","\u0410\u043b\u0430\u0431\u0438\u043d\u043e","\u0410\u043f\u0440\u0435\u043b\u0435\u0432\u043a\u0430","\u0410\u0440\u0445\u0430\u043d\u0433\u0435\u043b\u044c\u0441\u043a\u043e\u0435","\u0410\u0448\u0438\u0442\u043a\u043e\u0432\u043e","\u0411\u0430\u0439\u043a\u043e\u043d\u0443\u0440","\u0411\u0430\u043a\u0448\u0435\u0435\u0432\u043e","\u0411\u0430\u043b\u0430\u0448\u0438\u0445\u0430","\u0411\u0430\u0440\u044b\u0431\u0438\u043d\u043e","\u0411\u0435\u043b\u043e\u043e\u043c\u0443\u0442","\u0411\u0435\u043b\u044b\u0435 \u0421\u0442\u043e\u043b\u0431\u044b","\u0411\u043e\u0440\u043e\u0434\u0438\u043d\u043e","\u0411\u0440\u043e\u043d\u043d\u0438\u0446\u044b","\u0411\u044b\u043a\u043e\u0432\u043e","\u0412\u0430\u043b\u0443\u0435\u0432\u043e","\u0412\u0435\u0440\u0431\u0438\u043b\u043a\u0438","\u0412\u0435\u0440\u0435\u044f","\u0412\u0438\u0434\u043d\u043e\u0435","\u0412\u043d\u0443\u043a\u043e\u0432\u043e","\u
@JeromeParadis
JeromeParadis / redis_delete_keys_pattern.sh
Created September 25, 2011 06:22
Redis: How delete keys matching a pattern?
redis-cli KEYS "prefix:*" | xargs redis-cli DEL
@mikeyk
mikeyk / redis_session_backend.py
Created April 8, 2011 18:01
A redis backend for Django Sessions, tested on Django 1.3+
from django.contrib.sessions.backends.base import SessionBase, CreateError
from django.conf import settings
from django.utils.encoding import force_unicode
import redis
class SessionStore(SessionBase):
""" Redis store for sessions"""
def __init__(self, session_key=None):
self.redis = redis.Redis(