Sunday, December 19, 2010

How To Remove Depilatory Wax From Clothing

OpenWRT + Lighttpd + FastCGI + Django


Introduction

Here's something I was fighting with for about 3 days. At first I wanted to use virtualenv too, but it all resulted in a headache. I'm a novice in these matters, so forgive me.

Recently I bought a router TP-Link WR-1043ND. Not the best choice now, I'm aware: TP-Link MR3420 has higher quality to price ratio. Anyway, my router got upgraded to OpenWRT, version Backfire 10.3-RC4, thanks to great work of
Cezary Jackiewicz aka Obsy . Opkg packages First packages that we can install with OpenWRT package manager: lighttpd, lighttpd-mod-alias, lighttpd-mod-rewrite, lighttpd-mod-fcgi - packages needed for http server called lighty

python wasn't installed at first, so we'll need this too

opkg install lighttpd lighttpd-mod-alias lighttpd-mod-rewrite lighttpd-mod-fcgi

opkg python libsqlite3 pysqlite

Python packages

These will be installed from Python Package Index (PyPI).We will need:

setuptools - Go to pypi.python.org, search for setuptools, follow the instructions.

  • pip - We should be able to call:
  • easy_install pip
  • to obtain it.
  • django - With pip in place getting django is as easy as
  • pip install django
. Pip, contrary to easy_install, has a nice uninstall option.
  
flup - For FastCGI related stuff

There we go. It's all installed.

Configuration

    3 ways of doing this
  • First of all, let me briefly explain how FastCGI works. Actually this might not be a good idea to believe me, because, as I said, I'm a layman in this matters. There are 3 entities in this process: the browser, the server (Lighttpd), the FastCGI process (Django).
  • First step is forwarding the http request for a webpage to FastCGI process:
  • Browser => Lighttpd => Django FCGI Request is processed and Django returns html source code of a webpage. Shove it back to your browser and render it. Browser
  • I came to conclusion that there are 3 ways of setting this up. By bin-path
  • By host and port
  • By socket

My app's directory:

/www/apps/homepage

. It doesn't have to be anything fancy. It's ok to use brand new project created with

django-admin.py startproject homepage
.
  
Bin-path
  <= Lighttpd <= Django FCGI
This method is my favourite so far. We tell lighttpd where to find executable file .fcgi and it starts FCGI processes by itself. All we need to take care of now is that the server is started after reboot. Here are the details:
  1. Contents of .fcgi file. It sits at the django project's directory.
  2. #!/usr/bin/env python
  3. import sys, os
# Add a custom Python path.

sys.path.insert(0, "/www/apps") # Set the DJANGO_SETTINGS_MODULE environment variable. os.environ['DJANGO_SETTINGS_MODULE'] = "homepage.settings"

from django.core.servers.fastcgi import runfastcgi

# maxspare=2 is minimum from what i saw

runfastcgi(method="threaded", daemonize="false", maxspare=2)

    Lighttpd config file from /etc/lighttpd/lighttpd.conf. It is edited version of default config file. I just omitted most of commented out lines.
  • # lighttpd configuration file
    #
     ## modules to load 
    # all other module should only be loaded if really neccesary
    # - saves some time
    # - saves memory
    server.modules = (
    "mod_rewrite",
    # "mod_redirect",
    "mod_alias",
    # "mod_auth",
    # "mod_status",
    # "mod_setenv",
    "mod_fastcgi",
    # "mod_proxy",
  • # "mod_simple_vhost",
  • # "mod_cgi",
     # "mod_ssi", 
    # "mod_usertrack",
    # "mod_expire",
    # "mod_webdav"
    )

    # force use of the "write" backend (closes: #2401)
    server.network-backend = "write"

    ## a static document-root, for virtual-hosting take look at the
    ## server.virtual-* options
    server.document-root = "/www/public"

    ## where to send error-messages to
    server.errorlog = "/var/log/lighttpd/error.log"

    ## files to check for if .../ is requested
    index-file.names = ( "index.html", "default.html", "index.htm", "default.htm" )

    ## mimetype mapping
    mimetype.assign = (
    ".pdf" => "application/pdf",
    ".class" => "application/octet-stream",
    ".pac" => "application/x-ns-proxy-autoconfig",
    ".swf" => "application/x-shockwave-flash",
    ".wav" => "audio/x-wav",
    ".gif" => "image/gif",
    ".jpg" => "image/jpeg",
    ".jpeg" => "image/jpeg",
    ".png" => "image/png",
    ".css" => "text/css",
    ".html" => "text/html",
    ".htm" => "text/html",
    ".js" => "text/javascript",
    ".txt" => "text/plain",
    ".dtd" => "text/xml",
    ".xml" => "text/xml"
    )

    $HTTP["url"] =~ "\.pdf$" {
    server.range-requests = "disable"
    }

    ##
    # which extensions should not be handle via static-file transfer
    #
    # .php, .pl, .fcgi are most often handled by mod_fastcgi or mod_cgi
    static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )

    ## to help the rc.scripts
    server.pid-file = "/var/run/lighttpd.pid"

    #### fastcgi module
    ## read fastcgi.txt for more info
    # this line may help with finding what's wrong, check out errorlog file
    # fastcgi.debug=1
    fastcgi.server = (
    "/homepage.fcgi" => (
    "main" => (
    "host" => "127.0.0.1",
    "port" => 3033,
    "check-local" => "disable",
    "max-procs" => 1,
    "bin-path" => "/www/apps/homepage/homepage.fcgi"
    )
    )
    )

    alias.url = (
    "/media" => "/www/apps/homepage/media",
    )

    url.rewrite-once = (
    "^(/media.*)$" => "$1",
    "^/favicon\.ico$" => "/media/favicon.ico",
    "^(/.*)$" => "/homepage.fcgi$1",
    )




    Host:port

    You don't need .fcgi file in this method. Remove line with "bin-path" in fastcgi.server section of lighttpd config. Now you need to make sure that you run this at every boot (maybe you can use start-stop-daemon tool for this):
    /www/apps/homepage/manage.py runfcgi method=threaded host="127.0.0.1" port=3033
    This will start FastCGI threads. Lighttpd will expect them to be there when he needs a page. Otherwise you'll get 503 or 500. This method is said to be easier because there is no need to set permissions on TCP socket.

    Socket

    In this method FCGI process and HTTP Server communicate through a socket (aka named pipe). Proper permissions must be in place. FCGI file is also not needed here. You must make sure that you run similar command as in the second method:
    /www/apps/homepage/manage.py runfcgi method=threaded socket=/www/apps/homepage/homepage.socket
    Lines in fastcgi.server with port and host get removed. Instead add
    "socket" => "/www/apps/homepage/homepage.socket"

    Conclusion
I use a lot of bad practices here:

do everything as root

 not using virtualenv 

keeping my app in /www (but I changed my document-root, so maybe I'm ok?)

This is an example of work done by someone who came from "no idea" to "it started working" and all this happens on a router that won't be under a lot of load or work in a cloud of virtual machines. Certainly it's not state of the art, but gets the job done.

 There's quite a lot of this kind of tutorials, but to someone without proper knowledge all these terms and blindly followed instructions are no good if something doesn't work as expected. I hope someone will find the wording I used useful. I hope will when I'll need to do everything all over again. 
  

Monday, December 13, 2010

How Do You Eat Dry Salami

Przedświątecznie ...

I fall on my own blog terribly neglected, (had got me doubt whether it even makes sense, since I am not able to provide its readers with regular food for the eye and soul, but I still try to fight ... with that, not today, because I fall flight.

Last month the inability to escape from the treadmill home-work-Christmas panic. remnant forces of time and there some things arise, but this in turn all the gifts, so you can not even show for Christmas Eve. I hope that the date of its disclosure coincide with the time when the momentum life a bit slow, but will not promise nothing. For now, I can only promise you that for sure will be here before Christmas - and perhaps I can finally read your blogs?

thus leaving you with a sample of my pre-Christmas performance on the field other than hunting discount toy store, or to form 300% of professional standards;)

following pillow with beautiful flower fairy is a small addition to the Noble packages that we have this year. I do not know whether he liked, but I hope so;)


Take care and thank you nice and warm, looking into that here, even though the author herself does so rarely;)

Saturday, December 4, 2010

Prom Dress With Cardigna

How to sew a cover for a box of tissues on the winter frosts


I hate the gaudy packaging. Both these in a bowl as well as those in owocki that most would hold her flowers. Boxes of wipes I keep in the house in several places and for a long time I carried a sewing covers on them. Unfortunately, my skills, "szyciowe" proved to be much too small to understand what is going on in complex wyszperanych tutorials on the web.

Until one night it came revelation that, after the box is shaped so simple that it does not need to sew cover many parts of finely made at all. Just imagination to go back to the days of elementary school when a similar body made up of paper.

And so from concept to completion, in one evening was a box. I really like, and certainly one not stop because a few boxes I have left.



Preparation:

draw a shape on the material to be spread over a box without a bottom ( Figure 1), leaving a 1 cm margin on the banks of the shorter sides and longer on the edge of 2cm sides (Figure 2 ). Cut the angles at the junctions between the sides (Figure 3 ). In the middle of the hole and cut open draw ( Figure 4).

roll up cut parts so as to obtain a rectangular hole, stitching ( Figure 5). Curled edges of 1cm and it pierces.

Sew sides (Figure 6 ) on the left side. We turn to the right side. Decorate a box.

presses the edges of the longer side to 1 cm. Sew the two sides of a large eraser ( Figure 7).

presses edges. Done.



Blue - Green
right side - left side
Red - Orange
seam - the intersection
Yellow - eraser

Sunday, November 21, 2010

Things To Use Instead Of Rizzla




Recently, when I complimented his new work my friend, it said, I'm probably the only person in Poland, which owns and uses a hot water bottle. I do not know whether this is the reality, but actually have and use. Maybe not the warm bed, as I designed this friend, but for example when I read it is nice to hold frozen feet on a pleasant warm. Especially in autumn when the heat radiators are not, and in our attic is nice only in two sweaters.

do not know whether this is due to lack of popularity or other reasons, but to buy a nice hot water bottle almost borders on a miracle. Anyone who has tried knows that we can usually choose between polarkiem in color at least a gross of more or less successful copy of an animal. None of these options was not my dream, so I decided to dress differently my hot water bottle, and the effects you can see below.

I think the linen bag, lace and kropeczkowe interior look a hundred times better than the yellow, of dubious quality fleece which he took off. And finally, I will tell you again that if I knew how to knit or crochet it'd done such a case which recently showed at home Mouse.

greet all the hot, Imoen.



Preparation:

material consists of a double inside the right side, on the left side of the draw with a hot water bottle shape. The same steps with a thin fold (1mm) or other coarse material. In addition, we draw with third shape hot water bottle on the right side of the complex inside the material, which will be lining ( Figure 2). Then cut out four rectangles with dimensions of 20 / 4 cm.

hot water bottle shape cut out of all materials with 1 cm margin ( Figure 1).

Rectangles cut. Wrap a short edge to 1cm and pierces. Then folded to the center of the long sides ( Figure 3). Fold rectangle in half. I pierced along the long edge (Figure 4 .)

Fold and felt lining and the pierced along the edges leaving a 1 cm margin. Do the same with another piece of felt ( Figure 5).

At this stage all the ornaments to sew the right side of the outer material.

Fold outer material right sides to the inside and pierced along the edges leaving a 1 cm margin ( Figure 6). Fold the felt pages with sewn lining the inside and act the same way.

not incised in the sewn edges of the triangles to a depth of 1 cm (preferably a pair of scissors check here embroidery). Equally felt and proceed with the outer fabric (Figure 7 ). Threesome bent on material external to the left, on the felt on the side without lining ( Figure 8). Put

felt part of the material (Lining the inside part). Between the material and felt prepared previously placed ribbons. Sew the felt with the outer fabric on both sides (Figure 9 ). Ready



Blue - Green
right-left
Red - seams


Inspiration - Christina Strutt "Home-made vintage

Tuesday, November 16, 2010

How Long Does It Take For Bonjela To Work

To whom can be found on the web


In life, sometimes I meet different people. Nice, nasty, uczynnych, selfish ... But I guess I've never met with such a pure selflessness. With this kind of a warm and happy to share it. I recently wrote to me Barry with the question, which can not even remember. Do not even imagine how great was my surprise when, after a while, the same Barry wanted me to give a gift. Frankly, that something like that happened to me before. I had to choose something from gallery where you can see the works of Kate, but the selection was so great that he left the choice of the author. And that sent me a wonderful lavender casket and beautiful earrings, in my favorite grays. Thank you dear with all my heart. Gifts are wonderful and I like very much. I hope that you will like it also.




Have a nice day, Imoen.

Friday, November 12, 2010

If You Have A Miscarriage Are You More Fertile

A return to form


Today will be about how my machine went into motion again, and I regained my verve and enjoyment of what I like to do. Some time ago I was impressed by the wonderful bags on the bags, which I saw on the blog Mouse. What was my surprise when shortly afterwards offered me wymiankę mouse. Of course, very happy, but I had serious doubts whether what you sew like the new owner.

do not know if it is so you, but I usually try for the other ten times more than for themselves. I do not consider this a good thing and I hope to learn how to become more involved in things done for themselves. But this time it was my fault too bad accidents and resulted in the sack and the heart, of which I was really proud because finally I made something I liked. I liked it so much that after shipping so I missed at my work that I made the same set for myself.

And as usual, more or less success always motivates us to further test and restore the joy of creation. So thank you Ewelinko not only gorgeous bag that is my kitchen decoration, not only for the pretty Parisian romantic bag, which for me uszyłaś, but most of all thank you for the motivation, which I missed, and he regained through our exchange.



And part of those concerned, or how to sew a heart and gall.

HEART

material comprises right sides inwards. Draw a heart shape. We put a string to suspend the material, the ends should sznureczka project (Figure 1 ). Broaching along the drawn line, leaving a few centimeters a break ( Figure 2). We cut around the heart leaving a small margin, in a place where there is a hole margin should be larger. We turn to the right heart. Bent left margin of the hole. Fill the heart (Figure 3 ). Sew the hole. Done.


green - blue
left side - right side
red - seams


bag

Cut out a rectangle with size 17/25 and two rectangles with dimensions of 17 / 4 ( Figure 1). Shorter sides

smaller rectangles wrapped in 1 cm inward and pierce. Then folded to the center of long sides and presses ( Figure 2).

larger rectangle make in half. Shorter sides of the wrap to the inside to 5 cm and stitching (Figure 3 ).

Folding smaller rectangle and sew one long side of the large rectangle ( Figure 4). Then folded smaller rectangle and sew as close to the shore ( Figure 5). The same steps with the other side of the bag. At this stage, sew it all possible decorations.

Fold the bag right sides inside, and pierces the long edges (Figure 6 ). We turn to the right side. Cord through hole ( Figure 7). Done.


green - blue
left side - right side
red - seams
dotted line - the place where the ends curl


Yours, Imoen.

Tuesday, November 9, 2010

Buy Dr Hauschka In Germany

pochorobowo

... I'll be back after 2 weeks away (remember me yet:). Unfortunately, I managed to catch Potwornicką and ill Potwornicka worse than the plagues of Egypt ... ill Potwornicka, who eventually learned to speak further complicates the matter, because I can no longer pretend not to understand the messages broadcast in suahilii ... now messages are clear, explicit and does not leave doubt and it is obvious that the mother can not manage your own affairs, when coming from another room a dramatic cry of "Mom, pomuś, did bear pee. "

verbalization Potwornickiej also made it clear to her mother that she will behold some, if not several years, the purple wrap up in public places, such as recently in the clinic, where the pretty girl with the face of Cupid, the enchantment the whole queue considered that viewers should be something extra, and came out into the middle of the corridor and awaited until everyone pay attention to her, climbed a finger to your nose and giggling maliciously announced in a loud voice, "bullfinch ".... what we eat and did .. . next time we go to the clinic in bags on their heads, so that nobody recognized us;)

But to the point, now more than two-month arrears, which is almost the final version of the nasal secretions koneserki peace;)

overall projection was, but there are several close-ups:


and crafts details of which I am quite proud, though, as usual shortcomings is a measure of what is not:)

stool (visible and above) inspired by the work of Luge. Pouf was originally an addition to the big-bag chair in color angry pink. Furious Rose landed in the trash, and got a crochet pouf gown in colors that match the rest of the room:

Gazetnik for children enthusiast magazines, with my variation on the quilt bumblebee flight;):


I cover two new caps, using existing lampshade:


still waiting on more sewing patchwork quilts .... but I still wait, because now it is time to craft Christmas. Sling has already half the length and so far only 500 mesh width, P Next time I choose, however, the thicker the yarn;).

also took the mat at the end of the playful Potwornickiej ... original project was okrojeniu, because after sewing the first block, it became clear that at this rate the gift will be ready for Easter ...

In the next post at the end of the promised giveaway - light has changed because of the inability to perform two identical mittens ... but it's the same you'll see;)

I praise the unexpected happiness - because in Rozdawajce Ivalii lottery did not report the person to re-draw was held and this time I won:)) I can not wait to have these beauties - especially an angel, for which we optimistically booked a place on the wall, as yet not known to the lottery results ;)

And finally, to slightly blur the low opinion of Potowornickiej brag that my child is too unruly and other talents in addition to compromising the mother's skills in public places. A few days ago, Grandma's birthday, on his own free will and without any help mothers make so here's flatter me:



Maziaje in the center to illustrate the 'big plezent "and is a typical two year old graphic form of expression, and green flower, and in particular bear the arms and legs placed in the right places almost threw me knees, because I was sure that it is still too early for such work (quietly admit that I cried a little with emotion, as I saw this .... but quietly re, Gajowa hard because a woman is, incapable of emotion;)

Friday, November 5, 2010

Fido Message Center Number Windsor

Dedicated to Paula and the rest of Wroclaw trójeczki. Focaccia


As you you noticed I do not have a habit to post here pictures of my trip. The reasons are at least a few. Me not a very good photographer. On trips, I concentrate more on mood than uwiecznianiu uptake of him, and on vacation I take is usually old, an ordinary CD, which does not even have a viewfinder, and the sunshine of staff remains a surprise to return to the hotel.

This time, however namówiona by Paula , during a meeting in Wroclaw bloggers I make an exception. And although I think that many a one of you brings you more photos than I do walking holiday, it will invite you to a virtual tour of New York.

When I first visited this city certainly delighted me. I could not understand the infatuation of my husband and I had the attitude of "never again". But I'm glad I gave up trying to persuade the number two, because this time there was no disappointment. Carried on the omnipresent noise, dirt, the crowd and the "old age" I managed to see something beyond that which can fall in love with the place. It is this old age surprised me the most for the first time when I was convinced that the center of the world is the center of modernity. I have not taken the fact that everything there was to much earlier so what is new with us, there is much worn.

a pity that I can not show you everything that has been in my memory. Wonderful performances on Broadway, charming music jazz musicians from Central Park, climate Korean restaurant, where a bottle of wine we had fun grillując duck itself, and of course shopping. Because once I go to New York with a suitcase necessarily half empty, otherwise the excess baggage brick.



We pokazałabym you some pictures from the rest of the summer, but absorbed relish the moment, I've done literally photos zero.

Have a nice weekend, Imoen.