# 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 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 |
This file contains 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 |
Wiring up a Google Form to GitHub is not that difficult with a little bit of Apps Script automation. All you need is a Google account, a GitHub account, and a web browser...
Personal access tokens provide an easy way to interact with the GitHub API without having to mess with OAuth. If you don't already have a personal access token with repo or public_repo access, visit your GitHub settings page and generate a new token.
Be sure to copy your token some place safe and keep it secure. Once generated, you will not be able to view or copy the token again.
- Create a Google Form.
This file contains 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 | |
# get upcoming programs for a BBC TV channel | |
# https://gist.github.com/alifeee/acf55f9141f534e90eabbb7fceffaf44 | |
# i.e., from the links | |
# https://www.bbc.co.uk/iplayer/guide/bbcone | |
# https://www.bbc.co.uk/iplayer/guide/bbctwo | |
# https://www.bbc.co.uk/iplayer/guide/bbcthree | |
# https://www.bbc.co.uk/iplayer/guide/bbcfour | |
# requires: | |
# pcregrep, jq |
This file contains 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
# https://gist.github.com/alifeee/bb0499e1272f312b82497031d28e91f2 | |
# place in /usr/share/applications/clone.desktop | |
[Desktop Entry] | |
Version=0.1.0 | |
Name=Git Clone | |
Comment=Clone a GitHub repository | |
Exec=/home/alifeee/Desktop/clone.sh | |
Terminal=true | |
Type=Application | |
Categories=Utility;Application; |
This file contains 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 an image from something to something else | |
original_image="${1}" | |
echo "given file: ${original_image}" | |
if [ ! -f "${original_image}" ]; then | |
read -p "file does not exist, press ENTER to quit" ENTER | |
exit 1 |
We can make this file beautiful and searchable if this error is corrected: It looks like row 5 should actually have 9 columns, instead of 3 in line 4.
This file contains 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
List Entry Name,List Entry Number,Link,Heritage Category,Grade,Location,OS Grid Reference,latitude,longitude | |
SEWER GAS LAMP,1246769,https://historicengland.org.uk/listing/the-list/list-entry/1246769,Listing,II,SEWER GAS LAMP BISHOPCOURT ROAD Non Civil Parish SHEFFIELD| Sheffield,SK3547184041,53.35207495059936,-1.4685722449868464 | |
SEWER GAS LAMP AT JUNCTION WITH WESTHILL LANE,1271101,https://historicengland.org.uk/listing/the-list/list-entry/1271101,Listing,II,SEWER GAS LAMP AT JUNCTION WITH WESTHILL LANE BROOMHALL STREET Non Civil Parish SHEFFIELD| Sheffield,SK3479987154,53.38009982572962,-1.4783263352645517 | |
SEWER GAS LAMP AT JUNCTION WITH NICHOLSON ROAD,1246499,https://historicengland.org.uk/listing/the-list/list-entry/1246499,Listing,II,SEWER GAS LAMP AT JUNCTION WITH NICHOLSON ROAD KENT ROAD Non Civil Parish SHEFFIELD| Sheffield,SK3560284732,53.35827704651085,-1.4665266837756366 | |
SEWER GAS LAMP AT JUNCTION WITH MONCKTON ROAD,1247376,https://historicengland.org.uk/listing/the-list/list-entry/12473 |
This file contains 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
// ==UserScript== | |
// @name jump between DuckDuckGo Lite results | |
// @namespace http://tampermonkey.net/ | |
// @version 2024-11-11 | |
// @description when on https://lite.duckduckgo.com/lite, jump quickly between search results by pressing CTRL+1, CTRL+2, etc. | |
// @author alifeee | |
// @homepage https://gist.github.com/alifeee/7936b864bbc6fefb6d74162a1a81123d | |
// @match https://lite.duckduckgo.com/lite* | |
// @icon https://alifeee.co.uk/robot.png | |
// @grant none |
This file contains 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 | |
# https://gist.github.com/alifeee/da157fcb92605d4fcdf3932aabcf56fe | |
# a CGI script to get a random RSS feed from an OPML file | |
# must have installed xmlstarlet | |
# $ sudo apt install xmlstarlet | |
echo "Content-type: text/html" | |
echo "" | |
cat <<HTML |