Line Numbers in Hugo Codeblocks

I want my code blocks on the blog to sometimes have line numbers. Looking at the Hugo docs here and here led me to the linenos argument. While we’d start our code blocks like (```python)1, all I need more is to add the line number argument like so. Vanilla code block … print(f""" “It’s silly to try to escape other people’s faults. They are inescapable. Just try to escape your own.” — Marcus Aurelius """) print(f""" “Just that you do the right thing. The rest doesn’t matter.” – Marcus Aurelius """) Now, using the linenos option, I can be all fancy to show … ...

September 17, 2022 · Mario Jason Braganza

Drafts App Needs Escaping if I Am to Use Hugo Shortcodes

When I finally figured out how to get line breaks working on my microblog, I ran into another sort of hiccough, when I tried doing that from my phone. I use the Drafts app on my phone and tablet to slice and dice all manner of text and to send it to various locations as I please. One of those is a workflow, that lets me shoot text to a folder on my server which is then published (via a script) on the microblog. And everytime I typed my {{< hbr >}} Hugo shortcode to let me have a line break in that post1, it would just publish gibberish2 instead of giving me said break. ...

September 14, 2022 · Mario Jason Braganza

Line Breaks on My Microblog

I use a (not quite) hidden blog to collect all sorts of bits and bobs and to (selectively and automatically) publish them to my fediverse or twitter accounts. The one thing that constantly bugged me, was that it would not accept line breaks to differentiate between paragraphs. Like this post, here. I don’t know if it’s my theme or a Hugo thing. And try as I might, I couldn’t quite figure it out. Since I don’t quite have the time to dig into the code, I just decided to add a couple of <br> tags. And that did the trick! 1 ...

August 31, 2022 · Mario Jason Braganza

Notes to Self on Renewing Wildcard Certbot Certs

(Update, 2024-03-15: I now use lego. will update this post later.) After struggling to renew my certs for the third time in a row, hopefully these pointers should keep me on track for the next time. Namecheap does not yet support automatic wildcard renewal for the Letsencrypt/Certbot combo. Check next year. Have your Namecheap control panel open and ready. Switch to root or run the command below with sudo Command to renew: certbot certonly --manual --manual-public-ip-logging-ok --preferred-challenges dns-01 -d *.domain.com -d domain.com certbot will then, print a couple of lines that you need to add as a TXT record in the Namecheap DNS control panel. When you do that, make sure you set the TTL of the record, to a minute, so that you can redo stuff quicker, if you mess up. certbot might ask you to do multiple records. Read the instructions carefully. When you check to see if the TXT record is set, search for the whole domain name. For e.g. _acme-challenge.domain.blah instead of just domain.blah If you’ve done all of the above, hopefully things should go smoothly and the certificate should renew. Restart Nginx and you’re done. If you have multiple machines, figure out a way to securely transfer the certs there too. P.S. Subscribe to my mailing list! Forward these posts and letters to your friends and get them to subscribe! P.P.S. Feed my insatiable reading habit.

August 20, 2022 · Mario Jason Braganza

Emacsclient Does Not Recognise Compose Key Sequences

Originally published 2021/10/27. Updated to include the .xssessionsrc point I run pretty often into this issue, so this is a checklist for me. Issue being, that I cannot use Compose key sequences to type out the characters I need. Case in point being, the apostrophe ’ and the quote marks “” , ‘’ that I use, all the live long day. Make sure that emacs is running as a service. It runs in your user, so check status with systemctl --user status emacs.service Do the normal computer user thing. Restart the service.systemctl --user restart emacs.service.1 Make sure the system is UTF-8 everywhere. (en_IN.UTF-8 does not work for me. Make sure it’s en_US.UTF-8) One place that Emacs looks is the .xsessionrc file in the home folder. These are the contents of mine. My Emacs refuses to let the compose key sequences work, unless it’s present LC_NUMERIC=en_US.UTF-8 LC_MONETARY=en_US.UTF-8 LC_PAPER=en_US.UTF-8 LC_NAME=en_US.UTF-8 LC_ADDRESS=en_US.UTF-8 LC_TELEPHONE=en_US.UTF-8 LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=en_US.UTF-8 LC_TIME=en_US.UTF-8 PAPERSIZE=a4 LANGUAGE=en_US LANG=en_US.UTF-8 if [ $DISPLAY != ":0" ] then export XAUTHORITY=${HOME}/.Xauthority fi This should do the trick 99% of the time. ...

July 31, 2022 · Mario Jason Braganza

Installing PyCLD3 on an Apple M1 Mac

While building my work product on the fancy-schmancy M1 work Mac, I kept running into clang errors, when I did a pip install Turns out, PyCLD3 would not build. So I did it manually. This tip on Github did the trick We need brew installed. And then we run the following commands in a terminal … brew install protobuf #install protobuf # set various compiler flags export GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=1 export GRPC_PYTHON_BUILD_SYSTEM_ZLIB=1 export CFLAGS='-I /opt/homebrew/opt/protobuf/include' export LDFLAGS=-L/opt/homebrew/opt/protobuf/lib # install pycld3 python3 -m pip install pycld3 And we’re set! ...

March 30, 2022 · Mario Jason Braganza