Friday, March 28, 2014

Python notebook

I recently discovered the ipython notebook ability which is pretty sweet. Here are the things I need to remember how to do:

Set PythonPath to include own packages
In order to automate importing user created modules, you can create a file in ~/.local/lib/python3.4/site-packages (or whatever version you are using) that contains a list of paths to add to the PYTHONPATH
The more automated way to do this I got from this site.

Magics

Plot graphs inline instead of in a  separate window

%matplotlib inline

Load module code
%load http://matplotlib.sourceforge.net/mpl_examples/pylab_examples/integral_demo.py
or 
%load <path>/mycode.py 

Friday, March 14, 2014

Proxmox: Use external VNC without inetd

Alex Harris on his blog gives a method for using external VNC viewer by modifying the VM configuration file as opposed to the INETD configuration which is what I typically see. Note: I have not yet tested this to ensure it works.

... go to the /etc/pve/nodes/proxmox/qemu-server directory. In the 1##.conf file (where 1## is the id of the VM), put the following lines:
args: -vnc 0.0.0.0:10
You can do this with each vm, just make sure the change the number after the last colon, as
each vnc connection has to be on it's own port. Then you can vnc using your favorite vnc viewer, and use the ip address/hostname of the proxmox server followed by a : and the number that's at the end of the line you put in the VM's config file. In this case it would be "vncviewer proxmox-machine:10"