Showing posts with label Misc. Show all posts
Showing posts with label Misc. Show all posts

Sunday, February 24, 2013

Python subprocess throws [Errno 2] No such file or directory

First steps in Python, and I've been spending a while trying to understand why my python script would fail when called from my webserver. The same script would work just fine when I run it manually.

simple example

file  run_maven_clean.py:

        #!/usr/bin/python
        import os, sys,


        subprocess.check_call(["mvn", "clean", "install"])

This will work if run manually
user:~$  run_maven_clean.py
mvn clean install

but fails terribly when called by a web server

  File "/home/use/run_maven_clean.py", line 105, in build
    subprocess.check_call(cmd)
  File "/usr/lib/python2.5/subprocess.py", line 457, in check_call
    retcode = call(*popenargs, **kwargs)
  File "/usr/lib/python2.5/subprocess.py", line 444, in call
    return Popen(*popenargs, **kwargs).wait()
  File "/usr/lib/python2.5/subprocess.py", line 594, in __init__
    errread, errwrite)
  File "/usr/lib/python2.5/subprocess.py", line 1149, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory


Reading around, I found tips, that there is no shell, make sure you have bash or csh... Of course, I have shell=False for security, still, I thought "mvn" is pretty well known executable on the system, it should find it, well NO.

NO SHELL also means, you have NO PATH, NO ENVIRONMENT VARIABLES.

and the correct way to do really is

              subprocess.check_call(["/opt/apache-maven-3.0.4/bin/mvn", "clean", "install"])



Monday, August 17, 2009

The Secret


The secret is some kind of documentary explaining the Law of Attraction.

I believe the Law of Attraction is true in part (if you don't wish for something, you're not gone get it, you will not even look for it!) but here it is presented in a pretty shallow way that involves a lot of mystery. The author just seems to say "close your eyes and order every thing you want from the catalog of the universe and you will get it; provided you wish for it thruthfully and constantly"

Below are some notes and remarks I took while watching the movie.

The secret is "the law of attraction" - hold on to the thought of what you want.
You attract what you want and think about the most.

"Thoughts attract things"
"Thing positively so positive things will happen to you"

I do believe that genuine positive attitude does attract generaly more positives responses from others and will help you in life.

Set yourself a goal, "You don't need to know the whole way how to get where you want to be. Think of when you drive a car at night, you can only see 200ft ahead, but then you will see the next 200ft, etc... till your destination.

"Focus on what you already have and feel grateful" that will boost your positive level. keep a token with you to remind you of it every day, all day.

Emulate in your thoughts what it would feel like to have what you want. Imagine the happiness.

"This is where magic and miracles happen"

Explains the placebo effects, your mind is the strongest factor into recovery.
=> at least something here that can't be refuted. Placebo effect is proven, but it is a case where the mind affects the body (not the universe).

"Focus on what you want, not what you don't want". Don't be anti-xxxx be pro-xxxx (the opposite: anti-war => pro-peace). Focus your energy on what you want, don't give free advertising to what you do not want. Being against something, gives that something exposure.

Ignore what you don't want, don't talk about it. => this will help you stay more positive.

"Whether you think you can or you can't; you are right". Ford

They're desperately looking to establish credibility. They boast long futile titles and degrees; that we are reminded of every 20 seconds; They keep quoting famous dead people out of context, since they're not famous themselves and dead people won't disagree.
They keep showing sugar-sweet testimonies of easy success and lavish lifestyles to create envy. That's what you'll get if you wish for it and a month is enough.

They quote mother Teresa as someone who understood the secret and applied it. Such a great person wishing so ardently for peace. However in the whole 20th century, there has only been 27 months of peace throughout the world.
What a poor result! On the other side, we see a simple-minded-looking guy who started wishing for a good parking spot everywhere he goes and he always gets it after only a month. He should have wished for a chauffeur!

If you want to know more www.thesecret.tv
They have an online shop and two free ebooks there http://thesecret.tv/secret-treasures-ebooks.html
- The Science Of Getting Rich
- The Master Key System

All in all, it's not badly done, it can create positive changes in people by giving them a motivation to change their behavior for the better and look forward their future with hope. However I'm afraid these changes would be based on loose reasoning.

Saturday, April 25, 2009

How much car insurance is enought?


This week I was trying to answer the question: "How much insurance do I really need?"

All over the web, the only answer is 'the minimum legal' or if you have valuable assets 'the more you can afford to protect them'.

I will try to answer this question here.

Bodily Injury and Property Damage is what we are concerned about.

Bodily Injury
Let's say you injured Bill in a traffic accident.
You will have to pay bill for his pain, mental anguish, lost wages, loss of family time and more... Yes you will have to pay damages if Bill can't have sex with his wife for sometime!.... how much is she worth? His employer can also come after you for productivity loss.

Unfortunately if the worse was to come, it will all be settled by numbers.

So here's the question that comes next:

How much does a serious injury cost?
How much would it cost in case of a death?

Find below the US national average for 2006 per injured

Death$4,000,000
Incapacitating injury$201,100
Nonincapacitating evident injury$50,400
Possible injury$24,400
No injury$2,200

Property Damage Crash

$8,200
(Data from the National Safety Council nsc.org)

Remember, if there are 2, 3, 4, 5 people in the car, the costs will multiply and unfortunately not your coverage.
So you should adjust your coverage with the number of people usually in your car, and in the cars around you.

Also, remember that all this does not need to be covered only by a car insurance, you can buy a global 'liability' insurance that will cover you for liability with your cars, houses...
some $200-$300 for $1Million then $50 per additional million.

You may be safer inside an SUV/Pick-up, but you have 6 times more risk of killing others in the event of an accident. SUV/Pick-up don't handle as well as cars and are four times more likely to roll over.

Public transportations are the safest, 10 times!

Below is a table of the coverages that my insurance offers me. You can select the different options you want and see the total. In red is what I believe appropriate for someone in a case similar as mine.
I drive a 4 years old VW Passat, which I consider safe.
I park it in a safe neighboorhood.
I live in California, bay-area => the chances of hitting a Mercedes, Porshe or Lexus are pretty high: I need a good Property Damage coverage.

Bodily Injury
This pays for the people you injure and protect your assets from lawsuits

$15,000/$30,000
$61.1
$30,000/$60,000
$76.4
$50,000/$100,000
$82.5
$100,000/$200,000
$89.3
$100,000/$300,000
$92.3
$300,000/$300,000
$99.0
$300,000/$500,000
$102.1
$500,000/$750,000
$105.8
$500,000/$1,000,000
$107.2
$1,000,000/$1,000,000
$113.7
Uninsured Motorist
This pays if you are injured by an uninsured

$15,000/$30,000
$12.8
$20,000/$40,000
$15,0
$25,000/$50,000
$16.6
$30,000/$60,000
$17.9
$50,000/$100,000
$19.8
$100,000/$200,000
$26.8
$100,000/$300,000
$29.3
$300,000/$300,000
$34.4
$300,000/$500,000
$36.4
$500,000/$500,000
$39.5
Property Damage
This pays for cars and properties you damage and protect your assets

$5,000
$83.6
$10,000
$88.0
$15,000
$88.8
$20,000
$89.8
$25,000
$90.6
$50,000
$93.2
$100,000
$95.9
Comprehensive
This pays if you car gets damaged by theft or nature

N/A
$0
$1000 Ded.
$38.9
$500 Ded.
$43.5
$250 Ded.
$50.5
$200 Ded.
$55.2
$100 Ded.
$66.0
$50 Ded.
$77.6
$0 Ded.
$97.0
Collision
This pays for repair or replacement in case of an accident

N/A
$0
$1000 Ded.
$203
$1000 Ded./Waiver
$208.4
$500 Ded.
$223.4
$500 Ded./Waiver
$226.1
$250 Ded.
$324.9
$250 Ded./Waiver
$326.2
$200 Ded.
$345.3
$200 Ded./Waiver
$346.3
$150 Ded.
$365.6
$25 Ded.
$812.2
Rental Reimbursement
This pays for rental car while you car is repaired after a collision

N/A
$0
$25/Day, $750 Max
$8.8
$50/Day, $1,500 Max
$17.6
Medical Payments

$0
$0
$1000
$12.0
$2000
$17.4
$3000
$19.7
$4000
$20.9
$5000
$21.5
$7500
$25.1
$10000
$27.4
$25000
$38.8
Current Selection

Bodily Injury
Uninsured Motorist
Property Damage
Comprehensive
Collision
Rental Reimbursement
Medical Payments
Grand total

Hopefully this will help you drive without worrying.

Good Day!

Friday, April 10, 2009

Cheapest Kirkwood Pass 2009-10


Take advantage of this Unlimited Network Pass

Sold $379, a $200 reduction, and the group will send you $10 back via PayPal.

Get your pass at
http://www.kirkwood.com/networkpass
login : deal
password : kirkwood

before the price increases on April 30th


Find the group details at
http://tinyurl.com/cheapkirkwoodpass

Thursday, April 9, 2009

My first time on the web

I was 18 when I first surfed the Internet.

This was back in September 1998.
I was joining a new school which had a computer lab with Internet access.
I was very excited, and the first day of class, for the lunch break, like many other students, I rushed to the lab to see this 'Internet' everybody was already talking about. (I was reading many computer magazines).

I knew I had to open a browser and type an address, I had written a couple addresses on a paper, which I obviously forgot.
I sat down at the computer, I was so excited that I could hardly remember any address, they were all mixed in my head, finally I typed "Yahoo.com". Something comes on the sceen, I didn't understand what it's for, it wasn't intuitive, no pictures. I tried another address "laposte.fr" (the french USPS), nothing to do there either, I can see information but it's not relevant to me, I have no interest for it. I knew I was on something amazing but I couldn't grasp why. I saw it as a great tool for companies, professionnals seeking information about other companies, nothing really fun yet.
I quickly discovered the IRC chat rooms with their online friendships, love stories, bot wars, MP3 music, games, created my first HTML page... this was just amazing and so far less than we have today, this was when we had never heard of google yet :)

How was your first time?