Skip to content

Instantly share code, notes, and snippets.

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 February 2, 2020 15:31
Deletes known watermark
#!/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
#!/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
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
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() {
#!/usr/bin/env bash
JQ="jq"
TEMP="temp.json"
COMMENTS="comments.txt"
CURSOR=""
PARAM=""
echo "" > ${TEMP}
echo "" > ${COMMENTS}
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 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.
curl -H "Accept: application/json" https://rcs.school2100.com/api/bookapplication/v3.0/books
var a = [].slice.call($0.children).sort(function(a,b){return a.innerHTML>b.innerHTML});
for (i in a) $0.appendChild(a[i]);