Updates from December, 2012 Toggle Comment Threads | Keyboard Shortcuts

  • raj 7:27 pm on December 10, 2012 Permalink | Reply
    Tags: , virtualenv   

    A tiny virtualenv wrapper 

    Tymm shared his bash function for assisting with virtualenvs. I’ve been using it instead of virtualenvwrapper. Typing `pye` will list your virtualenvs, and typing `pye envname` will activate one of them:

    # Enable a python virtualenv
    function pye() { 
       if [[ -z "${1}" ]]; then
           echo -e "\x1b[01;34mAvailable virtualenvs:\x1b[00m"
           (cd ~/pyenvs && for i in *; do echo -e "\x1b[01;36m ${i} \x1b[00m"; done)
           . ~/pyenvs/"${1}"/bin/activate; 
  • raj 11:29 pm on October 1, 2012 Permalink | Reply
    Tags: distributed proofreaders, fonts, Gutenberg   

    The Project Gutenberg Distributed Proofreaders has developed a… 

    The Project Gutenberg Distributed Proofreaders has developed a font that helps you find OCR mistakes. What a great idea!


  • raj 8:40 pm on February 2, 2012 Permalink | Reply
    Tags: , , numpy   

    Installing ipython notebook to replace matlab 

    Here is a recipe for installing the amazing ipython notebook. This is for Ubuntu 10.04 Lucid:

    virtualenv ~/pyenvs/notebook
    source ~/pyenvs/notebook/bin/activate
    #install zeromq using these hints: http://johanharjono.com/archives/633
    sudo apt-get install python-software-properties
    sudo add-apt-repository ppa:chris-lea/zeromq
    sudo add-apt-repository ppa:chris-lea/libpgm
    sudo apt-get update
    sudo apt-get install libzmq1
    sudo apt-get install libzmq-dev
    sudo apt-get install libpgm-5.1-0
    pip install pyzmq
    pip install tornado
    pip install --upgrade ipython
    pip install numpy
    pip install matplotlib

    Now, we want to create a profile for running a notebook server on a public port. Use this command:

    ipython profile create nbserver

    This will create a directory named ~/.ipython/profile_nbserver with a bunch of files in it. Since we are running public mode, we need a hashed password. Generate one like so:

    In [1]: from IPython.lib import passwd
    In [2]: passwd()
    Enter password:
    Verify password:
    Out[2]: 'sha1:67c9e60bb8b6:9ffede0825894254b2e042ea597d771089e11aed'

    Now edit the file named ~/.ipython/profile_nbserver/ipython_notebook_config.py. This file will already be populated by a lot of configuration, most of which is commented out. You will want to uncomment/edit these lines:

    c = get_config()
    # When disabled, equations etc. will appear as their untransformed TeX source.                             
    c.NotebookApp.enable_mathjax = True
    # The string should be of the form type:salt:hashed-password.                                              
    c.NotebookApp.password = u'sha1:xxx:yyyyy' #from above
    # The IP address the notebook server will listen on.                                                       
    c.NotebookApp.ip = '*'
    # Pre-load matplotlib and numpy for interactive use, selecting a particular                                
    # matplotlib backend and loop integration.                                                                 
    c.IPKernelApp.pylab = 'inline'

    Also, you might want these:

    c.NotebookApp.certfile = u'/absolute/path/to/your/certificate/mycert.pem'
    c.NotebookApp.open_browser = False

    Now, start your server like so:

    ipython notebook --profile=nbserver

    Connect to your server with firefox, and you should be good to go!

    • raj 5:32 am on February 11, 2012 Permalink | Reply

      Even Visual Studio has inline matplotlib graphs now!

    • raj 8:26 pm on March 19, 2012 Permalink | Reply

      • raj 6:51 am on March 21, 2012 Permalink | Reply

        installing a modern numpy and matplotlib is crazy hard. used git repos for each.

        numpy instructions from here: http://blog.hyperjeff.net/?p=160

        the env vars helped me build numpy 1.6.1, but unit tests fail. ugh.

        I used matplotlib build steps from the included make.osx file.

    • tymm 9:43 pm on March 21, 2012 Permalink | Reply

      To quickly generate an ssl key via openssl (based on instructions from http://www.madboa.com/geek/openssl/#cert-self )

      $ mkdir ~/.ipython/profile_nbserver/ssl
      $ cd ~/.ipython/profile_nbserver/ssl
      $ openssl req -x509 -nodes -days 365 -subj ‘/C=US/ST=California/L=San Francisco/CN=NA’ -newkey rsa:2048 -keyout ipynb.pem -out ipynb.pem

      (feel free to change the argument to -subj as best suits your organization)

      then use the aforementioned c.NotebookApp.certfile setting in ipython_notebook_config.py to tell ipython notebook to look for it there.

    • od1 4:15 pm on March 27, 2012 Permalink | Reply

      Great writeup — thanks for posting. I had to install the following w support libraries to get matplotlib to compile:

      apt-get install libfreetype6-dev libpng-dev

    • Mark 1:39 am on September 3, 2012 Permalink | Reply

      These instructions worked well. Thank you. I had to add an sudo in front of the “pip install xxxx” instructions to make it work.

      • raj 3:05 am on September 12, 2012 Permalink | Reply

        You can also use virtualenv if you don’t have sudo privileges, or if you want to isolate your ipython installation from the rest of the system packages.

    • drnealaggarwal 8:36 am on October 24, 2012 Permalink | Reply

      Thanks for this Raj. Works brilliantly on Linux Mint 12 only had to sudo the pip commands. Neal

    • cbellingan 7:32 am on November 29, 2012 Permalink | Reply

      Thanks for the info, there were a couple of extra deps for the Ubuntu 12.04 AMI running in EC2, full instructions:

      sudo apt-get install python-software-properties
      sudo add-apt-repository ppa:chris-lea/zeromq
      sudo add-apt-repository ppa:chris-lea/libpgm
      sudo apt-get update
      sudo apt-get install libzmq1
      sudo apt-get install libzmq-dev
      sudo apt-get install libpgm-5.1-0
      sudo apt-get install python-pip
      sudo apt-get install gcc
      sudo apt-get install python-dev
      sudo apt-get install g++
      sudo apt-get install libpng-dev libjpeg8-dev libfreetype6-dev

      sudo pip install pyzmq

      sudo pip install tornado
      sudo pip install –upgrade ipython
      sudo pip install numpy
      sudo pip install matplotlib

    • Gavin 4:45 am on January 10, 2013 Permalink | Reply

      I have automated the set of instructions for ipython notebook using Puppet scripts in a virtual machine. This reduces the installation to just 4 step. I have a github repository that has the code with installation instructions


  • raj 4:19 pm on December 20, 2011 Permalink | Reply
    Tags: book burning   

    “Thousands of rare documents burned in Egypt clash” 


  • raj 5:39 am on November 22, 2011 Permalink | Reply
    Tags: koha, liblime   

    Liblime trademarks the name Koha in NZ, angers Koha developers 

    For the library that invented Koha to now have to have a legal battle to prevent a US company trademarking the word in NZ seems bizarre, but it is at this point that we find ourselves.


  • raj 8:59 pm on November 12, 2011 Permalink | Reply
    Tags: fayetteville, hackerspace   

    Public Library to build hackerspace 

    The Fayetteville Free Library in New York is building a hackerspace with a 3D printer, CNC router, and lasercutter available to patrons:


  • raj 5:40 pm on November 3, 2011 Permalink | Reply
    Tags: , ,   

    Amazon luanches Kindle Owners’ Lending LIbrary 

    Free for Amazon Prime members. 5000 books which you can borrow with no due date, up to one per month.


  • raj 6:45 pm on September 12, 2011 Permalink | Reply
    Tags: , Kiana Davenport, Penguin, Riverhead   


    A publisher goes batshit when an author decides to self-publish her backlist:

    So, here is what the publisher demanded. That I immediately and totally delete CANNIBAL NIGHTS from Amazon, iNook, iPad, and all other e-platforms. Plus, that I delete all Google hits mentioning me and CANNIBAL NIGHTS. Currently, that’s about 600,000 hits. (How does one even do that?) Plus that I guarantee in writing I would not self-publish another ebook of any of my backlog of works until my novel with them was published in hardback and paperback. In other words they were demanding that I agree to be muzzled for the next two years, to sit silent and impotent as a writer, in a state of acquiescence and, consequently, utter self-loathing.


    My lawyer quickly pointed out that the first collection, HOUSE OF SKIN, PRIZE-WINNING STORIES, had been e-published in December, before I signed the contract with the publisher


  • raj 11:25 pm on August 11, 2011 Permalink | Reply
    Tags: comics, DC, marvel   

    When publishers burn each other’s books 


  • raj 6:23 pm on July 11, 2011 Permalink | Reply
    Tags: , , iriver   

    Google’s new e-reader: the iriver Story HD 

    From Ars:

    Google has announced its plans to launch a Google eBooks-optimized e-reader on July 17. Called the iriver Story HD, the e-book reader is designed to give users easy access to the 3 million free titles Google holds in addition to a few hundred thousand paid titles, with a price and design that is very similar to Amazon’s Kindle.


Compose new post
Next post/Next comment
Previous post/Previous comment
Show/Hide comments
Go to top
Go to login
Show/Hide help
shift + esc