Archives for: July 2008
EuroPython 2008 in Vilnius
By Chee Ming on Jul 18, 2008 | In Random Thoughts, Pictures, Exoweb, Python, Django, Travel | Send feedback »
Almost 2 weeks ago I was in Vilnius to attend EuroPython 2008. It was my first time in Vilnius and first time to attend a conference about Python, which is the main programming language that I've been using for the past 2 years of work at Exoweb.
It was interesting to meet so many people that are also using Python everyday in their work and projects. In the conference, I met up with Greg and Tomasz, who's Greg's partner in crime in the software business. They are part of Enpoka that is doing outsource software development. I also met up with Tobias, who drove all the way from Tromsø to Vilnius so that he can fix his car in Riga, its more than 2000+ kilometres, pretty crazy!
I attended some talks on Jython and PyPy. I have to say I am pretty impressed with how far Jython has come (and only recently realised the state of development of the JVM in the dynamic languages world) and the grandiose plans for PyPy.
The day ended with Guido's keynote but it was done through video conferencing and I guess it wasn't to the best effect. It was regarding Python 3000 which I've heard at least twice so far.
The next day started with a talk on a tool to visualise relationships between Python objects and duplicate code finder a.k.a CloneDigger. I listened to a talk on LEAN software development by Steve Alexander of Canonical but it was a bit too vague to me, although I thought his approach of using photographed stickies as slides was cool. There were some good talks of Python's more advanced topics (descriptors) and the internals of some of the standard data structures we use everyday like lists, dicts and sets.
I attended the Cython talk but I was getting distracted hacking away with Greg on using greenlets with twisted. Both of us were not so happy with the deferred style of coding asynchronous servers in twisted and wanted to find a more manageable approach. We have a pretty simple prototype and I would want to apply the same idea to a larger code base
.
The day ended with a keynote by Hans Rosling, who I admire quite a bit due to his great TED talk he gave. He is more impressive live and I truly enjoyed his talk although it wasn't much about Python. There were some lightning talks before the keynote and the one that I can remember very clearly is gSym, which is a python editor that visualises your code in different ways such as mathematical formulas and lisp style.
For the last day, one of the highlights was a talk about hacking your dna with the amazon cloud. I talked a bit with Mike the DNA hacker and learned quite a bit about his travels in South East Asia which were pretty cool. After the hacking on greenlets and twisted, Greg decided to hold an unconference session on it to discuss about it. Tommi, who knows quite a bit about twisted gave some good insights on the greenlet+twisted approach which is that although it works its dangerous.
There is a lot of material that I would like to catch up on but I haven't found the time to really dig into it. I really enjoyed the conference and thought it was a good chance to learn a few things and meet similar minded people.
I managed to meet briefly with some Django contributors and Jim Baker who's working hard pushing out Jython 2.5. He says he'll be in China in September, maybe he'll come over and give a talk on Python and Jython. I am kinda interested in Jython myself and have been submitting some bug reports, hopefully its useful for them
. I was not really ready for the Django sprint and spent a bit of time looking into Django new forms admin. At least I learnt a bit about the new branch that will go into 1.0 soon.
I have bookmarked some of the more interesting stuff I learned from the conference in del.icio.us and also took some pictures while sightseeing.
I have more to say, ok maybe not. Over! ![]()
Configuring NAT and X11 for VMWare Fusion running Debian Etch
By Chee Ming on Jul 6, 2008 | In Technical, Exoweb, Mac OSX | 1 feedback »
It would be so much easier to use "bridged" networking but sometimes it doesn't work properly with some wireless setups and we have to use NAT instead. But one problem I had was to configure the setup so that the host machine can access the guest machine easily.
I don't do this very often and I remember that I have to spend quite a bit of time searching the web to find the answers I am looking for. So I am going to write a bit about this so that it might help someone (or even myself) in the future.
At Exoweb, we do a lot of our development on the Debian distro so I have a VMWare Fusion virtual machine running Debian Etch. I want ssh access to the machine but how am I going to connect to it? You need to configure the natd that is running on your host machine, (in my case its the Macbook Pro) so that you can connect (ssh) to the guest machine that is connected to a virtual network created by VMWare Fusion.
Run the following command in Terminal, and you should get some similar output:
silviana:~ cheeming$ ps aux | grep vmnet-natd
cheeming 43558 0.2 0.0 75492 392 s001 R+ 12:54PM 0:00.00 grep vmnet-natd
root 38501 0.0 0.0 75924 312 ?? Ss Fri05PM 0:04.05 /Library/Application Support/VMware Fusion/vmnet-natd -c /Library/Application Support/VMware Fusion/vmnet8/nat.conf -m /Library/Application Support/VMware Fusion/vmnet8/nat.mac -d /var/run/vmnet-natd-vmnet8.pid vmnet8
You need to edit the configuration file that is used by vmnet-natd and in my machine its /Library/Application Support/VMware Fusion/vmnet8/nat.conf. Open the file in your favourite editor and check the [incomingtcp] section. There should be some comments about SSH, you can add a line that looks like the following:
... [incomingtcp] ... # lots of comments ... 8889 = 192.168.102.128:22 ...
What is config means is that for port 8889 on host machine point it to IP address 192.168.102.128 (insert your guest machine IP address here) at port 22. Save the file and then restart the VMWare networking stuff with the following command:
silviana:~ cheeming$ sudo "/Library/Application Support/VMWare Fusion/boot.sh" --restart
Once that is done, try the following:
silviana:~ cheeming$ ssh -p 8889 -X localhost
And you should be able to access to your guest machine from your host machine's terminal.
You'd notice that I included a "-X" option because I wanted to run some GUI apps as well. I also had some issues with it and initially thought it was due to the firewall but it wasn't.
After I posted this article, Martin, a fellow Exomate, wrote an e-mail to me explaining a proper way to do this and after that I did a few more experiments and realised that I didn't need to configure anything at all. I don't know what I did earlier to fix it but I am pretty sure I had problems the first time around. Instead of using ssh's -X command line. Its better to use -Y as such ssh -p 8889 -Y localhost. Here are some tips that Martin gave me: Before connecting to the remote host, try and run xlogo. It should work.
If it doesn't check the DISPLAY environment variable. On my machine it looks something like this: /tmp/launch-7t2bMS/:0. So then ssh into the remote machine as indicated before and then try and run xlogo again. And again it should work. If it doesn't then something is up, try checking the DISPLAY environment variable. It will look something like this: localhost:10.0.
Also, the method that I outlined below is not encrypted and should be avoided unless you know what you're doing. Many thanks Martin for clearing this up. But I am still not sure what happened to my setup earlier. Why didn't it work before?
The following section till the end has been deprecated:
I've been playing around with git and wanted to run gitk in VMWare Fusion but I got the following error:
cheeming@ccmdebianetch:~/trunk-git$ gitk
Application initialization failed: no display name and no $DISPLAY environment variable
Error in startup script: invalid command name "image"
while executing
"image create bitmap tri-rt -background black -foreground blue -data {
#define tri-rt_width 13
#define tri-rt_height 13
static unsigned cha..."
(file "/usr/bin/gitk" line 1185)
I am not too familiar with X11 configs but I remember from attending an ExoForum that Russell had to run some commands to make things work properly and that memory actually helped me configured things quite easily with out needing to RTFM.
First, I had to set the DISPLAY environment variable to my host machines' IP (this it the IP address as seen by the guest machine in the virtual network created by VMWare, check ifconfig and look for vmnet8 device) like this:
cheeming@ccmdebianetch:~/trunk-git$ export DISPLAY=192.168.102.1:0
cheeming@ccmdebianetch:~/trunk-git$ gitk
Xlib: connection to "192.168.102.1:0.0" refused by server
Xlib: No protocol specified
Application initialization failed: couldn't connect to display "192.168.102.1:0"
Error in startup script: invalid command name "image"
while executing
"image create bitmap tri-rt -background black -foreground blue -data {
#define tri-rt_width 13
#define tri-rt_height 13
static unsigned cha..."
(file "/usr/bin/gitk" line 1185)
Hmm, something is still up. And I did the following (on the host machine), again based on what I remembered from ExoForum, but this time had to use the man a bit.
silviana:~ cheeming$ xhost 192.168.102.128 192.168.102.128 being added to access control list
I tried running gitk again and it worked. Hope this has been helpful.
