Random Linux/Latex tricks

This is a collection of various tips and tricks I’ve found useful in my interaction with the standard geek tools I use often. They’re mainly posted here as a reference for me, so don’t blame me if you don’t find it useful… :)

Converting PDF files to PDF-A

Posted 2022-12-17

In order to deposit publications in the NSF Public Acccess Repository, they need to be PDF-A compliant. You can either convert existing PDF files to PDF-A, or use LaTeX to directly create PDF-A files. Here’s how.More »

Disabling the Ctrl-W shortcut on Firefox

Posted 2022-03-29

Many vim users use ctrl-w to delete a word. Unfortunately on Firefox, this closes the current tab. So if you’re editing a text area / filling out a form you may accidentally close the tab 🙄. There’s no option to change or disable default keyboard shortcuts (Firefox 98, 2022-03-29). So if you want to do it, you need to manually edit the file /usr/lib/firefox/browser/omni.ja.More »

Sharing your screen with Zoom under Wayland

Posted 2022-03-26

Screen sharing works fine when you run Zoom on xorg. However, on wayland Zoom’s screen sharing features don’t work anymore. Here are a few methods to make it work.More »

Connecting to eduroam on Linux (at Carnegie Mellon)

Posted 2021-10-25

Instructions on connecting to eduroam (and CMU-SECURE) at Carnegie Mellon on Linux, using iwd.More »

Remotely waking computers behind newer TP Link routers

Posted 2020-04-06

I just bought a TP-Link AX 3000 to replace my old router. My previous router had OpenWrt on it – so to wake up any of my home computers remotely, I could just ssh to my router and run wol. OpenWRT is’t yet supported on this router, however it’s possible to enable with the stock firmware. Here’s how:More »

Making Automatic Backups on Linux

Posted 2020-02-16

Here we describe how to quickly setup efficient, automatic rolling backups on Linux. The backup at any particular week is simply a folder and can be accessed with your usual filemanager. Only the files that changed from the previous week occupy any space. The backups be made remotely, or locally.More »

Blocking SSH brute force attackes on Docker containers with sshguard

Posted 2019-11-02

sshguard protects hosts from brute force attacks by monitoring logs and blocking attackers. It works (almost) out of the box to protect hosts. However, if you are running a Docker container that also provides ssh access (e.g. like gitolite) then brute force attacks aren’t blocked by default. Here’s how to block brute force attacks on your container.More »

Using custom labels with the `alpha` BibTeX style

Posted 2017-12-08

The alpha BibTeX style produces citation labels of the form [Ken90] or [XYZ94]. While it usually does the right thing, sometimes it doesn’t get the label right (e.g. the label is too long when the authors have multiple / hyphenated last names). Here is how you can provide a custom label with the alpha style.More »

Swapping control/caps lock, and using Apple keyboards on Linux

Posted 2017-12-07

I rarely use caps lock and often use control. Since the caps lock key is located on the home row, I find typing more efficient if I swap control and the left caps lock. I also like to swap the command and option modifiers when I use Apple keyboards, and make the funciton keys work without having to use the FN modifier. Here are instructions on each of these.More »

Getting DOI / arXiv links with BibTeX.

Posted 2017-11-14

Many bibliography databases supply a DOI (Digital Object Identifier) or arXiv eprint number with BibTeX entries. However, the standard BiBTeX style files either ignore this information or print it without hyperlinking it correctly. Here’s how you can get working clickable links to both DOI and arXiv eprints.More »

Tags: bibtex

Static Jinja2 Site Generator

Posted 2017-10-21

I recently rewrote my website using staticjinja, a static site generator. This is what my website looks like and here is the source code. The features / setup-instructions are described below.More »

Using git and Dropbox

Posted 2016-04-06

Dropbox isn’t version control. If you use git to version control your files, and have co-authors that use Dropbox then here is a way to use the two systems together.More »

Tags: linux, git

Using Box.com cloud storage on Linux

Posted 2015-08-07

Recently CMU announced all users will have 1TB of space of cloud storage at Box.com. This motivated me to set it up on my Linux box, and this post describes the setup instructions to mount it as a local folder and copy files back and forth. (Note, no syncing instructions are here, since I’m perfectly happy with my unison set up and haven’t tired to set it up yet.)More »

Tags: linux

Reverse chronological sorting with BibTeX

Posted 2015-03-24

How to sort references chronologically, reverse chronologically or change the references title.More »

Tags: latex

Using UTF-8 in mrxvt, even though mrxvt doesn't support it

Posted 2014-09-14

I use mrxvt (see also the SourceForge page) as my terminal emulator. Unfortunately it lacks utf8 support. (We have an experimental utf8 branch, but never managed to make it usable.) Here are a few things I’ve done that allows me to keep using mrxvt and interact correctly with UTF-8.More »

Tags: linux

Transfering files to Android Devices in Linux

Posted 2014-08-10

Transfering files to/from a android device to a Linux box via mtp-tools, FTP over USB, or ssh.More »

Tags: linux, android

De-Uglyfying ikiWiki and other horror stories.

Posted 2014-07-20

These are old instructions on how to theme ikiWiki and might not be relelvant anymore. I no longer use ikiWiki to maintain my website. This site is generated using staticjinja and a custom build script.More »

Tags: linux, ikiwiki

Setting up a Debian/testing chroot on stable (wheezy)

Posted 2014-07-16

I run Debian/wheezy on all my computers, mainly because I can’t afford the downtime. However, once in a while, I encounter programs I need that are only in testing. For instance the new (2014-07-16) Viber linux client needs glibc-2.14 or higher, and wheezy only has 2.13. Some blog posts suggest installing libc6 from testing on your wheezy system, but I think that’s playing with fire. libc6 is crucial to many packages, and I’m not sure things will work fine if you upgrade it.

I decided to set up a Debian/testing chroot, and then install whatever I needed under it.More »

Tags: linux

Maintaining an old texlive installation.

Posted 2014-07-12

How to subbornly continue using an obsolete version of texlive well after its due date.More »

Tags: latex, linux

Adjusting the space between references in the bibliography.

Posted 2014-07-12

If you use LaTeX and want to adjust the spacing between each item in your bibliography, then here are two ways to do it.More »

Tags: latex

Expanding aliases in zsh

Posted 2014-06-25

I wanted to make some of my zsh aliases behave like vim abbreviations: Namely, as soon as you press space, the alias is expanded and you see the expanded command before executing it. Since I have a large number of clunky aliases, I didn’t want all aliases to be expanded by default.

Consequently, I came up with the following (based on something I first saw here).More »

Tags: linux

LaTeX forward/inverse searches with Zathura

Posted 2014-03-10

I use zathura to view PDF files. As of version 0.2.7 it supports full forward / inverse searches with LaTeX. Namely, you can “control click” in any place on the PDF file, and it will open the TeX source file in your editor, and move to the corresponding location. Conversely, you can configure your editor so that pressing a particular key when editing your TeX file will open the PDF file and highlight the corresponding location.More »

Tags: linux, latex

Using bibtool to fix your BibTeX databases.

Posted 2014-03-04

Downloading BibTeX citations from review sites (e.g. MathSciNet, WebOfKnowledge) doesn’t always get you consistent results. Sometimes the case is messed up, there are extra braces, etc. Or there is a note field showing the number of citations (which shows up in your final PDF output). Moreover the citation keys are often of the form MR673830, which is useless unless you’re a computer. Here’s an easy way to fix most of these problems using BibTool.More »

Tags: latex

KVM Macvtap vs bridging

Posted 2014-03-03

Switching my KVM networking from a bridged setup bridged setup to macvtap got me a huge performance improvement. Here are instructions on how to set it up.More »

Tags: linux

Accessing Journals via an SSH proxy

Posted 2014-03-03

Most universities have IP based authentication for access to Journals and index sites (MathSciNet, Web of Knowledge, etc.) If you’re off campus, they usually provide some VPN client (e.g. Cisco) which is quite painful to work with (at least on Linux). However, if you have ssh access to a machine on campus, you can access set up a proxy and access journals very easily.More »

Tags: linux

Using Git and latexdiff

Posted 2014-03-01

If you use git to manage your LaTeX documents, then you can easily integrate latexdiff to produce a PDF of the differences. Here are setup instructions.More »

Tags: git, latex, linux

Installing older versions of Pentadactyl in Firefox

Posted 2014-02-18

The “latest” release of Pentadactyl doesn’t always run on any modern version of Firefox. Here’s how to get and install the bleeding edge version from the source tree.More »

Tags: linux, vim

Setting up WordPress on your own server

Posted 2014-01-29

Tips I found useful when installing WordPress on my own server.More »

Tags: linux

LaTeX headers to maximise space.

Posted 2013-09-30

A few tricks to save space when writing documents (e.g. NSF proposals) that have strict font, margin and page restrictions.More »

Tags: latex

Setting up ikiWiki and MathJAX

Posted 2013-09-30

These are old instructions on how to set up ikiWiki and MathJAX, and might not be relelvant anymore. I no longer use ikiWiki to maintain my website. This site is generated using staticjinja and a custom build script.More »

Tags: ikiwiki

A git quickstart guide for LaTeX users

Posted 2013-09-29

Git is a source control management system that you can use to track changes in any text file. Git, however, is quite complicated and learning it can be quite time consuming. This is a quick introduction to git for someone who will primarily use git to edit LaTeX/text documents (not code) and possibly collaborate with a handful of co-authors.More »

Tags: git, latex