Skip to content

Instantly share code, notes, and snippets.

@ESWZY
ESWZY / compress_video.py
Last active August 3, 2024 18:33
An example Python code for compressing video file to target size.
# Simplified version and explanation at: https://stackoverflow.com/a/64439347/12866353
import os
import ffmpeg
def compress_video(video_full_path, size_upper_bound, two_pass=True, filename_suffix='cps_'):
"""
Compress video file to max-supported size.
:param video_full_path: the video you want to compress.
:param size_upper_bound: Max video size in KB.
@n8henrie
n8henrie / crashplan_setup.sh
Last active March 15, 2024 21:36
Set up CrashPlan on Raspberry Pi (Raspbian Jessie)
#!/bin/bash
#############
# n8henrie's Raspberry Pi CrashPlan installer script
# v0.1.0 :: 20160530
#############
set -e
CP_VERSION="4.8.0"
@lanceliao
lanceliao / dnsmasq-gfwlist.py
Last active June 19, 2024 00:35
将gfwlist转换成带ipset的dnsmasq规则,适用于OpenWrt智能上网
#!/usr/bin/env python
#coding=utf-8
#
# Generate a list of dnsmasq rules with ipset for gfwlist
#
# Copyright (C) 2014 http://www.shuyz.com
# Ref https://code.google.com/p/autoproxy-gfwlist/wiki/Rules
import urllib2
import re
@dkgeorge
dkgeorge / sgdbot.py
Last active August 16, 2017 19:51 — forked from prof7bit/_stoploss.py
Stop loss/Start gain dialog interactive bot for goxtool Mt.Gox trading bot framework
"""
a simple stop loss/start gain bot
adjust STOP_PRICE/START_PRICE and STOP_VOLUME/START_VOLUME to your needs.
to reset orders during runtime, press (s) for a new stop order and (g) for a new start gain
The file can be reloaded after editing without restarting goxtool by simply pressing the (l) key.
"""
# Using the global statement
# pylint: disable=W0603
# No exception type(s) specified
# pylint: disable=W0702