Category Archives: Linux

bibrest – RESTful bibtex server

I recently got bibrest into a usable state, a pet project that is aimed at providing dynamic .bib files for websites. The goal is to have one central point to keep all the publication data, which then gets automatically updated on various websites. The secret long term goal is to use bibrest to keep all of ISTDs or even SUTDs publication data. As bibrest is using an HTTP api, it should be easy to integrate in other tools (e.g. to produce yearly reports). The RESTful part is currently limited to way the resources that are represented, and GET. I plan to add POST/PUT/PATCH in the future, but that will then also require authentication.

In particular, I use bibrest to provide the .bib data for the publication list on this webpage, together with the lists for individual projects (e.g., here). I also use it for similar lists on the scy-phy webpage. The API allows to query a large .bib database for a list of authors, projects (which are stored as new field in the .bib file), and years. Results are sorted chronologically or anti-chronologically. Example calls to the API look like this:

http://bibs.scy-phy.net/bibs?author=tippenhauer,rocchetto&project=aspire&start=2013&inverted=True

The returned data is a bib.bib file with proper MIME type.

bibrest is based on python (flask+pybtex), and available as open source here.

Writing Presentations in Org-mode Markup

For two years now, I am almost exclusively using the toolchain of org-mode+emacs+beamer+pdflatex to prepare my presentations for conferences and lectures. In this post, I want to share the basic setup to quickly reproduce for others. Disclaimer: If you have never used Emacs, then this method might not be very interesting for you.

Install

Install the org-mode for Emacs using ELPA. Make sure the mode is loaded when opening an .org file. Currently, I am using Emacs 24.5.1 (Org mode 8.2.7b).

Minimal Example

Create a test.org file in Emacs:

#+startup: beamer
#+LaTeX_CLASS: beamer
#+LaTeX_CLASS_OPTIONS: [presentation, aspectratio=54]
#+LANGUAGE: en
#+OPTIONS: H:2 num:t toc:nil \n:nil @:t ::t |:t ^:t -:t f:t *:t
#+OPTIONS: TeX:t LaTeX:t skip:nil d:nil todo:t pri:nil tags:not-in-toc
#+LATEX_HEADER: \input{../misc/SUTD-light}
#+latex_header: \AtBeginSection[]{\begin{frame}\frametitle{}\LARGE\insertsectionhead\vspace{0.1cm}\hrule\end{frame}}


#+TITLE: L1 - Introduction
#+AUTHOR: Nils Ole Tippenhauer
#+DATE: 50.020 Security/Spring term/2016

* This is a Section Title
** My first org-mode slide
- You can have bullet lists
- And sub-lists
- You can *highlight* words
- You can /emphasize/ words

I assume that you have the SUTD-light beamer theme installed in ../misc/, but you can also comment out that LATEX_HEADER line to get the default beamer style.
Now, you should be able to compile this to slides by using “C-C C-e l O” Emacs magic. The output can be seen here: org-mode test

Images

To include a centered image into the slide, I normally use the following code, which should be self-explanatory

#+begin_center
#+ATTR_LATEX: :width \linewidth
#+RESULTS:
file:figs/greatFigure.png
#+end_center

Animations, Only

This is where things become a bit messy, but still easy enough. I normally use the “<2->” style animations to put additional bullet points or answers to questions on a slide. The additional text will be invisible at the beginning, but still influence the layout. The “only” style animations do not consider the later content in the first layout, so it is not as useful for text. I use it exclusively to do “manual” animations of figures. For that, I draw each animation step separately (in Inkscape), and exchange the images on each slide.

I use separate blocks for each. In my theme, the standard block actually has same colors as background, so it is invisible. You generate block code by starting a new heading (without title) with ***, and then using C-C C-B b. I then manually add the BEAMER_act line into the block header.

Uncover example:

- This will be displayed first
*** :B_block:
:PROPERTIES:
:BEAMER_env: block
:BEAMER_act: <2->
:END:
- Then this will appear on the second animation slide

Beamer-style “only” is also possible, by using a block like this:

- This will be displayed first
*** :B_block:
:PROPERTIES:
:BEAMER_env: onlyenv
:BEAMER_ACT: <2>
:END:
- Then this will appear on the second animation slide

To export the onlyenv, you need to add the following to your .emacs:


;; only env for org-mode beamer
(add-to-list 'org-beamer-environments-extra
'("onlyenv" "O" "\\begin{onlyenv}%a" "\\end{onlyenv}"))

SUTD Beamer Theme

For teaching and other presentations, I tend to use LaTeX+ beamer. Unfortunately, the default beamer themes are in my opinion all somewhat overloaded and outdated. I spent some time to built two themes for personal use, I call them the SUTD light and SUTD dark theme. The light theme is black font on light grey background, with maroon highlights. The dark theme is white text on dark grey background, with maroon highlights. The main focus is on simplicity – putting only a minimal amount of information on each slide, without wasting space. By default, both themes also include the SUTD logo. The following is an example of a title slide.

slide0

Another example, showing the different bullet point levels

slide1

And an example of the dark theme

slide2

The following information is put automatically in header/footer:

  • Slide title (header)
  • Author name (footer)
  • Talk title (footer)
  • Date (footer)
  • Page number (footer)

The theme can be found on Github. I am looking forward to comments and feedback!

 

Connecting to SUTD VPN from Ubuntu/Linux

This short post summarizes the settings required to connect to SUTD’s Juniper VPN box from Ubuntu (other distros might slightly differ). This is enabled due to MadScientist’s perl scripting magic, and some trial & error on my side.
This setup works for my staff account. Hopefully, it should work for student account, just change the realm to SUTD_Student and the url_1 part in the URLs into url_0

  1. Get the client software from the VPN portal:
    Visit https://sutdvpn.sutd.edu.sg/dana-na/auth/url_1/login.cgi, enter your credentials to get a running session. Then, you are able to download the app using the following commands. Check if the received .jar is correct, it should be 2MB large.
    $ mkdir ~/.juniper_networks
    $ wget https://sutdvpn.sutd.edu.sg/dana-cached/nc/ncLinuxApp.jar -o ~/.juniper_networks/ncLinuxApp.jar --no-check-certificate
  2. get msjnc from http://mad-scientist.us/juniper.html. Install the 32 bit compat libs, and the perl stuff.
  3. starting msjnc (try --fg if needed) should set up everything, and you should get something like this:
    vpn0
  4. Create a new profile with the following settings:
    vpn1
    the full Server/URL is:
    https://sutdvpn.sutd.edu.sg/dana-na/auth/url_1/login.cgi
    username is you SUTD username. I would not enter password here, but each time the client connects.
    Save the profile
  5. Hit the “connect” button, and you should connect!
    vpn2