Skip to content

Instantly share code, notes, and snippets.

@Pmmlabs
Pmmlabs / log.sh
Created February 8, 2016 14:52
log.sh
rm log_start
rm log_end
rm log_i
rm log
for i in *.01.2016_start; do cat $i >> log_start; echo $i >> log_i; done
for i in *.01.2016_end; do cat $i >> log_end; done
paste log_start log_end | awk '{
b = "date -u --date=\"" $2 "\" +%s"
b | getline d;
a = "date -u --date=\"" $1 "\" +%s"
diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c
index ab71d41..53a9e0c 100644
--- a/libavformat/flvenc.c
+++ b/libavformat/flvenc.c
@@ -209,6 +209,7 @@ static void write_metadata(AVFormatContext *s, unsigned int ts)
int metadata_count = 0;
int64_t metadata_size_pos, data_size, metadata_count_pos;
AVDictionaryEntry *tag = NULL;
+ char *sprop = NULL;
--8fe1bdfb-4781-436c-a58f-2711180d19bf
Content-Disposition: form-data; name="cookie"
Content-Type: text/plain; charset=UTF-8
Content-Length: 176
Content-Transfer-Encoding: binary
WKbqKXsiVXNlcklkIjoiMW9OUWx4V3lvQVF3UiIsIlNlc3Npb24iOiJBakd1TkdFRWZWdl9wUjdaa2xmQjRDMkg2bE9qZHh0dno2TC00ODA0NUVFPSIsIlZlcnNpb24iOjF9umVXPtz6_dCHl1kKB5_UQsJOqQD0QyuFXVS4TS0HulA=
--8fe1bdfb-4781-436c-a58f-2711180d19bf
Content-Disposition: form-data; name="broadcast_id"
Content-Type: text/plain; charset=UTF-8
// ==UserScript==
// @id chromecast@vkopt
// @name Chromecast для VkOpt
// @version 1.0
// @namespace https://greasyfork.org/users/23
// @author Pmmlabs@github
// @description Плагин Chromecast для VkOpt
// @include *vk.com*
// @run-at document-end
// @noframes
#!/bin/bash
if [ $# -lt 1 ]
then
echo "Usage: $0 movie.mp4"
exit
fi
ffmpeg -loglevel quiet -i $1 -vcodec copy -vbsf h264_mp4toannexb -an -t 1 out.h264
echo $(h264_analyze out.h264 2>&1 | grep -B 6 SPS | head -n1 | cut -c 4- | xxd -r -p | base64)","$(h264_analyze out.h264 2>&1 | grep -B 5 PPS | head -n1 | cut -c 4- | xxd -r -p | base64)
rm -f out.h264
// ==UserScript==
// @id imdump@vkopt
// @name Скачивание всех диалогов в TXT
// @version 1.2
// @namespace https://greasyfork.org/users/23
// @author Pmmlabs@github
// @description Плагин для VkOpt, позволяющий получить zip-архив со всеми диалогами ВКонтакте
// @include *vk.com*
// @run-at document-end
// @downloadURL https://gist.github.com/Pmmlabs/0caeee114c77b7037922/raw/c4a79c6819ef1980eb43626693201afcfbe4105c/imdump.user.js
C:\Downloads>ffmpeg -i "http://periscope-prod-eu-central-1.global.ssl.fastly.net/vidmanlive/GAeZOqwnNwrYMBbl.O2hnZIwy5Uq
DkzqPQ0Vpx149Xs2ObObx11IIZbYzWZdSgUSCOrujUVWiTgiRPxgxeYvYgb7lhsy5T2vjqUH3rg==/playlist.m3u8?t=eyJhbGciOiJIUzI1NiIsInR5cC
I6IkpXVCIsInZlcnNpb24iOiIyIn0.eyJBbGxvd2VkUHJvdG9jb2xzIjpbImhscyJdLCJCcm9hZGNhc3RJZCI6IjFCZEdZRHp2TVhsS1giLCJHcmFudFR5cG
UiOiJyZWFkIiwiR3JhbnRlZEF0IjowLCJHcmFudGVkVG8iOiJQVUJMSUMiLCJleHAiOjg2NDAwfQ.SZdt1IVsVtnrhuIhv1sGl6QUPcVTZal38yXDXw03moI
" -c copy -bsf:a aac_adtstoasc result.mp4
ffmpeg version N-79173-gbe746ae Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 5.3.0 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfi
g --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --
enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmfx --enable-libmp3l
var a = [].slice.call($0.children).sort(function(a,b){return a.innerHTML>b.innerHTML});
for (i in a) $0.appendChild(a[i]);
curl -H "Accept: application/json" https://rcs.school2100.com/api/bookapplication/v3.0/books
@Pmmlabs
Pmmlabs / twitch.sh
Last active March 23, 2020 16:58
Twitch auto-record bash script
# Dependencies:
# jq https://stedolan.github.io/jq/
# ffmpeg https://ffmpeg.org/
# Usage:
# add to crontab schedule with command: twitch.sh [username] [oauth token]
USER="$1"
OAUTH="$2"
FFMPEG="ffmpeg" # change this if you have ffmpeg installed in other place
JQ="./jq" # change this if you have jq downloaded in other directory. By default, jq called from current directory.