This is a living document. Everything in this document is made in good faith of being accurate, but like I just said; we don't yet know everything about what's going on.
Update: I've disabled comments as of 2025-01-26 to avoid everyone having notifications for something a year on if someone wants to suggest a correction. Folks are free to email to suggest corrections still, of course.
This is a cheat sheet for how to perform various actions to ZSH, which can be tricky to find on the web as the syntax is not intuitive and it is generally not very well-documented.
| Description | Syntax |
|---|---|
| Get the length of a string | ${#VARNAME} |
| Get a single character | ${VARNAME[index]} |
WSL 2 uses a Hyper-V Virtual Network adapter. Network connectivity works without any issue when a VPN is not in use. However when a Cisco AnyConnect VPN session is established Firewall Rules and Routes are added which breaks connectivity within the WSL 2 VM. This issue is tracked WSL/issues/4277
Below outline steps to automatically configure the Interface metric on VPN connect and update DNS settings (/etc/resolv.conf) on connect/disconnect.
| # .github/workflows/app.yaml | |
| name: My Python Project | |
| on: push | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| services: |
| import gzip, functools | |
| from io import BytesIO as IO | |
| from flask import after_this_request, request | |
| def gzipped(f): | |
| @functools.wraps(f) | |
| def view_func(*args, **kwargs): | |
| @after_this_request | |
| def zipper(response): | |
| accept_encoding = request.headers.get('Accept-Encoding', '') |
- Login to https://console.cloud.google.com/
- Create a project (take note of project's ID)
- Enable billing
- Go to https://console.cloud.google.com/compute/instances
- Create a VM instance
- Name: use a semantic name (take note of instance's name)
- Region and zone: most local
- Machine type: smallest possible f1-micro
| _jpageviewer_jar=~/opt/jpageviewer/JPageViewer.jar | |
| if [ -e "$_jpageviewer_jar" ]; then | |
| jpageviewer() { | |
| # --resolve-dir defaults to the file's directory | |
| _jpageviewer_resolve_dir=`dirname "$1"` | |
| # ... unless a mets.xml file exists one directory down (OCR-D workspace) | |
| if [ -e "$_jpageviewer_resolve_dir"/../mets.xml ]; then | |
| _jpageviewer_resolve_dir="$_jpageviewer_resolve_dir"/.. | |
| fi |
| def reportFile = new File("target/site/jacoco/index.html") | |
| if (!reportFile.exists() || !reportFile.canRead()) { | |
| println "[JacocoPrinter] Skipped due to missing report file." | |
| return | |
| } | |
| reportFile.withReader('UTF-8') { reader -> | |
| def html = getParser().parseText(reader.readLine()) | |
| def totalRow = html.body.table.tfoot.tr |