There are two articles telling about using CherryPy in GAE applications
http://boodebr.org/main/python/cherrypy-under-google-appserver
http://blog.dispatched.ch/2010/08/13/serving-images-dynamically-with-cherrypy-on-google-appengine/
I found them useful, but in none of them it's described how to install CherryPy for this use.
The problem with CherryPy in GAE it's that the Google framework does not host CherryPy, and it has to be shipped together with the application.
I just found the way:
1) Download CherryPy from the site www.cherrypy.org
2) Run python2.5 setup.py install --root
3) Go to cp -r Users/
Now you can delete the folders System Users lib
created by the installation command, and you can use cherrypy in your application!
Wednesday, September 15, 2010
Using CherryPy in Google App Engine applications
Pubblicato da
Pelerin-Voyageur
a
5:34 AM
0
commenti
Etichette: cherrypy, GAE, Google-App-Engine, python
Saturday, August 7, 2010
no more sound after a mac os x restart? Fixed
Ufff.... that what happened to me just some minutes ago: after a restart of my MacBook white, due to an overload (the system started to respond very slow, I had too many apps opened and it was many days I didn't shut it down)..... I had no more soud!!!
Remembering the old days, when I was used to spend hours in fixing Windows problems with drivers, corrupted updates and so on..... I was already prepared to do it...
But actually it was very easy fix!! And it was not due to Mac Os X itself, but to Soundflower application which I have installed on my system!!
Eh eh!! Mac...the more I discover you, the more and more I love you!! :-P
Problem:
No more audio after a restart of Mac Os X 10.6 Snow Leopard (mine is 10.6.4 version)
Solution:
If you have Soundflower installed, that may be the cause.
Soundflower is a software to redirect the output sound from the system or from an application to another application, where it's used as input source. It's a very nice piece of software indeed!
Usually I keep it off, but for some unknown (to me) reasons, after that restart the sound output
was not set anymore to the "Internal Speakers" (as the normal default), but to "Soundflower 2Ch". Changing back to "Internal Speakers" fixed the problem!! :-)
To check and fix it:
Go to "System Preferences" (from the Dock, or from the Apple Icon menu on the top bar), then go to "Sound", then go to the "output" tab; there you can see the option "Select a device for sound output" where, if you have Soundflower installed,you can select between:
Internal Speakers
Soundflower (2ch)
Soundflower (16ch)
In my case, after the restart, the output was strangely set to "Soundflower (2ch)", and setting back to"insternal Speakers" fixed the problem.
Have a nice summer day! :-)
Pubblicato da
Pelerin-Voyageur
a
12:48 AM
0
commenti
Etichette: mac Os X, sound, system administration
Tuesday, May 4, 2010
Using Kerberos on Mac Os X 10.6 Snow Leopard
Problem:
I tried to use Kerberos authentication system out-of-the-box with my new Mac, and when I try to get a ticket I got this error:
$> kinit user@HOST.COM
$> kinit: Unable to acquire credentials for 'user@HOST.COM': Cannot resolve network address for KDC in realm HOST.COM
Solution:
So I googled a bit and I tried some recipes, but I just discovered that the order with configuration files are read by Kerberos changes sometimes. So instead of the conf file inside~/Library/Preferences/edu.mit.Kerberos
I had to copy the same file to/etc/krb5.conf
So create those two files with a content like this:
[realms]
HOST.COM = {
default_domain = host.com
kpasswd_server = afskrb5m.host.com
admin_server = afskrb5m.host.com
kdc = afsdb1.host.com
kdc = afsdb2.host.com
kdc = afsdb3.host.com
}
[domain_realm]
.host.com = HOST.COM
And you are done!
Then you can try using kinit to get a ticket like:
$> kinit user@HOST.COM Please enter the password for user@HOST.COM:
$> klist
Kerberos 5 ticket cache: 'API:Initial default ccache'
Default principal: user@HOST.COM
Valid Starting Expires Service Principal
05/04/10 15:28:11 05/05/10 01:28:11 krbtgt/HOST.COM@HOST.COM
$>
Note!
If you are looking information on how to access the CERN AFS from Mac Os X, you can find the settings for CERN here:
http://linux.web.cern.ch/linux/docs/kerberos-access.shtml
You can also look at this nice twiki about AFS at CERN with Mac Os X. But remember to edit the right config file in the right folder, otherwise Kerberos will complain.
https://e5wiki.physik.tu-dortmund.de/bin/view/Main/MacOSXCernKerberos
Pubblicato da
Pelerin-Voyageur
a
6:30 AM
1 commenti
Etichette: AFS, CERN, Kerberos, linux, mac Os X, system administration
Monday, May 3, 2010
How to change or clear your Subversion password used by eclipse plugins on Mac OS X
I assume that you are using Eclipse Galileo on Mac Os X Snow Leopard, with JavaHL SVN client.
It happened to me that once I updated the password of my account on the subversion server machine, Eclipse did not allow me to connect to the repository anymore; moreover it did not ask me for a new password, I merely got errors like "The folder does not exists on remote server" and authentication errors on the Eclipse SVN Console.
After googleing for a while, I did not find the solution yet, and so I started to play around. Finally I solved the problem and I post the solution here; I hope it can save you some time :-)
You have to open the "Keychain" application from "Applications" --> "Utilities" --> "Keychain"
There you will find an "application password" related to SVN: mine contains something like "https://svn.host.com/". You double click on it and you change your stored password with the new one.
Now if you close Eclipse and then you open it again, it will notice that the SVN password was changed and when you will try to access the repository again, Eclipse will ask you the username/password couple again. You can type the new password again, and you can "save" it if you want. The new password is set.
Hope that helped! :-)
Pubblicato da
Pelerin-Voyageur
a
12:35 PM
0
commenti
Etichette: eclipse, mac Os X, Subversion, svn, system administration
LaTeX: how to include a minted pygmentized piece of code in a figure environment, with three minipage in a row
Sometime we want to put two, three or more LaTeX objects side by side on one row. For example we want to put more figures one next to the other. Or we want to build complex figures gathering under one "figure" environment more objects like formatted text, images and highlighted source code using pygmentize and minted. Here below you will find a working example.
The same example is valid if we want to put fancy texts side by side like inside boxes, because the \fbox
command does not allow to use complex-formatted text inside.
Here what you get
and here below the code to generate it.
ATTENTION!!!! Pay attenion to not insert empty lines in the source code between minipages!! Otherwise you will get the minipage environment put in a vertical column: because the empty lines will be evaluated as "new line" breaks. I say it here because I waisted some hours looking for this "bug"!!! ;-D :-P
\begin{figure}[h]
\centering
\begin{tabular}{c}
\begin{minipage}[c]{.40\linewidth}
\centering
\epsfig{file=ImagePlaceholder, scale = 2.0}
\end{minipage}
\begin{minipage}[c]{.10\linewidth}
\centering
\epsfig{file=RightArrow_Grey, scale=0.6}
\end{minipage}
\begin{minipage}[c]{.45\linewidth}
\begin{minted}[bgcolor=bg, fontsize=\tiny ]{python}
'3j0lep':{
'selectionCuts': {
'electron':{'deltaR_ej': 0.25}
}
'cuts': { 1: { 'label': 'Cut1',
'value': [20*Units.GeV]},
2: { 'label': 'Cut2',
'value': [100*Units.GeV,
40*Units.GeV,
40*Units.GeV],
},
3: { 'label': 'Cut3',
'value': 80*Units.GeV, },
},
}
\end{minted}
\end{minipage} \\
\\ %empty line for some space
\footnotesize
From requirements...
\hfill
...to the code!\\
\end{tabular}
\caption{Main caption.}
\label{MainILabel}
\end{figure}
Pubblicato da
Pelerin-Voyageur
a
8:16 AM
0
commenti
Etichette: LaTeX