Category Archives: Uncategorised

Cranberry rum cocktail

Cleaning up the cabinet and using up some leftovers :

  • 1 measure of rum
  • 3/4 measure of triple sec
  • 1 measure cranberry juice
  • 1 measure orange juice
  • 1/2 measure lemon (or lime) juice
  • 1/2 measure of agave syrup
  • 1/3 measure of vermouth (e.g. cinzano)
  • 1/2 measure of tequila

Stir well and serve on the rocks!

Barley mushroom risotto

  • 1 package of pearl Barley (3 cups) or Farro
  • 1 big onion, diced
  • ~5-6 cups of broth (keep warm)
  • mushrooms
  • 1-2 cups white wine
  • butter
  1. Melt a big piece of butter in a large pot on medium heat
  2. Add onions, fry for 2 minutes
  3. Add barley, fry for 2-3 minutes, stir almost continuously,  coat well with butter
  4. Add 1 cup of white wine, bring to a simmer and reduce heat
  5. Keep adding in ~1/2 cup of liquid every 5-10 minutes (first the rest of the wine, then the broth). When the liquid is absorbed, add more so that there is barely enough simmering liquid around the Barley, stir often.
  6. Separately, lightly fry the mushrooms in butter, when soft, add to the Barley (maybe start the mushrooms at step 4)
  7. It will take a total of approx 40-50 minutes for the Barley to become soft and absorb the liquid. The barley will stay a little crunchy and chewy.
  8. Add some butter and grated parmesan cheese, and serve

Fresh hot sauce

  • 1 or 2 small super hot peppers (e.g. Ghost Peppers)
  • 4 cherry tomatoes (or equivalent amount in normal tomato)
  • 1/2 clove of pressed garlic
  • salt and pepper
  • 1 tbsp of lime juice (approximately)

Cut everything really small and mash together really well with a fork

Pate – terrine de volaille

  • 350g of chicken livers, cleaned and cut into 1 inch pieces
  • fresh thyme and chives (about 1-2 tbsp worth) OR dried sage+thyme+oregano (about 1 1/2 tsp)
  • 2 shallots
  • 2 gloves of garlic
  • 250g of butter
  • 1 small white wine glass of liquor (brandy, williamine, etc)
  • salt pepper

Melt half the butter in a bowl in an oven at 110C. Poor through a strainer to get clarified butter and reserve.

Melt a small amount of butter in a frying pan at medium high heat, saute the shallots for a few minutes until transparent. Add the garlic and saute for another ~30 s.

Add the livers and the herbs, and saute until browned (~5-10 minutes). The center of the livers should still be slightly pink. Add the liquor and saute another couple of minutes until reduced (deglaze the pan at the same time).

Put everything from the frying pan into a food processor and pulse until coarsly blended. Add the rest of the butter (cut into pieces). Blend until smooth.

Put into a bowl, poor the clarified butter on top (to seal it), and refrigerate for at least a couple of hours.

Easy hollandaise sauce

  • 2 egg yolks
  • 1 tbsp of warm water
  • 1 tbsp of lemon juice
  • 3/4 tsp of salt
  • pepper to taste
  • 1 stick of butter (110g) , melted to liquid (not too hot)

1) Combine egg yolks, water, lemon juice, salt and pepper in a bowl or pan and use an immersion blender to quickly blend together (or do this in a blender). No need to overblend.

2) Slowly add the melted butter while continuing to blend. Once all the butter has been added, the sauce should have a nice silky texture.

Caipirinha

One serving:

  • 1.5 limes (cubed)
  • 1/4-1/2 cup of cachaca
  • Optional: 1/8 cup of triple sec (or orange liquor) – half the amount of cachaca
  • Ice cubes (~3-4 per glass)
  • 2 table spoons of sugar

Muddle the limes, add sugar, muddle more. Poor liquids, stir, add ice.

Tabouleh

Simple tabouleh, modify as desired:

  • 2 cups of couscous (to cook, place in a bowl, off from the heat, with 1 3/4 cup of boiling water, and cover for 5 min, fluff with a fork)
  • 1 large cucumber (cubed)
  • 3 tomatoes (cubed)
  • 6 green onions (diced), or 1 spring onion
  • 1 bunch of parsley (about 1 cup when chopped finely)
  • 1/4-1/2 cup of chopped mint (20 leaves or so)
  • 3 table spoons of lemon juice
  • Olive oil to taste
  • Salt and pepper to taste

Mix all the vegetables together, salt and pepper, lemon juice and olive oil. Add couscous and chopped parsley and mint. Add olive oil to taste. Refrigerate for at least an hour. Keeps for several days in the fridge.

Setting up a VPS to host your own server

Here are some simple instructions to get you started on setting up a virtual private server (VPS), so that you can host your own website. This website, for example, is setup on a VPS. This solution is more flexible, in my opinion, then purchasing “hosting” space, since you have full control over the server (for example, you may need to edit some php settings that hosted spaces don’t always let you do). Also, you can serve as many different websites as you want, and setup any server you like (I use it for VPN, mail, etc). You have to know some Linux though…

    1. Purchase a VPS. I have gotten some good deals on LowEndBox.com; they often have deals going on. You should choose a server with at least 1GB of RAM. KVM might be slightly better than openVZ, but you probably won’t note the difference. If you can, choose one that gives you a tun/tap interface (most do); this is useful if you ever want to setup a VPN (so that your ISP won’t spy on you!)
    2. When you setup your VPS, choose Ubuntu 12.04 or 14.04 64 bit (if you can, otherwise, the most recent version of Ubuntu).
    3. Login to your server and configure it. The VPS provider will have probably given you instructions to login as ‘root’. Once you have logged in by ssh, you should create your own user:
      adduser uname

      and add that user to the sudo group:

      sudo usermod -a -G sudo uname

Disable ssh for the root user (since that is an easy to guess username). Edit the file /etc/ssh/sshd_config and make sure you have the following line:

PermitRootLogon no

(typically just a matter of un-commenting the relevant line)
You should also install a LAMP stack (Linux, Apache, MYSQL, PHP) (google ‘Ubuntu LAMP stack’). As a minimum, install the apache web server, so that you can easily test your server with a browser.

sudo apt-get install apache
  1. Setup a DNS server. If you want to have a website with a domain name, rather than just an IP address. I typically by a domain name from GoDaddy. Once you own a domain name, you need to setup a DNS server (which tells other computers that your domain name points to a specific IP. I use freedns.afraid.org. You can get a free account, then add the domain that you own. If you then go to “sub-domains”, you can setup the IP address of your main domain and any subdomains that you want to setup under it (e.g. www.). Once you have setup the DNS on afraid.org, you need to go back to GoDaddy to manage your domain name and change its “domain name servers”, where you should set them to, for example, ns1.afraid.org, ns2.afraid.org, ns3.afraid.org, ns4.afraid.org (use all four). It might take several hours for GoDaddy and afraid.org to sync up, but when they do, your domain name is equivalent to the IP address (whether by ssh or html in your browser).

Custom environment in Latex that can be hidden

I was writing lecture notes for a class and wanted to provide the students with a version of the lecture notes that they can fill in. In particular, I wanted to have some examples, where I can show the question, but not the derivation. So I created a new environment called ‘example’. I also added in a counter so that the examples would be numbered and can be referenced (with the usual \ref{}).

I had to include these packages:

\usepackage{comment}
\usepackage{ifthen}
\usepackage{color}

The counter is defined by:

\newcounter{example}
\def\theexample{\thechapter-\arabic{example}}

so example is the counter, but the label will reference things by chapter number and example.

To choose whether to show examples:

\newboolean{showexamples}
\setboolean{showexamples}{false} % set this to true or false

The environment is as follows:

\ifthenelse{\boolean{showexamples}}{%
  \newenvironment{example}[3]
  {\refstepcounter{example} \clearpage\vspace{1ex}\hrule\vspace*{1ex}\noindent EXAMPLE \theexample: #2\\ #3 \\}
  {\vspace{1ex}\hrule\vspace{1ex}}
}
{%
  \newenvironment{example}[3]
  {\refstepcounter{example} \clearpage\vspace{1ex}\hrule\vspace*{1ex}\noindent EXAMPLE \theexample: #2\\ #3 \vspace*{\dimexpr#1}\begingroup\color{white}}
  {\endgroup\vspace{1ex}\hrule\vspace{1ex}}
}

It takes 3 arguments: a padding size, a description of the example, and a figure to place for the example (optional). If one chooses to show the example, it shows all the body in the example environment. If one chooses to hide the example, it only shows the title, figure, some blank space, and some additional blank space (determined by the padding). The way the body is ‘hidden’ is by setting the text color to white.

I also defined the following environment for a captioned figure:

\newenvironment{capfig}[2]{\begin{figure}[!h]\center\includegraphics[width=0.5\textwidth]{#1}\caption{#2}\end{figure}}{}

it takes 2 arguments (the filename with the figure and the caption).

Here is an example use:

\begin{example}{0pt}{The Compound Pendulum is a typical example of a simple system that is awkward to describe using vectorial analysis, but straightforward using analytic mechanics.}{\capfig{figures/CompoundPenduluum.png}{Vectorial analysis of the compound pendulum}}
In order to describe the motion of the two masses as a function of time, we start by defining an origin, and label the coordinates of mass $i$ with $x_i$ and $y_i$. We wish to find the functions $x_i(t)$ and $y_i(t)$ given initial conditions on the positions and velocities of the masses. We have 6 unknowns (the accelerations in $x$ and $y$ of the two masses, and the two string tensions).
\begin{align*}
m_1\vec{a}_1&=\vec{T}_1+\vec{T}_2+m_1\vec{g}\\
m_2\vec{a}_2&=\vec{T}_2+m_2\vec{g}\\
\end{align*}
Constraints from in-extensible strings:
\begin{align*}
m_1g\cos{\theta}+T_2\cos{\phi}\cos{\theta}&=T_1\\
m_2g\cos{\phi}&=T_2\\
\end{align*}
The angles are given by:
\begin{align*}
\cos{\theta}&=\frac{x_1}{L_1}\\
\cos{\phi}&=\frac{x_2-x_1}{L_2}\\
\end{align*}
\label{ex:vectorCompPend}
\end{example}