Skip to main content

Posts

Vagrant up in the cloud (DigitalOcean)

It's quick and easy to start your virtual machine in the cloud if you use vagrant. Like, 55 seconds fast. I find it especially handy for toy projects that I need on the web quickly or when I don't want another virtual machine to gobble up resources on my laptop. I'm going through the steps for DigitalOcean. It's similarly easy for Amazon Web Services (AWS), but I find their web interface somewhat discombobulated.

A word on pricing: if you use the cloud for a small project it's basically free. A full day on Digital Oceans costs 16 cents. That's (hopefully) less than you tip on a cup of coffee. There are a lot of online coupons that'll get you through the first few months. AWS offers a full year for free, see http://aws.amazon.com/free/.

I'm assuming that you have vagrant installed and a Vagrantfile already written or generated with vagrant init. Ok, let's get started! First, download the vagrant plugin.

vagrant plugin install vagrant-digitalocean
Sign …
Recent posts

mod_rewrite vs CNAME changes

I thought I could be smart and redirect to a google sites project, instead of changing the CNAME entries. I had to learn that a mod_rewrite to a different url always does a visible redirect to the substituted url, so no faking that it's not a google site.



PHP Opcodes

First, what is an Opcode? It's a compiled form of a PHP script, similar to Java bytecode. Or, more precisely, from php.net

"When parsing PHP files, Zend Engine 2 generates a series of operation codes, commonly known as "opcodes", representing the function of the code."

<?php $a = "Hello "; $b = "World\n"; echo $a . $b;
For a script like this, the opcodes look like that:

number of ops: 5 compiled vars: !0 = $a, !1 = $b line # * op fetch ext return operands --------------------------------------------------------------------------------- 2 0 > ASSIGN !0, 'Hello+' 3 1 ASSIGN !1, 'World%0A' 4 2 CONCAT ~2 !0, !1 3 ECHO ~2 5 4 …

GitX and Finder in MacOs

GitX is a cool tool to visualize your git branches. It automatically assumes all files ending in .git files are git applications. When you browse files in Finder, anything ending in .git is now not a folder anymore, and clicking on it will launch GitX. Very annoying. I assumed I could just right click the file and set Open with to finder, but you can only change it to other applications, you can't tell your Mac that foo.git is a folder, not a git application. Instead, I edited the file /Applications/GitX.app/Contents/Info.plist (sudo!). Remove the following line inside CFBundleTypeExtensions

<string>git</string>



...
<key>CFBundleTypeExtensions</key>
      <array>
<string>git</string>
          <string></string>
      </array>

...

And then run
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -u -r -f /Applications/GitX.app/

It should say
Throttle…

Thunderbird notification pop-up

Every time I get an email, Thunderbird shows a little pop-up on my screen, saying x new emails from xxx. Oftentimes, I have co-workers look at my screen, they don't need to know everytime I get an email that it's from Amazon, Zappos, Banana Republic, or Victoria's Secret. So, here's how you turn it off:
Click Edit and select PreferencesClick AdvancedSelect the General tabClick the Config Editor buttonSearch for biffSet mail.biff.show_alert to false

Book recommendation: A PhD Is Not Enough: A Guide To Survival In Science

I've recently read this small book, I devoured the 128 pages within two hours. Thought written in 1993, I think it is still highly accurate.

Feibelman, a physicist,  describes several cases of unsuccessful scientific careers, despite hard work and intelligence. He points out the problems and gives advise how to avoid them.

Every scientist should read his book early in grad school, refresh his memory when finishing grad school, and again when mentoring graduate students.

A PhD is Not Enough on Amazon



Academic Job Search: Writing a good CV, research statement, and teaching statement

I won't give you boring details of how you should format your CV, there's enough resources out there that give you much better advise than I ever could, instead I will tell you what you can and should do during graduate school, to generate the content for your CV and statements.
Please keep in mind that I was specifically looking for post doctoral research positions in mathematical biology. If you want to land a teaching or tenure position, some rules might be different.
Job Application TimelineAcademic Jobs beginning fall 2011 (June – September)Deadlines for postdocs: as early as November 2010Asked for letters: September 2010CV, Research Statement, Preprint/publications/thesisDraft of Research Statement August/September 2010CV: first version in 2008, career services, periodically updatedJobs are advertised on https://www.mathjobs.org/http://notable.math.ucdavis.edu/wiki/Mathematics_Jobs_WikiDiscussed everything with my advisor, proof-read by advisor, several friends proof-rea…

Latex: Table of Content problems with Bibliography and Index

When creating a table of content (TOC) , bibliography and index are not listed when created with \bibliography and \printindex. This is how you get them to appear in the TOC with the correct page numbers.

\cleardoublepage
\addcontentsline{toc}{chapter}{Bibliography}
\bibliographystyle{plain}
\bibliography{../all}

\cleardoublepage
\phantomsection
\addcontentsline{toc}{chapter}{Index}
\printindex

Latex: Centering table larger than textwidth

Usually, you can center tables with \center. But when the table is longer than the \textwidth, it will be align with the left side margin. You can temporarily adjust the textwidth.

% allows for temporary adjustment of side margins
\usepackage{chngpage}

\begin{table}
    \begin{adjustwidth}{-.5in}{-.5in} 
        \begin{center}
        \begin{tabular}{|c|}
            \hline
And here comes a very long line. And here comes a very long line. And here comes a very long line.  \\
            \hline
        \end{tabular}

        \caption{This Table is longer than the text width. And its caption is really long, too. This Table is longer than the text width. And its caption is really long, too. This Table is longer than the text width. And its caption is really long, too. This Table is longer than the text width. }
        \label{myTable}
        \end{center}
    \end{adjustwidth}
\end{table}