I have been using fastcgi+flup (link) to run my web2py apps on shared Dreamhost hosting. But the speed was really mediocre. Dreamhost recommends Passenger WSGI for python application.
After hours of research and testing, I would like to share my experience using pyenv + passenger wsgi + web2py on Dreamhost shared hosting as of 08.2017
What I did differently than most guides online is that I only have to edit .htaccess file (in domain root folder) with: (Credit: ASO)
Most importantly and strangely, I didn’t need to modify passenger_wsgi.py (handlers/wsgihandler.py) at all. Most guides online (this; this; and many others) require adding two lines after import os, such as this one:
INTERP = "/home/%USER%/.pyenv/shims/python"
#INTERP is present twice so that the new Python interpreter knows the actual executable path
if sys.executable != INTERP: os.execl(INTERP, INTERP, *sys.argv)
But I couldn’t make it work if I modify passenger_wsgi.py. It seems .htaccess is sufficient to specify pyenv environment.
Some guides also suggest make a pyenv “virtualenv” within app folder, I found it is not required.
Put web2py files into your domain root folder, which is parent folder of public
cp handlers/wsgihandler.py passenger_wsgi.py
Create/modify .htaccess in domain root folder as described above.
Created tmp/ folder under my web root folder, did a touch restart.txt to get passenger to reload
Your web2py site should now load in your browser. If you use free “Let’s Encrypt” SSL from Dreamhost panel, you should be able to verify your pyenv python environment from admin interface by accessing https. I did verify mine.
I am not sure ssh tunnel method could serve as verification, because you are serving admin from a separate web2py instance running from your shell.
Hope this will help fellow web2py users. Thank all the web2py team for providing web2py.
Koss KSC75 is a legendary on-ear clip headphone. It provides stunning high-fidelity sound with unbeatable price. All the 5 star reviews say it all.
I have two of these. One had a wire problem near the plug. I need to replace the cable. I always want to add inline remote and mic to the KSC75 so I can use the headphone more conveniently with my smartphone.
For the other one, which is still perfectly working, I want to convert to a bluetooth headphone. Here is what I have after some simple sodlering.
You carefully remove the ear clip and plastic cover to reveal the solder points.
30min is your show time. You decide how to present it. A few examples:
• Read an excerpt (highly encouraged)
• Tell a summary
• Background info about author
• Your reflection
• Online reviews
• Powerpoint slides
• Ask audience questions
Go with your interest: no subject is too specialized or too quirky if you make an honest connection with it when you write about it.
PART III Forms
11 Nonfiction as Literature
Ultimately every writer must follow the path that feels most comfortable. For most people learning to write, that path is nonfiction.
Fiction or nonfiction, 这是一个值得考虑的问题.
12 Writing About People: The Interview
Nothing so animates writing as someone telling what he thinks or what he does—in his own words.
13 Writing About Places: The Travel Article
“I don’t think children are too young to appreciate what that ship (battleship Arizona at Pearl Harbor) represents,” Magee told me. “They’ll remember it if they see the leaking oil—if they see that the ship is still bleeding.”
14 Writing About Yourself: The Memoir
Memoir isn’t the summary of a life; it’s a window into a life, very much like a photograph in its selective composition.
15 Science and Technology
The principle of sequential writing applies to every field where the reader must be escorted over difficult new terrain.
16 Business Writing: Writing in Your Job
If you work for an institution, whatever your job, whatever your level, be yourself when you write.
(The best sportswriters) they avoid the exhausted synonyms and strive for freshness elsewhere in their sentences.
18 Writing About the Arts: Critics and Columnists
“Well,” the man from Texas would break in, “let’s not go peeing down both legs.” (about expressing your opinion firmly.)
(Humor) it’s an attempt to say important things in a special way that regular writers aren’t getting said in a regular way—or if they are, it’s so regular that nobody is reading it.
PART IV Attitudes
20 The Sound of Your Voice
A woman with taste in clothes delights us with her ability to turn herself out in a combination that’s not only stylish and surprising, but exactly right. She knows what works and what doesn’t.
21 Enjoyment, Fear and Confidence
Writers who write interestingly tend to be men and women who keep themselves interested.
22 The Tyranny of the Final Product
Moral: any time you can tell a story in the form of a quest or a pilgrimage you’ll be ahead of the game. Readers bearing their own associations will do some of your work for you.
23 A Writer’s Decisions
As a nonfiction writer you must get on the plane. If a subject interests you, go after it, even if it’s in the next county or the next state or the next country. It’s not going to come looking for you.
24 Writing Family History and Memoir
Your biggest stories will often have less to do with their subject than with their significance—not what you did in a certain situation, but how that situation affected you and shaped the person you became.
25 Write as Well as You Can
A reporter once asked him how he managed to play so well so consistently, and he (Joe DiMaggio) said: “I always thought that there was at least one person in the stands who had never seen me play, and I didn’t want to let him down.”
1. Inkscape document background color does not export to PDF, but only to PNG. Use rectangle with desired color as background.
2. Inkscape does not support CMYK color mode for printing. Convert text to path, then import/open with Scribus to export PDF in CMYK mode. Text in SVG does not import into Scribus well. But convert text to path seems not to preserve bold style …
My journey in website building started with Case Western Reserve University. When I initiated a pbwiki site to share information about Cleveland and Case Western. It didn’t get much attention. However, Zhong Wang, the former president was very encouraging. Then I get more interested in making websites. Besides ChinaBlog.cc, I also started these website:
Hanfu.info: A news translation website about hanfu costumes in China. I followed Chinese news about hanfu and translate them into English. Hope I can bridge the language gap between east and western culture. The website eventually failed and I lost my enthusiasm. A few lessons learned: 1) I overestimated the needs for such information outside the Chinese culture. 2) I am not a hanfu expert or cult; I am not a big translation fan either 3) News translation is really of little value; and even those news themselves had little value.
eastseal.com/lishengshi.com: I originally planned to build a website devoted to Chinese seal carving. Met similar problems as hanfu. The need is low, not to mention in English; I am not really an expert, I cannot contribute that much. I ended up making an inactive website for my master LiShengShi.
pkubio.org: I felt we needed a website for our reunion. So I created this website. It’s doing what it supposed to do. I don’t think it will grow much as I originally speculated. We are still a loose organization.
3. BioEquity / PSIC
I have long been interested in finance and investing since the craze in 2007
4. Bike Club
I bought my Trek 7000 happily in August 2006, when summer is partly over. I rode back from the B&K bike store in Mayfield. Then I decided to start a bike club, which I always dreamed to join in college. Over the years, we had a few close members: Feng Xue, Qingjiang Li, Chao Fang. And a few pop-ups: Wang Yang, Wenqian Hu, Mingming Zhang. Lesson learned: those who are interested will always try to make it; those who are not interested will not come anyway.