Skip to content

Instantly share code, notes, and snippets.

@rxm
rxm / aminer.md
Last active September 27, 2022 11:48
Screenshot of aminer.org on 29 Nov 2021
@rxm
rxm / mercurual5onAWS.md
Last active June 7, 2021 23:51
Mercurial 5 on AWS Linux 2

Installing a recent version of Mercurial on AWS Linux 2

The default Yum repositories for an EC2 AWS Linux 2 machine will install Mercurial 2.6.2. Version 5.8 is the most recent version available as of June 2021. AWS has announced that they will not be upgrading the Mercurial RPM (for us three Mercurial fans). To get a newer version of Mercurial on a AWS Linux 2 machine one needs to install it oneself. It is real easy:

# pre-requisites
sudo yum install -y python3-devel gcc

# install Mercurial from PIP
# uninstall of old mercurial was not needed
@rxm
rxm / keybase.md
Created November 1, 2020 12:11
Keybase.io Proof

Keybase proof

I hereby claim:

  • I am rxm on github.
  • I am rxm (https://keybase.io/rxm) on keybase.
  • I have a public key ASC47INyW3Brzo0BBj3JueL3r6yAegOFNgyV3QGCDxL5dgo

To claim this, I am signing this object:

@rxm
rxm / Makefile
Last active March 5, 2019 00:25
Simple makefile for tex
# name of report
FINAL = BigReport.pdf
.PHONY: all clean bib error report package
all:
@ echo Building
@ if [[ ! -d build ]]; then mkdir build; fi
TEXINPUTS=".:./aux:" \
xelatex -interaction=batchmode -output-directory build main
@rxm
rxm / sshPemKey.md
Created July 16, 2018 16:26
Create an SSH key in PEM format

Create an SSH key in PEM format

I have not been able to use ssh-keygen -e to reliably generate a private key for SSH in PEM format. This format is sometimes used by commercial products. Instead, I had to convert the key using openssl.

# generate an RSA key of size 2048 bits
ssh-keygen -t rsa -b 2048 -f jabba -C 'ronnie-jabba'

# copy key to 10.1.56.50 and add to authorized_keys
@rxm
rxm / dockerCheat.md
Last active July 7, 2018 21:30
Cheat sheet for docker commands
@rxm
rxm / localpip.md
Last active June 9, 2019 15:52
Local Python package installs on the macOS

On my laptop I like to keep my Python packages installed in my account. This way I avoid overwriting something the system may need. For that to work I need to tell Python where to find the packages, which is done by setting a few Python environment variables.

For other ways of having local versions of Python, see:

Create the the site-packages folder with

@rxm
rxm / selfExtracting.md
Last active July 6, 2019 20:38
Self-extracting encrypted file on the Mac

Sometimes it is convenient to have a simple command that will print a few credentials to the shell (certificate passwords, ZIP archives, etc.). When I run the command below in the terminal, a small modal window pops up asking me to unlock my login keychain. The script then fetches the password to decrypt the contents of the file to stdout.

To transform a file conf.txt into this self extracting file, first encrypt it with Blowfish (or the more standard aes-256-cbc instaead of bf)

    openssl bf -e -salt -a -in conf.txt -out econf.txt

You will be asked for a password twice on the command line.