Posts tagged with “tech”

Posted 6 months ago

Enabled digest authentication on Apache for repository access, so Apache authenticates users before allowing access to repositories.

Now I need to be able to manage things like:

user1 has ‘read access’ to repo1

user2 ha ‘readwrite access’ to repo1

etc.  but how? That’s what I got to figure out.

Posted 6 months ago

Using mod_rewrite rules of Apache and corresponding changes to hgweb.config file I am able to hide the hgwebdir.cgi from the URL. Next is to configure fine-grained access control to repositories.

Posted 6 months ago

A narrow hgwebdir HOWTO

I wanted to publish Mercurial repositories over HTTP using hgwebdir & I just got it working for me.

I struggled for a while with this & I thought a post on how I got it working (however narrow it might be) could be of some help to some. I write this without any assurances and being fully aware that this info can become stale pretty quickly.

System Info: Windows 7, Apache 2.2, Python 2.5, Mercurial 1.4.2 (Windows binary distribution)

Assuming you have Apache 2+ server up & running and you also have Python 2.5 installed (Python 2.6 dint work for me, it caused some magic number errors), I list the steps to get it working.

Steps:

1. Download the mercurial binary distribution 1.4.2 from http://mercurial.selenic.com and install it. (I installed it under “C:\Program Files\Mercurial” and I’ll refer to this path as Mercurial Installation Path or MIP). Make sure mercurial is properly installed and is working, check by typing the hg command at the command prompt.

2. Notice library.zip under MIP, extract it to a folder called library in MIP.
You should also find a folder called Templates under MIP, just copy the Templates folder to the library folder. (this being a HOW-TO & not a WHY-TO, don’t worry why)

3. Now you need hgwebdir.cgi script but, unfortunately the binary distribution doesn’t have it. You need to get it from source for which you can download the tar.gz or you could clone the mercurial repository (like I did) with the command:

hg clone http://selenic.com/repo/hg

4. You will find the script under the root folder, decide where you want to have your cgi script and place it there. For instance I created a folder called webdir under C drive and copied the hgwebdir.cgi script to that.

5. You need to make appropriate changes to the script similar to what I have done:

First line should have the path to python.exe my line looks like this:

#!c:/Python25/python.exe

Then I uncommented the following lines :

#import sys
#sys.path.insert(0, “/path/to/python/lib”)

and changed them to

import sys
sys.path.insert(0, “C:\Program Files\Mercurial\library”)

I also uncommented the following lines for debugging purpose (this is optional)

#import cgitb
#cgitb.enable()

6. You need to create the hgweb.config file and add the paths to the repositories. I added just the 2 lines listed below to the file hgweb.config which I have placed under C:\webdir (where I have my hgwebdir.cgi). Note that hgwebdir.cgi shows other patterns of specifying repositories.

[paths]
repos = C:\Users\Rajeev\RND\*

(I am exposing the repositories under C:\Users\Rajeev\RND)

7. Configuring Apache is the last mile. There are many ways that you can configure it but, I am just showing what I done. To httpd.conf file I added the following:

Alias /hg “C:/webdir”
<Directory “C:/webdir”>
Options +ExecCGI
AddHandler cgi-script .cgi
Order deny,allow
Allow from all
</Directory>

Note that I haven’t taken care of access control and I am not yet bothered by the ugly URL that I use to access the repositories.

8. Thats it, when I access the URL http://localhost:8080/hg/hgwebdir.cgi it lists me the repositories under my RND folder. I cloned my helloworld repository using the command:

hg clone http://localhost:8080/hg/hgwebdir.cgi/repos/helloworld

P.S. I still need to figure out how to manage access rights to repositories and how to avoid hgwebdir.cgi in the URL.

    Posted 6 months ago

    Able to publish Mercurial Repositories over HTTP using hgwebdir.cgi

    I need to figure out how to manage access rights to published repositories.

    Posted 7 months ago

    Can we do REST without HTTP?

    (via: techpost)

    I am wondering if we can do REST without HTTP!!

    I was just thinking about plug-ins for an application that we are developing. Very desirably:

    1. anybody should be able to write a plug-in and
    2. in any language they choose to write.

    Thinking about the second point what came to my mind effortlessly was REST but, following that is this question:

    Can we do REST without HTTP?

    It would be great if my application can call all the plug-ins in a standard fashion, transparently, irrespective of what language a plug-in is implemented in.

    (The link above deals with the same question.)

    via techpost
    tags: #tech #REST
    Posted 7 months ago

    "The meaning of Open" From the official Google Blog

    “At Google we believe that open systems win. They lead to more innovation, value, and freedom of choice for consumers, and a vibrant, profitable, and competitive ecosystem for businesses. …..

    … Open will win. It will win on the Internet and will then cascade across many walks of life: The future of government is transparency. The future of commerce is information symmetry. The future of culture is freedom. The future of science and medicine is collaboration. The future of entertainment is participation. Each of these futures depends on an open Internet.  ….”.

    Click the link to read The entire blog-post.

    Posted 7 months ago

    Ruby or Scala?

    Python, Ruby, Scala & Groovy are all unexplored frontiers to me. I’m wondering what is worth giving a shot during tea-time for a few days. I have a friend who swears by Python but, going by my first impressions about these languages I just left out, Groovy and Python (I may be wrong but, It doesn’t matter much to me).

    Now I need to choose between Ruby & Scala.

    Any Suggestions?

    Posted 8 months ago

    Netbook OS benchmarks

    Incidentally, Ubuntu Netbook Remix 9.10 turns out to be the winner according to this benchmark tests, and the all new Chromium OS needs to catchup.

    B.t.w no MS OS is in the scene here. Where is Windows 7?

    Posted 8 months ago
    Posted 10 months ago

    Laptop battery myths

    marco:

    TUAW ends this article about laptop batteries with this advice:

    Never leave the machine plugged in all the time. Laptops are meant to be portable. Using it as a desktop that never runs on the battery will destroy your battery life.

    Cycles are your friend. Never letting the battery complete a cycle will greatly diminish your run-time. Try to avoid charging the battery unless it’s drained past 30%. Any time the battery drains past 50% and charges more than 50% counts as a cycle. The farther you let it drain before the charge - the better its overall health will remain.

    30 cycles in a year is not a good thing. ;)

    Let the battery drain completely a few times a week.

    Never let it sit for long periods of time without use. Batteries need to be loved or else they won’t love you.

    Most* of these tips are incorrect for the lithium-ion (and, more recently, lithium-polymer) batteries that are used in nearly every laptop manufactured in the last decade.

    The “memory effect”, or the need to “refresh” or “deep-cycle” the battery by completely discharging before recharging, is stale knowledge from the time of NiCad and NiMH batteries. Lithium-ion batteries don’t suffer from the memory effect.

    It’s also not bad to leave your laptop plugged in. In fact, it’s a good thing to keep it plugged in whenever you don’t need to be running on battery power.

    * Update: Apple recommends that you run it on battery for a while at least once per month. It’s pretty difficult to own a laptop and not do this, but it is an edge case that some people achieve. So I’ll amend this: You shouldn’t technically leave your laptop plugged in all the time, but you certainly don’t need to deep-cycle it “a few times a week” as the TUAW post states. Furthermore, the recommendation for monthly battery usage isn’t just for capacity preservation: it’s mostly so the charge indicator can maintain accuracy as the battery’s capacity decreases naturally over its lifespan.

    With that said, here’s how lithium-ion batteries behave.

    Due to their chemistry, their capacity slowly diminishes with age. Laptop batteries usually lose most of their useful capacity 2-3 years after manufacture (not initial use). The new lithium-polymer batteries in the MacBook Air and unibody MacBooks (only the non-removable ones) claim to have improved this, but it’s too early to tell if these claims have merit. Assume that most laptop batteries will need to be replaced after a few years.

    If you use the laptop on battery power a lot, the battery lifespan will be shortened. This “wearing out” effect is much less severe than with older battery technologies, but is still present. This is why you should plug it in if it’s convenient.

    When plugged in, the battery is not in use. The laptop’s power circuitry bypasses the battery unless it’s needed. Depending on how smart the charger is, it may occasionally poll and “top off” the battery if its charge decreases to a certain threshold below 100%, but this is rarely needed in practice.

    If the battery is not in use, it will slowly lose its charge due to all rechargeable batteries’ tendency to slowly self-discharge. Lithium-ion and lithium-polymer batteries have the lowest self-discharge rates of any common battery technology, estimated at less than 1% per month and difficult to distinguish from the loss of capacity with age.

    In reality, if your laptop is closed, the battery slowly discharges with time because it’s not really “off”. A small amount of continuous power is needed to preserve the RAM’s state during sleep. It’s not the battery wearing out — it’s being used, but much more slowly than when the computer’s in use.

    When Apple decides whether a battery is defective or has been worn out normally, the “special utility” they run is System Profiler. You can run it, too. Check the Power section, and it’ll tell you your battery’s cycle count, the intended capacity at manufacture, and how much capacity per cycle remains. Apple technicians compare the cycle count to the capacity loss. If your battery has lost a lot of capacity in its first year but hasn’t performed enough cycles to reasonably correlate to the capacity loss, they’ll replace it under warranty.

    via marco
    tags: #tech
    Posted 1 year ago

    techpost:

    Ted Nelson on Zigzag data structures

    “I hope that in our archives and historical filings of the future, we do not allow the techie traditions, of hierarchy and false regularity, to be superimposed, on the teaming, fantastic disorderliness, of human life.”

    -Ted Nelson (colcluding reamrks of this video)

    via techpost
    Posted 1 year ago
    From river deep to mountain high - @NASA releases the most complete topographic map of Earth ever http://sn.im/l8lmx and it’s free!
    Posted 1 year ago
    tags: #tech #patents
    Posted 1 year ago

    Towards a Decentralized, Non-Propritery Social-Network

    • Imagine a world where you just need to maintain one online profile and the same profile information is valid on Face-book, Orkut, LinkedIn, your blog or any other site on the Internet.
    • Imagine you don’t need to befriend your friends time and again on each social networking site.
    • Imagine you have access to a Social-Graph irrespective of where the nodes may be; some friends from Face-book, some from Orkut, and some are independently hosting their profiles on their websites.

    Hard? It Shouldn’t be.

    • We have a universal mail-address (one can send a mail from Gmail to a Yahoo Id without a problem).
    • Open-Id has given us a mechanism to use a single user-id & password for use across multiple sites.
    • And Now FOAF has the potential to do that to social graphs.

    I do not wish to discuss FOAF in detail here because, there is already enough about FOAF available out there (see: links at the end).

    Very briefly however, FOAF is a vocabulary that can be used for describing people and their relationships. You can create an FOAF Profile in XML format in which you can describe yourself and also point to profiles of your friends.

    Here is my FOAF profile visualized:

    In the visualization above you can see people I know (under the “Knows” heading). The last person in the list, libby, is a link and it leads to Libby Miller’s FOAF profile. Interesting isn’t it?

    Some creases that need to be Ironed out w.r.t FOAF:

    • Trust: How can you trust that the FOAF profile shown above really belongs to me?
    • Privacy: How can I make some sensitive information in my foaf-profile like Date-of-Birth, email-address etc accessible only to people I trust? (I have SHA-1 encrypted some sensitive information in my profile but, that’s not a solution)
    • How can my FOAF profile become my universal Profile?

    People are suggesting ways to solve problems. There are already some proposals to solve the issue of trust (see PGP Signing FOAF-Profiles),

    I hope to see some discussion on the Privacy of FOAF profile information, I wonder if there is some value in bringing Open-Id and FOAF closer.

    With the right questions getting asked and answered, I don’t see why an FOAF-profile cant become a universal profile on the Internet.

    Some Resources:

    1. FOAF - Building Networks with a Friend of a Friend
    2. PGP Signing FOAF Files
    3. Fun with FOAF
    4. FOAF Visualization
    5. Some FOAF tools
    6. The FOAF Vocabulary
    7. FOAF + SSL
    Posted 1 year ago

    Web & Semantic Web

    The Web (World Wide Web)

    • The World Wide Web  is a web of documents; A global repository of linked documents (with HTML hyper-links acting as the glue).
    • Documents that are well presented for humans to glean information from.
    • One can navigate the web, hopping from one document to another transparently irrespective of which computer the documents are stored on.
    • Web is a realization of “It isn’t the computers, but the documents which are interesting”.
    • The World Wide Web is Document centric.

    The Semantic Web

    • The Semantic Web is a web of data; A Web scale database (RDF defining the structure of data)
    • Data that is structured enough  to be processed by machines/software-agents (which in-turn may provide information of better quality for human consumption)
    • Graphs of data which can be processed to infer non explicit knowledge.
    • Semantic Web is a realization of “It isn’t the Documents but the things they are about that are interesting”
    • The Semantic web is Data centric.