Skip to content

Instantly share code, notes, and snippets.

@tjdett
Last active August 29, 2015 14:02
Show Gist options
  • Save tjdett/f01affb46d3b92bfea09 to your computer and use it in GitHub Desktop.
Save tjdett/f01affb46d3b92bfea09 to your computer and use it in GitHub Desktop.
Notes for Python SC lessons on DIT4C.

Notes for Python SC lessons on DIT4c

First challenge: How do I "download these four data files"?

mkdir sc
# Use shell expansion to get each of the four files
wget http://resbaz.github.io/2014-03-18-combine/novice/python/inflammation-0{1,2,3,4}.csv

That's complicated. We might need a "download me" script.

Shell

It's not made clear if I should be following along or just reading for the shell lessons, but I'll work on the assumption I should be able to run any of the commands that are mentioned.

nano draft.txt
# bash: nano: command not found

Fixed with sudo yum install -y nano but we should have it installed from the outset.

  • Need to add nano to installed programs.

After skim-reading, that's it for the shell. Next...

Git

Following along happily enough, and I decide to maximize my editor. Bad move - when opening nano, things go weird. Have to ditch the terminal and refresh page - quite annoying, but doesn't require lesson to restart from earlier place.

Tried it again later when maximized. Attempted to close with Ctrl-W, and closed my entire window. Ouch.

Resized window and used nano. Similar screwup. Refresh needed. Grrrr...

Learnt something new: git status --ignored. Neat.

Pulling & pushing to GitHub is a little annoying, but only because I have 2-factor auth enabled.

Nano editing of Git messages works just fine.

Python

"Autosave failed!". Nginx reports:

2014/06/17 04:50:03 [crit] 15#0: *1957 open() "/var/lib/nginx/tmp/client_body/00
00000046" failed (13: Permission denied), client: 172.17.42.1, server: , request
: "PUT /ipynb/api/notebooks/sc/01-numpy.ipynb HTTP/1.1", host: "172.17.42.1:4917
3", referrer: "https://timtest1.dit4d.labs.cloud.unimelb.edu.au/ipynb/notebooks/
sc/01-numpy.ipynb"  

Uh oh. Caused by lack of execute permissions on parent directories, as mentioned here: http://forum.nginx.org/read.php?2,239816,239817

  • Need to fix permissions on /var/lib/nginx

"Request Entity Too Large". Nginx again, for both the outer and container Nginx servers.

  • "client_max_body_size ?G" needed for Nginx

SQL

Missing sqlitemagic, but that's a supplied file. Needs texttable though:

  • Install texttable & sqlite?

When attempting to install it as a PIP module, didn't have sudo privs

  • Allow sudo to execute python-pip
  • Provide a symlink to pip?

Created using Inkpen - http://inkpen.in

@DamienIrving
Copy link

Hey Tim,

Just a few comments:

  • Nano is used as an example editor in the shell lesson notes, however in an actual bootcamp the participants use whatever editor they want. In other words, people can use whatever text editor you provide in the cloud - Nano doesn't need to be available
  • When doing commits with git, I always get people to use the -m option so that people don't have to deal with an editor. Inevitably someone forgets to type -m and the default editor pops up, so I'd suggest we just change the default to something other than nano (i.e. to whatever text editor you're providing)

@tjdett
Copy link
Author

tjdett commented Jun 18, 2014

In this case, your default editor is Vim unless you change it to Nano. Until I find an appropriate browser-based editor, everybody will be limited to what they can run from a console.

Zed Editor's zedrem works for general editing, but isn't able to be used with $EDITOR or Git.
zedapp/zed#121

At some later point I might have WebDAV support, but there are challenges there due to the need for authentication.

@DamienIrving
Copy link

I think it's fine if zedrem can't be used with $EDITOR or git. We can easily just tell people to always use the -m option when entering their commit messages (in fact, that's what we do anyway). Having a browser based editor is super important for a bootcamp - there's just no way that novices would be comfortable with Vim or Emacs.

Other comments from my initial play include:

  • The IPython notebook is great - it could be used for a bootcamp tomorrow
  • The default text size on the bash shell is really small. I'm going to have this up on the screen while teaching, so I'll need the ability to zoom in and out (e.g. with "command +/-" on my mac) or change the text size easily.
  • It won't let me paste text into the command line
  • In the file management tab, I couldn't open any of the directories or view any of the files when I clicked on them

@tjdett
Copy link
Author

tjdett commented Jun 19, 2014

Having a browser based editor is super important for a bootcamp - there's just no way that novices would be comfortable with Vim or Emacs.

Does Zed Editor count? I've seen other browser-based editors, and so far I've not be terribly impressed by any of them. There are HTML5 editors that I could write a backend for, but time I spend on that is time I can't spend on other things.

Don't forget you also have Nano, which does have highlighting if you turn it on.

The default text size on the bash shell is really small. I'm going to have this up on the screen while teaching, so I'll need the ability to zoom in and out (e.g. with "command +/-" on my mac) or change the text size easily.

I will need to hack TTY.js to allow this, but it should be possible to add that feature to it.

It won't let me paste text into the command line.

Right-click, then select paste? That works for me. Similarly drag-select text & right-click for copy.

In the file management tab, I couldn't open any of the directories or view any of the files when I clicked on them.

Whoa, huge bug there. This was the least troublesome file manager for me to integrate, but occasionally it does some dumb things. (In this case, using an absolute URL where a relative one would have worked much better.) I'll see what I can do to fix it this morning.

@tjdett
Copy link
Author

tjdett commented Jun 20, 2014

The file management bug is fixed now.
dit4c/dit4c-dockerfiles@6f2c175

@DamienIrving
Copy link

Zed Editor would be perfect. We just need a simple text editor option that doesn't run within the terminal (i.e. not nano, Vim or Emacs).

When I right click paste isn't an option... it will be interesting to see if other people have the same issue on Tuesday.

@tjdett
Copy link
Author

tjdett commented Jun 20, 2014

  • Fix paste for Firefox in TTY.js

It's an open bug: chjj/tty.js#31

@tjdett
Copy link
Author

tjdett commented Jun 20, 2014

  • Pre-install zedrem

@tjdett
Copy link
Author

tjdett commented Jun 20, 2014

  • Fix UniMelb logins, which don't provide an ID! (but do provide an email)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment