How to buy a car in the US as a foreigner

When I went to the US last year on a J-1 visa, I had to figure out how to buy a car. I had never owned a car before, and I obviously did not have a US driver license.

If you are thinking about buying a cheap car for a road trip in the US to save on rental costs, it is probably not worth it: buying a cheap beater car exposes you to the risk of it breaking down, which will then cost you a lot of money to fix it. Buying a nicer car will cost you a lot of money upfront, and there is no guarantee that you will be able to sell it again at a good price. Also, you will spend at least a couple days shopping around and at the DMV.

This guide is for people who want to stay in the US for at least half a year or so. Note that I did this in Texas, YMMV in other states. The absolute minimum required:

  • A valid driver license from your home country
  • Money (car price, insurance premiums, a couple 100$ in fees and taxes)

Also useful:

  • A US residence and mailing address. This can probably be worked around by telling the people at the DMV that you just moved here and don’t have a fixed address yet, and they will then text you so that you can pick up your mail at the DMV.
  • US bank account. If you don’t have one, you need to pay in cash, unless the buyer accepts a foreign money transfer via TransferWise or so (unlikely).

Find a car

There are two ways to buy a used car: from an used car dealership, or from a private seller. Private sellers are cheaper, but more risky. Also, dealerships can do a lot of the paperwork for you.

There are countless used car websites (,,, …) which have private as well as dealership listings. Use Kelly Blue Book to check prices and compare them. On, you will find mostly private offerings.

If you buy from a private seller, it might make sense to invest 100$ to get the car checked at an independent car mechanic before (I did this). Never buy a car before test driving it. Test all the details, it’s very annoying if the defroster doesn’t work or the sunscreen keeps folding down. If the car makes funny noises, don’t buy it.

Write down all the details like license plate number, year of build, VIN etc. You will need that to get insurance. It might also make sense to check CarFax to see if the car has been in an accident before.

Insure it

When you buy a car, the seller is supposed to still insure it for 30 days. However, you should buy insurance even before the transaction. You will need it anyways before you can register the car at the DMV.

The only insurance company I could find which accepts foreign drivers licenses is was Progressive. Just call them or do it online. Print the “proof of insurance”, it goes into the car glove box. When you get pulled over by the police, that’s the only piece of paper they really care about.

Ask the insurance if “time first licensed” includes time on foreign licenses. This might save you a little on the premiums.

The transaction and payment

After you have decided for a car, you will have to buy it. You should bring the following documents:

  • Texas DMV title application
  • A simple car bill of sale (Google for a template), a copy for you and one for the seller
  • Your proof of insurance

The seller should bring the title document. If he does not have it, he does not have proof that he legally owns the car. Don’t give him any money.

Also, the seller might want to take off the license plates before the transaction. In this case, he should bring temporary paper license tags (can be ordered through the TxDMV website).

After filling in and signing all the documents, you will have to pay. Your options, in order of recommendation:

  • Venmo (only works up to 2999$)
  • Check
  • Cashiers Check
  • Cash

Register it at the DMV

Go to the DMV with all the documents mentioned above. Ideally, you will go together with the seller. If not, make sure you have all the documents signed and ready (see the DMV website for a list). It is heavily recommended to get an appointment online, otherwise you will spend hours waiting at the DMV.

They will give you new license plates if needed, and then you are ready to go! The altered title document in your name will be in the mail after two weeks or so.

Bonus: Get a US driver license

Reasons to get one:

  • doubles as ID card, no more bringing your foreign passport everywhere
  • more choice of insurance, and premiums will be much cheaper (ca. 40% for me)
  • you need one anyways if you stay for more than a year
  • back in Europe, you might be able to get EU categories C1/D1/E added to your license for free by exchanging the US license

In the Texas, the DPS (not DMV) hands out driving licenses. Inform yourself on their website. You will have to take a theory test (when you first go there), then do a practical exam (do it at a private driving school if you don’t wanna wait for 2 months), and then go to the DMV again to get your license.

3D waterfall plot in WebGL

In 2016, I finally learned OpenGL.

So I decided to ditch THREE.js and rewrite my old Waterfall-Plot project in pure WebGL. The only external Javascript library used is gl-matrix for matrix transformations.

All the line offsetting (z-direction in time, y-direction for frequency magnitude) is now done directly in the shader. This makes the animation much smoother, as no THREE.js points/lines have to be created and destroyed anymore. It also allows more flexibility in color effects.

To hide the lines behind each other, a gl.LINE_STRIP of triangles is rendered for each line. DEPTH_TEST is not enabled, the lines and triangles are just rendered in the right order.

Live demo

Press zxcvb for some color presets.

Use q for enabling/disabling lines, and wertyu for changing the line color. Use a for enabling/disabling the stripes, and sdfghj for changing their color. Use 1234 to change line thickness.

Sample 1 Sample 2
Sample 3 Sample 4
Some samples.

Find the project on Github.

This website has been moved!

This website used to be hosted on

My studies at ETH will end soon and I will consequently lose the home directory web hosting there. To not lose the audience (and Google ranking), I decided to act early enough (1 year) and redirect everything to the new address via 301.

Redirect without mod_rewrite


  • mod_rewrite via .htaccess does not seem to work on
  • or I did not manage to get it to work
  • and was too lazy to ask support

my solution looks like this:


ErrorDocument 404 /~muejonat/index.php


    preg_match('#/~muejonat/(.*)#', $_SERVER[REQUEST_URI], $matches);
    header('Location: '.''.$matches[1], true, 301);


ETH supercomputing for beginners

Disclaimer: for this to work, you must be an ETH Zurich affiliated person and own a nethz-account.

So, you wanna play around a bit with machine learning. Or run a crazy particle physics simulation. But you only have a lame Macbook. Your gaming rig would do the job, but its fans are spinning so loud your neighbors complained. Solution? Just use ETHs Euler general purpose super computer! Even though they explicitely write that Euler is “not a supercomputer”, supercomputer just sounds cooler than “general purpose” computer.

So called shareholders (lab groups and ETH departments) invested money to own a reserved percentage of Eulers computing power. However, there is also a slice reserved for us students. The best thing about it? It works without need for any bureaucracy. Just log in and start.

Python example

We will run an example from the scikit-learn website for demonstration. There will be some some small changes, because we have no GUI. But first, let’s log in. Important: you can only log in to Euler from within the ETH network or when connected via VPN.

ssh <your nethz-name>

You will be greeted with a disclaimer you have to accept by typing Yes the first time. Then, we can start by loading the python module.

module load python/2.7
# get sample script from scikit-learn

Now you’ll have to modify the script to make it run without X11. For this, we have to tell matplotlib to write to disk instead trying to display the images directly. Modify the downloaded file at the top and the bottom to look like this:

# at the top of the file,
# after the long introductionary comment

from time import time

# those two lines must be inserted here
import matplotlib

import matplotlib.pyplot as plt
import numpy as np


# bottom
# replaced by the following line

When you submit a job for the batch processing system, it will inherit the current environment. As we already loaded the python module, we are now ready to go:

# submit job
bsub "python"
> Generic job.
> Job <9613719> is submitted to queue <normal.4h>.

# you can now check the status of your job via bjobs
> 9613719    muejo   RUN   normal.4h  euler01     e1096       * Aug 25 00:34

After some time, in the directory a file called lsf.o<jobid> will appear, besides the plot.png our script generated. That’s it, we’re done!


  • Your job will be killed after 4 hours. You can use an option -W hh:mm with bsub let it run longer, but it will wait longer in the queue.
  • Same is valid for CPU cores (-n 2 uses 2 cores instead of 1) and memory (-R "rusage[mem=2048]" uses 2GB per core). You can use up to 48 cores at the same time (check using busers, MAX). If you submit several jobs, requiring more than 48 jobs in total, they will be run sequentially. If you submit a single job requiring more than 48 cores, it will probably be stuck in the queue forever.

Further information (only accessible from within ETH network):

If you need some special packages

You can install libraries via PIP locally in your home dir.

mkdir -p $HOME/python/lib64/python2.7/site-packages
export PYTHONPATH=$HOME/python/lib64/python2.7/site-packages:$PYTHONPATH
module load python/2.7

# now, install e.g. theano
python -m pip install --install-option="--prefix=$HOME/python" theano

Some packages require Euler module dependencies. For example, if you wanna use h5py, you have to load the hdf5 module before loading the python module:

module load hdf5
module load python/2.7.2
>>> import h5py
# works!


Only the not publicly-accessible Leonhard cluster has GPU nodes. So if you need that, you will have to ask Cluster Support.


I am a student who does not know anything about scientific computing, let alone ETHs HPC infrasctructure. This blog post just tries to provide some guidance for students. I do not provide any support. Also, I am not responsible if the admins get angry at you because you ran your stuff on a login node.

Find support here

For D-ITET students

There is an additional resource for D-ITET students. You can run jobs on the idling tardis machines (in the ETZ computer rooms). If you ever wondered, that is the reason for the “do not turn off” labels. The batch system is very similar to the one on Euler. Find more infos in the D-ITET Computing Wiki.


This post was updated on Jan 26 2017 to reflect the decomissioning of the old Brutus cluster and its Wiki. The new Wiki is now to be found here (Only from within ETH network!).

Javascript 3D waterfall plot

For a long time, I wanted to try out WebGL. After some initial research, it became clear that it is not that simple to use WebGL without having prior experience with OpenGL. Thats why I settled with THREE.js. This library abstracts away all the WebGL things and gives you a nice 3D interface.

I have for a long time liked Joy Divisions Unknown Pleasures album cover. You can find something about its history here.

The idea now was to recreate a live version of this cover, using audio data from the PC microphone. So I also could learn the basics of webRTC!

Live demo (click here)

The result.

Find the project on Github.