# see all information
ffmpeg -i input.mp4
# format resolution nicely
ffprobe -v error -select_streams v:0 -show_entries stream=width,height -of csv=s=x:p=0 input.mp4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# make bar chart from $prog, $total, $n_seg as $1 $2 $3 | |
# example: | |
# > ./bar.sh 25 100 12 | |
# ███░░░░░░░░░ | |
bar () { | |
# $1 $2 $3 are progress total total_segments | |
# shows progress/total using total_segments characters | |
if [ $1 == "0" ] && [ $2 == "0" ]; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# script to remove stylesheets, style tags, and inline styles from an HTML file | |
# 1. remove <link rel="stylesheet" ...> | |
# 2. remove <style> ... </style> | |
# 3. remove style="..." attributes | |
# notes: | |
# perl "0777" is so that perl sees newlines as "any character" (so <link> can wrap onto new lines) | |
# "|gms" helps with the same thing. see https://regex101.com/ | |
# example: | |
# ./naked.sh index.html > index-naked.html |
- Line graphs 📈📉
- Bar graphs 📊
Plot graphs using the terminal. E.g.,
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# converts a font (.woff) filename to a CSS @font-face and class-selector based on filename | |
# example: | |
# ./filename_to_css.sh "path/to/my-font.woff" | |
# with multiple files | |
# find path/to/fonts -name "*.woff" -exec ./filename_to_css.sh {} \; | |
# get name from regex match | |
name_regex='\/([^\/]*)\.woff$' | |
if [[ $1 =~ $name_regex ]]; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# convert a Gimp colour palette (.gpl) to a list of CSS variables | |
# example: | |
# ./gpl-to-css.sh my-palette.gpl > my-palette.css | |
# converts | |
# ----- my-palette.gpl ----- | |
# GIMP Palette | |
# Name: My Palette | |
# Columns: 3 | |
# 255 0 0 Red |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# combines SquareSpace RSS feeds | |
# Squarespace default feed (e.g., https://www.treehousesheffield.com/events?format=rss) only returns the current month | |
# This script fetches the current month and the next two months and combines them into a single RSS feed | |
# The script is intended to be run as a cron job | |
# It should work for any SquareSpace site (assuming they use the same query variable format) | |
# usage e.g., | |
# ./combinerss.sh https://www.treehousesheffield.com/events?format=rss > /var/www/html/treehousesheffield.com/events.rss | |
# get today month and year |
I run things on my server. I'd like to run them in the background, so they restart when the server restarts.
I was running them "in the background" with tmux, which I had to set up again every time the server restarted. This was annoying. So, here I run them as a service.
I had a vague knowledge of services, because some things I use are one, like nginx and murmur for mumble.
I like blogs. I like RSS feeds. Often, blogs don't have an RSS feed link. Often, these blogs do have an RSS feed, thanks to whatever site generator they use.
Thus, I like to try and find the hidden feed. These are the URLs I usually put on the URL to try and find the feed.
For example, blog.alifeee.co.uk
-> blog.alifeee.co.uk/feed.xml
/feed