2014-06-18 [Stage M1] Chloé Pasturel : week 1

  • définition du sujet - lecture Hansel
  • mise en place du python notebook
  • demos de brian

installation des outils

  1. virtual box
  2. VM ubuntu
  3. <<< guest additions + clone
  4. neurodebian
    wget -O- http://neuro.debian.net/lists/trusty.de-md.full | sudo tee /etc/apt/sources.list.d/neurodebian.sources.list
    sudo apt-key adv --recv-keys --keyserver pgp.mit.edu 2649A5A9
    sudo apt-get update
  1. install on ubuntu
sudo apt-get install aptitude
sudo aptitude install ipython-notebook
sudo aptitude install python-matplotlib
sudo aptitude install python-brian 
sudo aptitude install texlive-full

sudo aptitude install python-pynn 
pip install --user neurotools

2014-05-15 Vim commands for moving around

Basics commands in Vim

Sometimes, it's good to go back to the basics.

In command mode, typing :help usr_02.txt (or simplier something like :h usr_<TAB>02<TAB><ENTER>), you learn the letters for navigating a file:

  • these letters are HJKL - glad it works on an international keyboard.
  • letters on the borders (HL) are for horizontal movements- obviously H for left, L for right
  • letters on the inside are for vertical movements - J for down, K for up; a nice feature is that these keys are now quite widely used in the community, take for example in the gmail interface when switching to the next message.

I was still using the arrows keys, but taking this habit makes thinks easier, especially when switching often keyboards.

Simalarly, to scroll the text - you can use:

  • <CTRL-U> to scroll a half-page up
  • <CTRL-D> to scroll a half-page down

Here, the :h ctrl-u page will give you more info (or :help usr_03.txt).

Note that to follow a link (think "searching a tag"), you can press * (or # to go backwards).

2014-02-11 Converting MoinMoin pages to Nikola

I have another wiki to take notes. These are written using the MoinMoin syntax, which is nice, but I found no converter from MoinMoin to anything compatible with Nikola.

Following this post http://carreau.github.io/posts/06-NBconvert-Doc-Draft.html , I thought I might give it a try using ipython within nikola:

In [1]:
URL = 'http://invibe.net/cgi-bin/index.cgi/SciBlog/2005-10-29?action=print'

NOTE: this should not be tried with these URLS as they do not exist anymore...

Read more…

2014-02-10 SSH says 'Read from socket failed: Operation timed out'

While SSH is rock solid, we stumbled on a strange bug while trying to establish a connection:

$ ssh myname@myserver.fr -vvv

OpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011


Read from socket failed: Operation timed out

Nothing worked. The usual check of keys, encodings, permissions gave nothing.

The culprit could be the OS, the version of the OS or whatever magical spell. However, after investigating the issue it appears the issue was isolated for certain cases, in particular within some homemade LAN, but not for a laptop computer thatcame freshly unpacked with no homemade setting.

This rang a bell, and by checking network settign I remembered that I had set "jumbo frames", that is I increased the MTU of my network card (in the hardware tab from the network settings on MacOsX) from 1500 (standard) to 9000 (jumbo).

Going back to the default velues restored the capacity to connect. Many thanks to Jimmy for finding that one!

2014-01-15 Vim folding commands

Using folds in Vim

Folds are useful when having long files to have a good perspective on its structure. Especially useful in LaTeX mode.

To install, I recommend using the python-mode described in http://unlogic.co.uk/2013/02/08/vim-as-a-python-ide/

The magical shortcut all begin with z. Type :hep fold to learn more about them.

These are the most common shortcuts in my personal order of preference.

  • zo opens a fold at the cursor.
  • zc closes a fold at the cursor.
  • zM closes all open folds.
  • zO opens all folds at the cursor.
  • [z move to start of open fold.
  • ]z move to end of open fold.
  • zj moves the cursor to the next fold.
  • zk moves the cursor to the previous fold.
  • zf#j creates a fold from the cursor down # lines.
  • zf/string creates a fold from the cursor to string .
  • zm increases the foldlevel by one.
  • zr decreases the foldlevel by one.
  • zR decreases the foldlevel to zero -- all folds will be open.
  • zd deletes the fold at the cursor.
  • zE deletes all folds.

2014-01-14 Trying out ipython blogging

How to easily publish an ipython notebook?

installing the appropriate plugins

Here, we will need to install additions to the nikola publishing tool: a rendering machine + a theme. Using homebrew in mcosx, this looks like:

brew install npm
npm install -g less


nikola install_theme zen-ipython

Once this was done, one could tune conf.py and then issue:

nikola new_post -f ipynb

Finally, one needs to build (nikola build) and publish (nikola deploy)


In [1]:
[<matplotlib.lines.Line2D at 0x10ab2d1d0>]

2014-01-04 Bootstrapping Nikola

Nikola Tesla Corner by nicwest, on Flickr

I have managed to install Nikola, and build a site using it using this code:

install-nikola.sh (Source)

git clone git://github.com/getnikola/nikola.git
cd nikola
pip install -r requirements-full.txt
pip install .
nikola init --demo invibe
nikola build
nikola serve

Pretty simple, congratulations to the developpers!

More info: