Random ramblings about Mac, Python, TeX, programming, and more   |     |        |     |  



Using PlistBuddy when I want to open Emacs from a link in an HTML file on OS X

December 14, 2017  |  web, os-x, software, programming

Previously, I have discussed How to open Emacs from a link in an HTML file on Mac OS X. This post is just to give a complete overview of how this can be done without too many manual tasks. My complete AppleScript program and its Makefile is available for download. It should only be used with your own modification.  It includes the usage of cvs to commit the changes in the bib files to my local cvs …

Last updated: June 22, 2024

Run all Airmail rules

October 26, 2017  |  os-x, tools, programming

I currently use Airmail as my Mac (and iOS) mail client. With many email accounts I found that Airmail fits my needs OK. And I have created a large number of rules that are automatically performed on new emails in my inbox. However, for different reasons I would sometimes like to perform all my rules manually. As far as I know this is not possible in the Mac version of Airmail. So, I had to implem …

Last updated: June 22, 2024

Open Emacs from a link in an HTML file on Mac OS X

December 14, 2015  |  web, os-x, programming

Since I do most of my writing in LaTeX, I have all my references (publications I cite when I write papers) in a series of bib-files (for BibTeX). To easier browse and search these references I have created a small Python script that generates a HTML document with all these references. Each reference also includes a link to the bib-file this reference was found in. In the link, I include the key of …

Last updated: June 22, 2024

Non breakable spaces in Word

September 22, 2015  |  publ

I prefer TeX and friends (LaTeX, MetaPost, BibTeX) when writing papers. But sometimes I have to use Microsoft Word. One annoyance I have observed in many documents written in Word is line breaks (word wrapping) in the wrong places. Not all spaces are the correct place to break lines in a text. In TeX, I would write the tilde (~) character instead of a space, and in HTML, I would use the character …

Last updated: June 22, 2024

Cryptography with Python 3

May 15, 2015  |  os-x, tools, python, crypto, programming

In 2012 I posted a post on using PyCrypto with Python 3 and some AES and RSA examples. Now, I usually use the cryptography Python library (implemented for both Python 2 and 3). I have ported all my PyCrypto examples from 2012 (see the README file) to the cryptography library.

pycryptex.py / pycryptex-cbc.py

pycryptex.py [src] is a small example using AES to encrypt and decrypt a text:

> python3 pycry …
Last updated: June 22, 2024

Run automator workflow with keyboard shortcuts

April 27, 2015  |  os-x, tools, programming

In the last post we demonstrated how to automate a task using AppleScript and the Fake scriptable web browser. Often, I use Automator included on every Mac to perform such tasks. To activate them, we bind them to a keyboard shortcut in the given application. The example we will use today is to press a keyboard shortcut to load the remote content of an email in Mail.app (you have of course turned o …

Last updated: June 21, 2024

Automate tasks with AppleScript, Fake, and the keychain

April 27, 2015  |  web, os-x, tools, programming

You can make life a lot easier on your Mac if you learn how to automate things. The standard approach to do this on Macs is to use Automator (see How to use Automator: What Automator is and how it works from Macworld UK). If you include AppleScript, Fake, and the keychain in your toolchain, you can achieve even more. As an example I will develop an automated task to create a new email alias using …

Last updated: June 21, 2024

Including source code in papers and on the web

March 20, 2015  |  web, publ, tools, python, programming

I've written many papers and a lot of web pages that includes source code. Since Python code was an important part of my Dr. thesis, I even wrote a tool to generate a pretty-printed Python code for LaTeX (this was written in 1997, but since I've been using it ever since it has had a few minor bug fixes since then; however, it needs Python 1.6 and it was the first Python program I ever wrote!). Jus …

Last updated: June 17, 2024