# Misc. command line tools

### Base64 encoding

* Without whitespace: `base64 --wrap=0`

### Text encodings

* Convert ASCII to UTF8: `iconv --from-code=ascii --to-code=utf-8`

### Windows / WSL interop

* Copy WSL text into the Windows clipboard: `echo "Hello äöü" | iconv -f utf-8 -t utf-16le | clip.exe`
  * This converts it to UTF16 little endian and pipes it to the Windows clipboard :-)
* Start a web browser on Windows from WSL: `cmd.exe /C "start $( echo "https://github.com/" )"`

### git tips

#### `chmod +x` in git

```bash
git update-index --chmod=+x ./sample.sh
```

### Image renaming

Use [`jhead`](https://www.sentex.ca/~mwandel/jhead/) to extract EXIF metadata, and rename image files.

For example, this renames all images based on the date-taken EXIF metadata

```bash
jhead -n%Y-%m-%d--%H-%M-%S_%f *.jpg
```

* `-n[format-string]`
  * `%Y-%m-%d` Year (4 digit 1980-2036) / month number / day of month
  * `%H-%M-%S` hour (24h) / minute / second
  * `%f` original file name


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://cookbook.geuer-pollmann.de/command-line-utilities/tools.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
