All posts by rmartin

Tzatziki

  • 1 cucumber
  • 1  package of Greek yogourt (500g)
  • 3-4 cloves of garlic – minced
  • ~1 tbsp pepper
  • 1/4 cup of fresh chopped dill
  • 1 1/2 tbsp lemon juice
  • salt

Cube the cucumber, sprinkle with some salt, and press it for ~30min to get the water out.

Process the cucumber coarsley. Mix in all the other ingredients and refrigerate overnight.

Ceviche

  • 1-2 pounds of cooked seafood (e.g. shrimps, scallops, squids)
  • 200ml of lime juice
  • 50ml of orange juice
  • 50ml lemon juice
  • handful of chopped cilantro
  • 2 chili pepper chopped finely
  • 1 small red onion cut into thin strip
  • salt

Mix all together, let rest in the fridge for at least 2 hours.

Meteor on Windows with standalone MongoDB

In this post I describe how to run Meteor on Windows with a standalone DB (rather than the one that runs by default from Meteor). This allows us to run an instance of MongoDB that can communicate with other computers.

  • Install Meteor for Windows
  • Install MongoDB Community edition for Windows
  • Open a command prompt, type ‘md /data/db’ (this directory is needed to store the database files)
  • Navigate to the directory where mongod.exe was installed (for me, this was ‘C:\Program Files\MongoDB\Server\3.2\bin’)
  • Type ‘mongod.exe’ to start the MongoDB server; the first time, this will prompt Windows Firewall to ask if you want to allow an exception (choose yes, keeping in mind that you are allowing any incoming connections to write to the db; you can limit this to private networks, and you can turn off the mongod when not using it)
  • Open another command prompt and type ‘setx MONGO_URL mongodb://localhost:27017/meteor’ – You should only need to do this once; it sets the MONGO_URL environment variable in the registry; Meteor will now use the new instance of MongoDB instead of starting its own, and will assume that everything is in a database called ‘meteor’.
  • Navigate to a meteor project, and start meteor – Note that it should not output a line relating to “Started MongoDB”, since mongodb is already running.
  • Meteor should now be using the database ‘meteor’ running on the mongodb that you started
  • You should now be able to connect to the MongoDB from another computer on the local network. For example, in python, the following will work (replace XXX with the correct IP):
  • #! /usr/bin/python
    from pymongo import MongoClient
    #Connect to the database (default for meteor)
    client = MongoClient('192.168.1.XXX',27017)
    dbs = client.database_names()
    print(dbs)
  • When you are done,  quit meteor, then quit the terminal running mongod.

Veggie burgers

  • 1 can chickpeas
  • 1 can beans
  • 1 onion
  • 2 eggs
  • 3 portobello mushrooms
  • ~3/4 cup of bread crumbs
  • 1 tbsp pureed garlic
  • 2 tbsp mustard
  • 1.5 tbsp cumin
  • smoked paprika
  • salt, pepper

Process the onion in a food processor, then add the chickpeas and process (but not too much). Remove from food processor. Process the mushrooms until they are almost a puree, then remove them. Process the beans, and then remove them. Mix everything together, make patties,  and cook in a well oiled frying pan on medium low, about 15-20min total. Makes about 12 burgers.

Bean salad

  • 2 cans of mixed beans
  • 2 tomatoes, diced
  • 2 peppers, diced
  • 1 onion, diced
  • 1 cucumber, diced
  • ~4 tbsp vinegar (e.g. cider vinegar)
  • ~4 tbsp oil
  • ~2 tbsp lime juice
  • sprinkle of smoked paprika
  • salt, pepper

Mix everything together in a bowl and store in the fridge!

Baked oats

Preheat oven to 325F.

  • 4 apples (or whatever fruit), sliced. Or a bag of frozen fruits.

Spread fruits on the bottom of a ~8-10″ corningware baking dish.

Mix together in a bowl:

  • 1 cup steel cut oats (or 2 cups of rolled oats and double the other dry quantities)
  • 1/2 cup almonds
  • 1/2 cup raisins/dried cranberries
  • 1/2 cup hulled hemp seeds
  • 1/2 cup of dried coconut

Mix together, then pour over the oat mixture:

  • 2 1/4 cups milk
  • 3 eggs
  • 1 tbsp vanilla
  • 1 pinch of salt

Let the mixture soak in for 30min if using the steel cut oats before pouring over the fruits and putting in the oven.

Cook for 65min at 325F (I use convection bake setting)

Prepare a large batch in advance without the oats (12 cups)

  • 3 cups hemp seeds
  • 3 cups raisins
  • 3 cups dried coconut
  • 3 cups almonds

Then, when preparing the oats, use one cup of oats and 1.5-2 cups of the mix above

Whole wheat bread

  • 2 1/2 cups whole wheat flour
  • 1 cup white flour
  • 1/2 cup seeds
  • 2 1/2 tsp dry active yeast
  • 1 1/2 tsp salt
  • 1/4 cup sugar
  • 1 cup water
  • 1/4 cup milk
  • 1/4 cup vegetable oil

Mix all the dry ingredients in the mixer for 30s, then add the wet ones, and kneed on low speed for 6-8 minutes.

Let the dough rise for ~60 minutes covered in a lightly greased bowl.

Shape the dough and then let it rise for another ~60 minutes.

Bake for ~50 minutes in the oven pre-heated to 350F.

Flashing the Jetson TK1 and installing CUDA

A few notes on flashing the Jetson TK1, in case I need to do this again…

I flashed the 21.3 version of Linux for Tegra. The first step was to download the files into a directory on a Linux system, on a Linux partition (originally, I was unpacking these in a ntfs partition shared with the Windows part of my dual boot configuration, which screwed up the permissions when unpacking – this was subtle!):

  • http://developer.download.nvidia.com/embedded/L4T/r21_Release_v3.0/Tegra124_Linux_R21.3.0_armhf.tbz2
  • http://developer.download.nvidia.com/embedded/L4T/r21_Release_v3.0/Tegra_Linux_Sample-Root-Filesystem_R21.3.0_armhf.tbz2

Then, I could roughly follow the instructions from NVIDIA. Let’s assume the two files above are in a directory called ~/reflash/ on a Linux computer (e.g. my laptop, which is running Ubuntu 12.04).

cd ~/reflash
sudo tar xpf Tegra124_Linux_R21.3.0_armhf.tbz2
cd Linux_for_Tegra/rootfs/
sudo tar xpf ../../Tegra_Linux_Sample-Root-Filesystem_R21.3.0_armhf.tbz2
cd ..
sudo ./apply_binaries.sh

Now, you have to put the Jetson in recovery mode. Connect the Jetson to your PC using the microUSB port on the Jetson, then hold the recovery button down on the Jetson and the press the Reset button once, or the Power button if it was off. The Jetson doesn’t seem to display anything to the screen when in recovery, so I wait, say, a minute to be really sure it’s in recovery. Then type ‘lsusb’ on the PC to make sure it lists a device by “Nvidia Corp.”, to ensure you can actually talk to the Jetson.

Now, the next step is to actually flash the thing, but there are a few issues:

  1. The default flashing instructions won’t use all the space available on the embedded memory (uses about 8GB instead of 16GB), which may be annoying if you need to have more toolkits installed. To use the full space, use the flag ‘-S 14580MiB ‘ (and you may have good reason not to do this – note that is the maximum you can use, as discussed on the elinux wiki).
  2. On the ubuntu version that I was running, /dev/loop0 was already being used, so the flash script failed since it is hard coded to use /dev/loop0. A neat trick I found to get this to work was to type ‘losetup –find’, which for me showed /dev/loop1 as the first available device. I thus edited flash.sh to use /dev/loop1 instead of /dev/loop0 (it was around line 440 of flash.sh)

With those 2 notes in mind, the next step on the PC was:

sudo ./flash.sh -S 14580MiB jetson-tk1 mmcblk0p1

This took about 30min, after which the Jetson will automatically reboot. The instructions say to “Reset” the board (even though it just rebooted), so I unplugged the USB cable and pressed the Reset button. The network cable was plugged into the Jetson the whole time, so when it rebooted, I had no issue logging in using ssh (checked my router status page to figure out the right IP address for ssh).

CUDA was easy to install from the instructions on elinux. I downloaded the following onto the Jetson:

  • http://developer.download.nvidia.com/embedded/L4T/r21_Release_v3.0/cuda-repo-l4t-r21.3-6-5-prod_6.5-42_armhf.deb

I actually downloaded it to my PC and scp’ed it to the Jetson.  Then I followed the instructions from elinux, and typed the following on the Jetson:

sudo dpkg -i cuda-repo-l4t-r21.3_6.5-42_armhf.deb
sudo apt-get update
sudo apt-get install cuda-toolkit-6-5
sudo usermod -a -G video $USER

I tested that CUDA installed by typing on the Jetson:

nvcc -V

and then proceeded to install the examples and compile them.