# Random

Some useful things (to me, not necessarily to you) I keep having to redo because they get lost in spacetime. All credit goes to the brave souls at StackOverflow.

# Bash

## Compressing all pdfs in a folder (and subfolder)

In a recent version of the ghostscript (or gs for close friends), a script I have always used stopped working, so here’s what I’ve been doing. This works for Ubuntu (including the Linux subsystem version in Windows 11).

#!/bin/bash
for f in $(find . -name '*.pdf') do echo "Processing$f"
# Grab filename without extension (just whatever comes before the first .)
# might fail for other purposes, but works fine for .pdfs
cd "\$d"
git pull
cd ..
done

## Example tab using HTML and Javascript

From: https://www.w3schools.com/howto/tryit.asp?filename=tryhow_js_tabs_open

In this example, we use JavaScript to "click" on the London button, to open the tab on page load.

### London

London is the capital city of England.

### Paris

Paris is the capital of France.

### Tokyo

Tokyo is the capital of Japan.