Tumblelog by Soup.io
Newer posts are loading.
You are at the newest post.
Click here to check if anything new just came in.

May 28 2013

Linux: Force permissions for new files/directories

mkdir foo
chgrp somegroup foo
chmod g+ws o-rwx foo
setfacl -dm u::rwx,g::rwx,o::- foo

All files in directory foo will be created with 660 (directories with 770) permission in the group somegroup.

Tags: Technix

March 25 2011

Apache2 AuthExternal and WebDav

Now for something technically more challenging, because it cost me several hours of debugging, but was pretty simple actually. In case somebody else on the world tries to restrict read/write-permissions to a WebDav directory with the AuthExternal module, they can find a solution here :)

For my newest project in work I am setting up a project server offering Git repositories, a web page and maybe more. Something similar to GitHub but we want to maintain the repositories ourselves. I’m using Drupal for the web page and the access control and a selfwritten module (called Git Repository) for the interaction with the Git archives (I didn’t really find a matching module for this job, at least for Drupal 7).

Access to the Git Repositories is limited to http(s) via WebDav currently, using the Apache2 AuthExternal module for authentication. In the “Git Repository”-module there are two scripts which handle interaction - they connect to Drupal asking for read/write-permission to the linked node.

For checking read/write-permission I used this howto, but I had the problem it didn’t work, write access was still possible to the directory, though the script returned the correct exit-codes.

This is the .htaccess-file:
AuthType Basic
AuthName "Repository"
AuthBasicProvider external
AuthExternal git_repo
GroupExternal git_repo
<LimitExcept GET HEAD OPTIONS>
Require group may_write
</LimitExcept>
Require group may_read

According to the howto this should be correct … and it is, I tested it without GroupExternal authentication. After several hours of debugging I came up with a really simple solution:

Apparently GroupExternal does a fall-back to the default “Require group” statement in case the limited “Require group” statement fails. So my simple solution was to just use negative logic:
AuthType Basic
AuthName "Repository"
AuthBasicProvider external
AuthExternal git_repo
GroupExternal git_repo
<Limit GET HEAD OPTIONS>
Require group may_read
</Limit>
Require group may_write

Voila, problem solved.

July 20 2010

CGA-Backup

A couple of years back I developed a script for the backups at the institute where I’m working, it’s called the CGA-Backup. Unfortunately this script is no longer in use there, as my colleagues preferred to change to a more popular solution (BackupPC). Anyway, there are still people using this script and I’m willing to maintain it, as I still use it for private projects and think it’s a nifty piece of code. As I’m lately opening my projects up at Gitorious, I also plucked it from the closed environment of our SVN-server. Here you are.

January 18 2010

The Zeitgeist movement

A couple of days ago somebody gave me a DVD with the movie “Zeitgeist“, which is distributed freely over the internet and by DVD (if you like it you can burn a copy, make a special cover out of a A4 sheet of paper, and distribute it). I was quite curious about this movie, as it is about Change in our world.

Actually it was quite interesting, most of it questions our economic system based on monetary values, which - according to the movie - is one of the main reasons for inequalities on Earth, as one of its basics is debt and scarcity. Which is true in many ways, in the last century poverty and hunger massively increased and state debts multiplied, although progress developed many new inventions which might obsolete poverty, famines and diseases. It’s true, the “western world” exploits their inhabitants and the poorer regions of Earth.

A big part of the movie are world conspiracies, performed by the U.S.A., who are accused of assaulting leaders of developing countries to keep up their influence and fight against democratization of their countries. This is something where I don’t know what to think, I can’t believe that a nation can do this without noticing and being held responsible for this. On the other hand it sounds pretty reasonable, e.g. it’s a matter of fact, that (at least some) of the last wars (e.g. Iraque) have been fought due to economic reasons. Without 9/11 this war might not have been possible. 9/11 also helped to implement surveillance laws (to oppress its inhabitants, living in permanent fear). Another example is the U.S. ignorance of global climate change.

The last part of the movie was rather disappointing to me, it’s about the Venus Project (the makers of the movie as it turns out). I’ve read about this project before and I regard it as immature (not to say bullshit). The Venus Project develops ideas for a society based on a “resource based economy”. Technical progress should enable us to live without any inequalities, totally based on renewable energies and so on (that’s the good part). But it sounds like an Utopia from the 1950s-1970s, with all those huge buildings and transportation systems in tubes and everybody has their own car (which runs on renewables, with a lot of security measures, and so on). Sorry. But that’s too late, those Utopias are stories from the past.

My biggest concern: Who manages the resources?  There’s a long page about their mighty resource based economy, but no explanation about its function. Even if an economy is not based on monetary values, somebody has to distribute those resources. How do I get food, a new computer or a car? They will never “fall from the sky”. Somebody has to produce it. Even if it is produced by machines, somebody has to build those machines. Will somebody (a person, company, organization or entity) will create it, “just because it feels right”? Somebody has to decide what should be build. Somebody has to decide where to build something.

This “who” doesn’t have to be a single person. It can be a community. It could be an elite, but who decides who is that elite? It could be a democracy, but there are many kinds of democracies and most of them don’t produce equalities. I’m sure, we do need a new social system. Fast. Urgent. But the movie “Zeitgeist” and the Venus Project don’t answer this question.

Have you seen this movie? What do you think about it? Ideas for a new social system?

Older posts are this way If this message doesn't go away, click anywhere on the page to continue loading posts.
Could not load more posts
Maybe Soup is currently being updated? I'll try again automatically in a few seconds...
Just a second, loading more posts...
You've reached the end.

Don't be the product, buy the product!

Schweinderl