Skip to content

Instantly share code, notes, and snippets.

Avatar

Alexey Stepanov Pmmlabs

View GitHub Profile
View lastfm_pls.sh
LIST=$(curl https://www.last.fm/player/station/user/$USER/recommended?ajax=1 | jq -r '.playlist|.[]|._playlinks|.[0]|.url')
FILENAME="lastfm.pls"
echo "" > $FILENAME
i=1
for url in $LIST
do
echo "File$i=$url" >> $FILENAME
i=$((i+1))
done
@Pmmlabs
Pmmlabs / convert.sh
Last active Feb 2, 2020
Deletes known watermark
View convert.sh
#!/bin/bash
MASK="mask.png"
NEGATE_FIXED="negate_fixed.png"
NEGATE="negate.png"
#convert -density 300 -trim test.pdf -quality 100 -flatten -sharpen 0x1.0 test.jpg
convert $MASK -negate $MASK
for i in *.png
do
convert $i -negate $NEGATE
View kozyr.sh
#!/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
View ffmpeg_equalizer.sh
ffmpeg -i input.ts -af "anequalizer=c0 f=120 w=20 g=-20|c0 f=270 w=20 g=-20|c1 f=120 w=20 g=-20|c1 f=270 w=20 g=-20" -c:v copy -c:a aac output.ts
View concatenate_copy.sh
preset="-c:v h264 -crf 18 -preset veryslow"
width=640
height=1136
audiorate=44100
output="output.ts"
rm -rf processed $output
mkdir processed
pad_vertical() {
View twitch_comments.sh
#!/usr/bin/env bash
JQ="jq"
TEMP="temp.json"
COMMENTS="comments.txt"
CURSOR=""
PARAM=""
echo "" > ${TEMP}
echo "" > ${COMMENTS}
View vk_oid.js
function addGroupToReplyList(id) {
var obj = [id,"","/","my_group"];
if (!window.replyAsList)
replyAsList = [];
replyAsList.push(obj);
if (!window.replyAsData)
replyAsData = {};
replyAsData[id]=obj;
}
addGroupToReplyList(-123456);
@Pmmlabs
Pmmlabs / twitch.sh
Last active Mar 23, 2020
Twitch auto-record bash script
View twitch.sh
# 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.
View gist:4068627e01f33bf31f5845b8d38a4a09
curl -H "Accept: application/json" https://rcs.school2100.com/api/bookapplication/v3.0/books
View gist:727b9df4d67f981e02fc38d5aeadea51
var a = [].slice.call($0.children).sort(function(a,b){return a.innerHTML>b.innerHTML});
for (i in a) $0.appendChild(a[i]);
You can’t perform that action at this time.