Skip to content

Instantly share code, notes, and snippets.

@adejones
adejones / filerotator.py
Last active October 21, 2022 17:00 — forked from RWJMurphy/filerotator.py
Python class and utility for file rotation. Configurable daily, weekly and monthly retention; can use hard links to save space; supports `argparse` config files.
#!/usr/bin/env python3
# vim: ft=python ts=4 sw=4 expandtab
#
# Copyright (c) 2013 Reed Kraft-Murphy <reed@reedmurphy.net>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
@noromanba
noromanba / showroom-live.com-hls-specs.mkd
Last active April 23, 2017 16:11
specs of showroom-live.com HLS m3u8 URL

showroom-live.com HLS specs

specs of showroom-live.com HLS m3u8 URL

URL syntax

showroom-live URL

https://www.showroom-live.com/<ROOM_URL_KEY>
@ViktorNova
ViktorNova / rotate-video.sh
Created August 8, 2016 21:33
Rotate a video with FFmpeg (100% lossless, and quick)
$INPUTVIDEO='input.mp4'
$OUTPUTVIDEO='output.mp4'
ffmpeg -i $INPUTVIDEO -metadata:s:v rotate="-90" -codec copy $OUTPUTVIDEO
@foobarna
foobarna / down.py
Last active June 2, 2018 01:10
aiohttp stream download
from contextlib import closing
import asyncio
import aiohttp
f = open('path/to/file', 'wb')
url = 'http://speedtest.wdc01.softlayer.com/downloads/test100.zip'
chunk_size = 5 * 2**20 # MB
@fcicq
fcicq / showroomlive.sh
Last active July 1, 2021 18:16
Recorder for showroom-live.com
#!/bin/bash
# coding: utf-8
# showroomlive.sh by fcicq
(jq --version 1>/dev/null 2>&1) || (echo 'install jq first'; exit)
(livestreamer --version 1>/dev/null 2>&1) || (echo 'install livestreamer first (run pip/pip3 install livestreamer)'; exit)
if [ -n "$1" ]; then
id=$(echo "$1" | sed 's|^.*/||g')
while true; do
while true; do
@aldur
aldur / nfs_automount.sh
Last active December 3, 2023 10:08
Mount an NFS share on Android
#!/bin/sh
# Mount an NFS share on Android
# Requirements:
# - Busybox
# - A kernel supporting nfs (either built-in or as a module)
# On my Nexus 7 2012 I use the following kernel:
# http://forum.xda-developers.com/showthread.php?t=2107224
# Remember: if you have problems of system space, simply delete some of the default stuff.
@aroder
aroder / install_ffmpeg_with_librtmp.sh
Last active July 29, 2021 15:58
shell script to install FFmpeg with librtmp, which is necessary to use it with DaCast. Much of this comes from http://help.dacast.com/hc/en-us/articles/202357380-Stream-on-DaCast-under-Linux-with-ffmpeg
#!/bin/bash
# this scripts assumes Ubuntu 14.04 LTS
# ensure the following sources are in /etc/apt/sources.list
# deb http://us.archive.ubuntu.com/ubuntu/ precise multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ precise multiverse
# deb http://us.archive.ubuntu.com/ubuntu/ precise-updates multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ precise-updates multiverse
@hanksudo
hanksudo / OneLinerFindProcessToKill.sh
Created March 27, 2014 16:32
Find and kill a process in one line using bash and regex
kill $(ps aux | grep 'process name with regex' | awk '{print $2}')
@sampsyo
sampsyo / aliases.py
Created July 11, 2010 20:04
hack for argparse adding subcommand aliases
#!/usr/bin/env python
"""Aliases for argparse positional arguments."""
import argparse
class AliasedSubParsersAction(argparse._SubParsersAction):
class _AliasedPseudoAction(argparse.Action):
def __init__(self, name, aliases, help):