Comparing the religions

0 comments

 

When I read about a particular religion, I look for answers to two questions:

1) where did I come from?
2) where am I going?

The answer to the first question is far more important than the second as it reveals the depth and understanding of that belief.    When comparing religions on the answers to the first question, the current religion today falls into two groups:

A)  The belief that man is eternal in nature.
B)  The belief that man is mortal and limited by death.

Interestingly, the religions that fall into set A are:  Buddhism, Hinduism, Scientology.  The religions that fall into set B are: Christianity, Islam, Judaism.

Getting the answer from set B is easy, as all three religions are founded on the same text:  "In the beginning God created the heavens and the earth," but getting the answer to this simple question from set A is not easy because the answer is buried under tons of cultural and philosophical dialogue (a lot of which are psychobabble).  For example, when someone asks a straight question, "how do I attain eternal life?" in the Upanishads, you won't find the answer in the next paragraph, but you need to dissect the poetic parable that follows which sounds a lot like what you'd read in a fortune cookie... sounding deep and thought-provoking, but ultimately useless.  Compare this to set A, it's easy as pie:  follow these ten rules, and you'll attain eternal life.

But anyway, the answer to "where did I come from?" in the religions belonging to set A is:  nowhere.   A man's soul is eternal by nature, and that the goal of life is to attain immortality.  

In Hinduism, attaining immortality is done by "realizing the Self."   HUH?  WHAT? You ask?   It may make more sense to tell you that in Hinduism, every living thing is made from the same primordial substance -- I call it, THE STUFF.   This STUFF is what gave birth to Brahma, the Hindu god of creation.  Brahma, in turn, gave birth to other gods, although I'm not clear as to how Brahma pro-creates.    This STUFF is actually called Brahman in Hinduism.   "Realizing the Self" is another way of saying "finding the Brahman in you"-- i.e.   if you look deep enough into yourself, you'll find Brahman.  But you need to be extremely "enlightened" to do this, and all the text in Hinduism aims for this purpose -- enlightenment of the mind.    So, where did I come from?   the answer is nowhere... you're made from the same "stuff" as the gods... but unfortunately, you're not enlightened enough to realize this.  Get it?  No?  you're not enlightened enough!   (BTW, you might be interested to know that the STUFF, in Star Wars cosmology, is called The Force).

While we're on enlightenment, lets now turn to Buddhism.  The religion of buddhism has been polluted with Hindu gods, so even some Buddhists believe in the same "gods" as Hinduism.  But Buddhism in its true sense has no "gods" at all.   So, where did I come from?  again, nowhere.  We've always existed,  being born and re-born through a cosmic force called Karma.  Suffering in the world, according to Buddhism, exists because of our attachments to our thoughts and emotions-- and, in this way, we become selfish and cause harm to others.   The goal of Buddhism is to realize these harmful things that we do through our thoughts and actions, and become "empty of inherent existence" -- in fully achieving this emptiness, you're one step closer to reaching Nirvana -- i.e.  the ultimate state of enlightenment where you become free of suffering and individual existence.   Siddhartha Gautama was born a man and supposedly reached "Buddhahood" at the age of 35.    It's implied that once you reach the state of Nirvana, you're free from the cycle of rebirth.   Since the earth itself is not eternal in nature, presumably there's some point in the past where the cycle of birth began and human beings started out as unenlightened idiots, until the first Buddha (Siddhartha Gautama) came along.  I can't find anything in Buddhist texts that tells me when this cycle of birth began and more importantly, why.

The last religion in this group is Scientology.  This religion was created by science fiction writer L. Ron Hubbard in the 1950s.    In scientology, man was originally an eternal, spiritual being called a thetan.    Thetans created the world, but somehow, they become attached to their creations (man) and assumed their identifies, and live their lives as man.   The suffering in the world causes the creation of "engrams," mental images which is harmful to the reactive mind and causes thetan to drift further away from their true state of being.     In order for a person to move closer to their true state of being (the thethan), he (or she) goes through a set of training (called dianetics) so that these engrams can be purged from the mind.    Once this is done, the person is said to be in "Clear" state.   How do you get these trainings?  By paying money to the church, of course! --- what?  you expect to reach this state through "enlightenment" like the Buddhists and Hindus?

The story of how the thetans became living bodies is worthy of a science fiction movie.   75 million years ago, an alien called Xenu (a ruler of the "Galactic Confederacy"), brought people  together to Earth aboard a spaceship that looks a lot like the DC-8, stacked them around volcanoes and detonated hydrogen bombs in the volcanoes.   The thetans then clustered together and stuck themselves to these people.

The story about Xenu was supposedly not given to ordinary scientologists, but given only to high-ranking individuals (read: people who donated a LOT of money to the church) under the claim that this knowledge can be harmful for people at lower levels of clarity -- i.e. those farther away from their thetan self.    Personally, I think this information was kept secret because most people who heard it would probably think L. Ron Hubbard finally had a psychotic break, and I do still smile silently whenever I pass a scientology church.

Now, let's compare the religion of group A with group B, all of which are based on Judaism.   Where did I come from?   I was created.  Where am I going?  eternal life.  How do I get there?  Follow 10 rules.   No enlightenment or money needed (although some churches/mosques/synagogues would have you think that!).  Straight to the point.  I like it.

Posted via web from Herry's posterous

Enoch the intercessor

0 comments

 

This passage from the Book of Enoch is interesting in that it underscores a point that Christian churches almost never point out:   God doesn't forgive everyone who repents.    Christians say, "God loves you," as easy as drug dealers say, "this is the good stuff."... and well, that's not surprising since it's a lot harder to convince sinners to become Christians if you tell them, "you may not go to hell but let's give it a good try."

What's pernicious about the whole thing is that you end up with a bunch of people who think they're Christian and going to heaven, and when one already believes he's going to heaven, his pride and self-righteousness usually does the rest.   This is the same prideful road as those Muslims who believe killing a Jew will land them 72 virgins, and somehow, the word "sex orgy" will have a different meaning in heaven than on earth.   On a side note, C.S. Lewis, wrote a terrific chapter on pride in his book, "Mere Christianity."

What's even more horrible is that you also have a bunch of people who think that God can be easily fooled.   Want to end up in heaven? well.. just repent at anytime.   It worked for the thief who was hung next to Jesus, so why not you?    And you end up with people who expect to sin because, well, no one is perfect, right?  and if you do, just confess your sins on your deathbed, and away to heaven you go.    What a joke.

 

In this passage, the fallen angels calls on Enoch to be their intercessor and asked God for forgiveness on their behalf.   Enoch prayed for them so that they may be forgiven, but he was brought up to God's throne so he could speak in person and meet Him face to face.

 

Chapter XII

    Before these things Enoch was hidden, and no one of the children of men knew where he was hidden, and where he abode, and what had become of him. And his activities had to do with the Watchers, and his days were with the holy ones.
    And I, Enoch,was blessing the Lord of majesty and the King of the ages, and lo! the Watchers called me -- Enoch the scribe -- and said to me:  "Enoch, you scribe of righteousness, go, declare to the Watchers of the heaven who have left the high heaven, the holy eternal place, and have defiled themselves with women, and have done as the children of earth do, and have taken unto themselves wives: 'You have wrought great destruction on the earth, and you shall have no peace nor forgiveness of sin, and inasmuch as they delight themselves in their children, they shall see the murder of their beloved ones, and lament over the destruction of their children, and shall make supplication unto eternity, but you will not attain mercy and peace.'"

Chapter XIII

    And Enoch went and said:  "Azazel, you will have no peace: a severe sentence has gone forth against you to put you in bonds, and you shall not have toleration nor request granted because of all the works of godlessness and unrighteousness and sin which you have shown to men."  Then I went and spoke to them all together, and they were all afraid, and fear and trembling seized them.  
    And they besought me to draw up a petition for them that they might find forgiveness, and to read their petition in the presence of the Lord of heaven, for from thenceforward they could not speak with Him nor lift up their eyes to heaven for shame of their sins for which they had been condemned.  Then I wrote out their petition, and the prayer in regard to their spirits and their deeds individually and in regard to their requests that they should have forgiveness and length.  And I went off and sat down at the waters of Dan, in the land of Dan, to the south of the west of Hermon.  I read their petition until I fell asleep.  And behold a dream came to me, and visions fell down upon me, and I saw visions of chastisement, and a voice came bidding me to tell it to the sons of heaven and reprimand them.  And when I awaked, I came to them, and they were all sitting gathered together, weeping in 'Abelsjail, which is between Lebanon and Seneser, with their faces covered.  and I recounted before them all the vision which I had seen in sleep, and I began to speak the words of righteousness, and to reprimand the heavenly Watchers.

Chapter XIV

    The book of the words of righteousness, and of the reprimand of the eternal Watchers in accordance with the command of the Holy Great One in that vision.  I saw in my sleep what I will now say with a tongue of flesh and with the breath of my mouth, which the Great One has given to men to converse therewith and understand with the heart. As He has created and given to man the power of understanding the word of wisdom, so has He created me also and given me the power of reprimanding the Watchers, the children of heaven.  I wrote out your petition, and in my vision it appeared thus that your petition will not be granted unto you throughout all the days of eternity, and that judgement has been finally passed upon you. Yea, your petition will not be granted unto you, and from henceforth you shall not ascend unto heaven unto all eternity, and in bonds of the earth the decree has gone forth to bind you for all the days of the world.
    And that previously you shall have seen the destruction of your beloved sons and you shall have no pleasure in them, but they shall fall before you by the sword. And your petition on their behalf shall not be granted, nor yet on your own, even though you weep and pray and speak all the words contained in the writing which I have written.   
    And the vision was shown to me thus:  Behold, in the vision clouds invited me and a mist summoned me, and the course of the stars and the lightnings sped and hastened me, and the winds in the vision caused me to fly and lifted me upward, and bore me into heaven.  
    And I went in till I drew nigh to a wall which is build of crystals and surrounded by tongues of fire, and it began to affright me.  And I went into the tongues of fire and drew nigh to a  large house which was built of crystals, and the walls of the house were like a tesselated floor made of crystals, and its groundwork was of crystal.  Its ceiling was like the path of the stars and the lightnings, and between them were fiery cherubim, and their heaven was clear as water.
    A flaming fire surrounded the walls, and its portals blazed with fire.  And I entered into that house, and it was hot as fire and cold as ice, there were no delights of life therein.  Fear covered me, and trembling got hold upon me.  And as I quaked and trembled, I fell upon my face, and I beheld a vision, and lo! there was a second house, greater than the former, and the entire portal stood open before me, and it was built of flames of fire.  And in every respect it so excelled in splendor and magnificence and extent that I can not describe to you its splendor and its extent.  And its floor was of fire, and above it were lightnings and the path of the stars, and its ceiling was also flaming fire.  And I looked and saw therein a lofty throne:  it's appearance was as crystal, and the wheels thereof as the shining sun, and there was the vision of cherubim.  And from underneath the throne came streams of flaming fire so that I could not look thereon.   
    And the Great Glory sat thereon, and His raiment shone more brightly than the sun and was whiter than any snow.  None of the angels could enter and could behold His face by reason of the magnificence and glory, and no flesh could behold Him.  The flaming fire was round about Him, and a great fire stood before Him, and none could draw nigh Him:  ten thousand times ten thousand stood before Him, yet He needed no counselor.   And the most holy ones who were nigh to Him did not leave by night nor depart from Him.  And until then I had been prostrate on my face, trembling:  and the Lord called me with His own mouth, and said to me:  "Come hither, Enoch, and hear My word."  And one of the holy ones came to me and waked me, and He made me rise up and approach the door, and I bowed my face downward.

Chapter XV

    And He answered and said to me, and I heard his voice:  "Fear not, Enoch, you righteous man and scribe of righteousness: approach hither and hear My voice.  And go, say to the Watchers of heaven, who have sent you to intercede for them:  'You should intercede for men, and not men for you.  Wherefore have you left the high, holy, and eternal heaven, and lain with women and defiled yourselves with the daughters of men and taken to yourselves wives, and done like the children of earth, and begotten giants as your sons?   And though you were holy, spiritual, living the eternal life, you have defiled yourselves with the blood of women and have begotten children with the blood of flesh, and, like the children of men, have lusted after flesh and blood as those also do who die and perish.  
    Therefore I have given them wives also that they might impregnate them, and beget children by them, that thus nothing might be wanting to them on earth.  But you were formerly spiritual, living the eternal life, and immortal for all generations of the world.  And therefore I have not appointed wives for you, for as for the spiritual ones of heaven, in heaven is their dwelling.  And now, the giants, who are produced from the spirits and flesh, shall be called evil spirits upon the earth, and on earth shall be their dwelling.  Evil spirits have proceeded from their bodies, because they are born from men and from the holy Watchers is their beginning and primal origin; they shall be evil spirits on earth, and evil spirits shall they be called.
    As for the spirits of heaven, in heaven shall be their dwelling, but as for the spirits of the earth which were born upon the earth, on earth shall be their dwelling. And the spirits of the giants afflict, oppress, destroy, attack, do battle, and work destruction on the earth, and cause trouble.  They take no food, but nevertheless hunger and thirst, and cause offenses. And these spirits shall rise up against the children of men and against the women, because they have proceeded from them."

Chapter XVI

    "''From the days of the slaughter and destruction and death of the giants, from the souls of whose flesh the spirits, having gone forth, shall destroy without incurring judgement -- thus they shall destroy until the day of the consummation, the great judgement in which the age shall be consummated, over the Watchers and the godless, yea shall be wholly consummated.'  
    And now as to the watchers who have sent you to intercede for them, who had been aforetime in heaven, say to them: 'You have been in heaven, but all the mysteries had not yet been revealed to you, and you knew worthless ones, and these in the hardness of your hearts you have made known to the women, and through these mysteries women and men work much evil on earth.'
    Say to them therefore, 'You have no peace.'"

 

Posted via web from Herry's posterous

The fall of the angels

0 comments

The fall of the angels is described in the Book of Enoch.   This book, for some reason, was excluded from the Bible... which is really too bad because it contains a wealth of information that answers questions to a lot of Bible readers.     Enoch was one of a very few select men whom God chose to reveal the mysteries of heaven-- he was brought across all seven levels of heaven and reached God's throne.   He was probably the only man, except for Jesus Christ, to skip death completely in that God raised him directly to heaven in his old age (leaving his wife and children behind).    Even Moses died and did not have this priviledge.

In this excerpt, we see the fallen angels make a secret agreement with each other to sleep with women of the earth, and have children with them.  These children turned to become giants, and they were also evil and corrupt.    When we say, "evil spirits," or "demons"  it's actually the spirits of these giants, not the spirit of dead grumpy old men who got pissed that they couldn't take their million dollar bank accounts with them..  It's also because of these giants that God decided to wipe out the earth with the flood.   

The fallen angels who slept with the women are called "Watchers," and it's they who introduced men to various crafts from making swords to astrology, to women's make-up.  

Pay particular attention that Sataniel (i.e. Satan) is not mentioned here.  :)      Another passage of interest is that the fallen angels later repented and asked for God's forgiveness, but God did not forgive their sins.   I lost that passage so I can't give any excerpts here.   

 

The Book of Enoch

Chapter VI.

    And it came to pass when the children of men had multiplied that in those days were born unto them beautiful and comely daughters.  And the angels, the children of the heaven, saw and lusted after them, and said to one another: "come, let us choose us wives from among the children of men and beget us children."  
    And Semjaza, who was their leader, said unto them, "I fear you will not indeed agree to do this deed, and I alone shall have to pay the penalty of a great sin."  
    And they all answered him and said, "Let us all swear an oath, and all bind ourselves by mutual imprecations not to abandon this plan but to do this thing."  
    Then they all swore together and bound themselves by mutual imprecations upon it.  And they were in all two hundred; who descended in the days of Jared on the summit of Mount Hermon, and they called it Mount Hermon, because they had sworn and bound themselves by mutual imprecations upon it.  And these are the names of their leaders:  Samiazaz, their leader, Arakiba, Rameel, Kokabiel, Tamiel, Ramiel, Danel, Ezeqeel, Baraqijal, Asael, Armaros, batarel, Ananel, Zaqiel, Samsapeel, Satarel, Turel, Jomjael, Sariel.  these are their chiefs of tens.

Chapter VII.

    And all the others together with them took unto themselves wives, and each chose for himself one, and they began to go in unto them and to defile themselves with them, and they taught them charms and enchantments, and the cutting of roots, and made them acquainted with plants.   And they became pregnant, and they bare great giants, whose height was three thousand ells: who consumed all the acquisitions of men.  And when men could no longer sustain them, the giants turned against them and devoured mankind. And they began to sin against birds, and beasts, and reptiles, and fish, and to devour one another's flesh, and drink the blood.  Then the earth laid accusation against the lawless ones.

Chapter VIII.

    And Azazel taught men to make swords, and knives, and shields, and breast-plates, and made known to them the metals of the earth and the art of working them, and bracelets, and ornaments, and the use of antimony, and the beautifying of the eyelids, and all kinds of costly stones, and all coloring tinctures.  And there arose much godlessness, and they committed fornication, and they were led astray, and became corrupt in all their ways.  
    Semjaza taught enchantments, and root-cuttings, 'Armaros the solving of enchantments, Baraqijal taught astrology, Kokabiel the constellations, Ezeqeel the knowledge of the clouds, Araqiel the signs of the earth, Shamsiel the signs of the sun, and Sariel the course of the moon.  And as men perished, they cried, and their cry went up to heaven ...

Chapter IX.

    And then Michael, Uriel, Raphael, and Gabriel looked down from heaven and saw much blood being shed upon the earth, and all lawlessness being wrought upon the earth.  And they said to one another: "The earth made without inhabitant cries the voice of their cryings up to the gates of heaven.  And now to you, the holy ones of heaven, the souls of men make their suit, saying, 'Bring our cause before the Most High.'"  
    And they said to the Lord of the ages:  "Lord of lords, God of gods, King of kings, and God of the ages, the throne of Your glory stand unto all the generations of the ages, and Your name holy and glorious and blessed unto all the ages!  You have made all things and power over all things: and all things are naked and open in Your sight, and You see all things, and nothing can hide itself from You.  You see what Azazel has done, who has taught all unrighteousness on earth and revealed the eternal secrets which were preserved in heaven, which men were striving to learn:  And Semjaza, to whom  You have given authority to bear rule over his associates, and they have gone to the daughters of men upon the earth, and have slept with the women, and have defiled themselves, and revealed to them all kinds of sins.  And the women have borne giants, and the whole earth has thereby been filled with blood and unrighteousness.  And now, behold, the souls of those who have died are crying and making their suit to the gates of heaven, and their lamentations have ascended, and cannot cease because of the lawless deeds which are wrought on the earth.  And You know all things before they come to pass, and You see these things and You suffer them, and You do not say to us what we are to do to them in regard to these."

    Then said the Most High, the Holy and Great One spoke, and sent Uriel to the son of Lamech, and said to him:  "Go to Noah and tell him in my name, 'Hide yourself!' and reveal to him the end that is approaching:  that the whole earth will be destroyed, and a deluge is about to come upon the whole earth, and will destroy all that is on it.   And now instruct him that he may escape and his seed may be preserved for all the generations of the world."   
    And again the Lord said to Raphael:  "Bind Azazel hand and foot, and cast him into the darkness: and make an opening in the desert, which is in Dudael, and cast him therein.  And place upon him rough and jagged rocks, and cover him with darkness, and let him abide there forever, and cover his face that he may not see light.   And on the day of the great judgement he shall be cast into the fire.   And heal the earth which the angels have corrupted, and proclaim the healing of the earth, that they may heal the plague, and that all the children of men may not perish through all the secret things that the Watchers have disclosed and have taught their sons.   And the whole earth has been corrupted through the works that were taught by Azazel: to him ascribe all sin."   
    And Gabriel said to the Lord: "Proceed against the bastards and the reprobates, and against the children of fornication: and destroy the children of fornication and the children of the Watchers from amongst men, and cause them to go forth:  send them one against the other that they may destroy each other in battle, for length of days they shall not have.  And no request that they (i.e. their fathers) make of you shall be granted unto their fathers on their behalf; for they hope to live an eternal life, and that each one of them will live five hundred years."
    And the Lord said unto Michael: "Go, bind Semjaza and his associates who have united themselves with women so as to have defiled themselves with them in all their uncleanness. And when their sons have slain one another and they have seen the destruction of their beloved ones, bind them fast for seventy generations in the valleys of the  earth, till the day of their judgement and of their consummation, till the judgement that is forever and ever is consummated.  In those days they shall be led off to the abyss of fire, and to the torment and the prison in which they shall be confined forever.  And whosoever shall be condemned and destroyed will from thenceforth be bound together with them to the end of all generations.  And destroy all the spirits of the reprobate and the children of the Watchers, because they have wronged mankind.  Destroy all wrong from the face of the earth and let every evil work come to an end, and let the plant of righteousness and truth appear, and it shall prove a blessing.  The works of righteousness and truth shall be planted in truth and joy forevermore.

 

Posted via web from Herry's posterous

God or aliens? the box philosophy

0 comments

I've started reading "Mere Christianity" by C.S Lewis.  For those who aren't into literature, he was the author of the Narnia books, and he was also an atheist who later converted to Christianity with the help of J.R Tolkien (Lord of the Rings).   The latter was what interests me since I was curious as to how he became a convert.    In one of the chapters, he used a thought mechanism which I call the "box philosophy"-- something that I use.  In this chapter, he made a strong assertion that if an all-powerful God exists, he must be good, and he must be One.   In other words, there can't be multiple "gods" as in, for example, the Greek mythology where you have Zeus, Athena, Hera, etc. 

There are essentially two views of "good and evil."  The first view is that "evil" is a corruption in a world of "good."   The second view is that there are two independent powers (good and evil), and these two powers are behind everything that is good and evil and there is an endless war between them.  This latter view is called dualism, and it's also similar to the Chinese Yin/Yang philosophy.

Now, the fundamental axiom is that evil cannot exist by itself--  that is, you can't do evil for evil sake, but rather, a person who is doing evil is a person who is trying to do good for himself, but in the wrong or immoral way (such as hurting others in the process).    A concrete example is someone who robs a bank to obtain wealth for hiimself-- i.e. it's good that he wants wealth, but robbing others is the wrong way of reaching that goal.  This axiom invalidates the duality theory because evil is now dependent on good---  i.e. there is no one who does evil just because it's evil.... or in other words, an evil action is good for somebody-- usually the evil-doer.   This necessarily implies that pure evil is self-destructing, and cannot exist by itself.

Supposing now that there are two "gods"-- one is good and the other one is evil (as to which one is which is a matter of preference).... then in this case, the god that is doing evil is really someone who is misguided and has gone the wrong path.   This realization implies that there's a higher moral standard under which the behavior of these two gods can be judged--- and this higher power is the real God.    If you take a more concrete example-- lets say Zeus, a "god" from Greek mythology--  he is married to his wife Hera, who is also a "god."  However, he had several affairs with other women, one of which is a mortal woman, and eventually gave birth to a son-- Hercules.     By any man's standard, having an affair with another woman is a wrong thing to do... hence, this moral standard cannot possibly come from Zeus himself, who does the immoral act, but must come from a higher authority that is higher than Zeus.   Therefore, this higher power is the real God, and Zeus is no more divine or morally superior that the average man.

I call this the "box philosophy" because its similar to fitting something abstract into a bigger box until you can measure some degree of truth.   Suppose you're moving to a different house, and you need to move your belongings.   How big a truck do you need to move all your stuff?   One way is to measure the dimension of each posession you have, and compute their sums  (gee, what's the dimension of my broom?).   If you do that, you'll never get anything done.   The fastest way is to put your belongings into boxes of known sizes, then simply count the number of boxes.   You put the smaller box into a bigger box, until you have one big box that's measureable.   Ultimately, that one big box is the truck that will carry your belongings.

When I was back in high school, I made an assertion that probably still stands even now:   you must either believe in God, or believe in aliens.

What?

Consider this:  the universe is either infinite, or is not.   If the universe is not infinite, then there is a well-defined boundary which necessarily means that the boundary is created and designed.  Why?   In the movie, "The Truman Show"   Jim Carrey attempted to sail the world, until his boat hits the wall...   why is the wall there?   clearly, the wall is there because someone put it there.     A goldfish might ask, "why am I in a bowl?"   The existence of the bowl proves the existence of its owner, and the fish knows that there's something beyond the bowl, beyond the boundary, but this is something that it can't reach.   If the universe had an end, you might ask, well,... what is the "end" made of?   if you had a spaceship, will your spaceship hit rubber material?   or solid rock?   but what is that made of?  what's beyond this material that limits the universe?  Lets start drilling and find out about this "bigger" reality -- e.g.  maybe the universe is wrapped inside another universe that's even bigger?  But if the universe was truly finite, there would be an absolute end.   A piece of material where you can't drill through...  this is where you find your maker... the creator of the wall... i.e. God, on the other side of the wall.    This is the point where you realize that you're the fish in the bowl.

Now, if you consider the universe as infinite, with inifinite number of planets and stars....  if you had a spaceship and start travelling one way, your spaceship will never see any end.  There's always more planets, more suns, more galaxies,... an endless number of them.   In this case, you must necessarily believe in the existence of aliens.   Why?    consider the question:  what is the probability of life in the universe?    Whatever the answer is, it is greater than zero because we exist.    If the universe is infinite, then it will beat that probability, no matter how small it is, and therefore, there must be life on another planet somewhere.

You could argue that perhaps the universe is infinite, but the number of stars are finite, however this is a self-defeating argument because what you're essentially saying is that the universe is vastly empty except for a super-micro section of it that contains life.   It's as self-defeating as saying that the universe contains infinite number of stars, but we happen to be the only living things that ever existed in the universe.    Logically and mathematically, these arguments doesn't make sense.   To say that we're the only living forms to have ever existed in an infinite universe has the same profound implication as the Christian view of creation and in fact align itself to it.    You could also argue that the universe does have a boundary, but no one built it---  however, this argument is as absurd and insane as a man walking into the Great Wall of China and believing that no one built it and that it always existed for no reason at all.

For Christians though, they needn't worry about the infinite because the number of stars in the sky is finite.  God counts them and calls each star by name  (Psalm 174:4), so the probability of aliens existing in our universe is much, much smaller!  :)

 

Posted via web from Herry's posterous

Time, and the meaning of respect.

0 comments

I came across this New York Times article which lists the top 100 things that waiters should never do.   Although most, if not everyone, will probably agree that they're pretty good etiquettes to follow, one of them stands out among the rest:

34. Do not have a personal conversation with another server within earshot of customers.

I had lunch at a diner one day, and the waitresss was having a loud, hearty conversation with another customer.   We were all sitting at the bar, so everyone within twenty-feet can hear what the conversation was about.    Now, the waitress was pretty busty, and although the man was married, he was talking to her the same way a teenage guy would talk to a cute girl among other male peers--- with a mission to impress and standout among the rest.   In a different, more upscale social setting, he'd probably be identifiable as the guy who drives a Bugatti with something to compensate.

But I digress.   These two were having their private conversation straight through my meal, and it annoyed me so much I left without leaving anything on the table.   Annoyed is actually putting it rather lightly.   Disrespect is a more accurate word.   Why is that?  What exactly, then, is the meaning of respect?

How does one 'respect' a person?   Is it done through verbal recognition, such as calling a man "sir" instead of "dude" ?   Does respect manifest in an action, like an employee sucking up to the boss through flattery and being agreeable all the time?   The dictionary defines 'respect' as "to hold in esteem or honor."  -- useless as usual, they just give you the runaround by stating similar words.   I can follow the dictionary's definition of "honor" and it will go back to "respect" which eventually tells me nothing about the real meaning.

Respect, is an acknowledgement and deference to one's existence.  How does one 'respect' a person?  Ironically, the most appropriate example of one giving respect is at a funeral when someone gives the dead person a moment of silence.    In more simpler terms, the measurement of respect is time.   Someone who is respectful of others is someone who knows how to shut their mouths and speak only at the appropriate time, which the waitress obviously had no clue about.

Are you following me?   A more real life example may make more sense.    I hate it when people talk to me while doing other things.   If you want to talk to me, stop whatever you're doing and give me 100% of your time and attention.    If you're talking to me and making a sandwich at the same time, it shows that your sandwich is just as important as I am, which is insulting because I'm definitely more important than a sandwich.   

So, do you respect your wife?   Turn off the TV when you speak to her and look at her eyes.  Do you respect your husband?  Have the same courtesy.

 

 

 

 

 

 

 

 

Posted via web from Herry's posterous

All-you-can-eat travel from JetBlue

0 comments
Fly anytime and however often you like on JetBlue with this all-you-can-eat month pass.

10% off PF Chang's

0 comments
Here.

I wonder if they're good.

A question of loneliness

0 comments
So, here's a story about a guy who decides to kill a bunch of women in a health club because he couldn't understand why women didn't like him. He hadn't slept with a woman for 19 years, and as he watched young couples in their 20s together every day, he felt desolation at the thought of living his life alone for the rest of his life. At the end of this desolation, he decided to kill himself, taking several others along with him. This is an extreme example of what a person might do once his loneliness consumes him, but for most people, loneliness occurs without them realizing it.

Loneliness happens when there's a lack of purpose in one's life, and as this void seeps into one's consciousness, it manifests itself into different symptoms-- for example, a deep feeling of boredom, an unexplainable desire for excitement, or something to do with friends (clubbing, dining, rafting, skydiving, or what have you). This social interaction masks and compensates for this void. That isn't to say that people who have friends are lonely, but rather, lonely people need friends because this social circle creates a sense of purpose and meaning in life. Afterall, what does the phrase, "have a life" mean? It is, in fact, referring to social life and the activities within. Friends, husbands, wives, dogs, cats, they're all included.

This sense of meaning goes deeper than one's driven purpose in life (i.e. why am I here?) as it fulfills its fundamental essence. In some of my evolutionary arguments, I often ask, "why do we have a face?" Did we "evolve" to have a face just because its convenient for our eyes to be right on top of our noses? No. This is why I'm a creationist, not an evolutionist. We have a face so it can be seen by others-- this is the purpose of one's face... i.e. a man exist not for himself, but so that others can see him.

Is it any surprise, then, that social networking like facebook, friendster, etc, on the internet have grown to the size that it has? These sites exist because people need them. They need them so they can tell their friends what they're doing, what they're feeling, what they're eating, what they're living. But why? Why do people need to broadcast to their friends what they're doing or whether they feel happy or sad? The answer is that they need to do this in order to validate their lives. For example, there is no point in winning the lottery if you're the only person that exists in this world.. If a tree falls in the forest and no one hears it, then the tree might as well have never existed.

Understanding this is the beginning to the wisdom of faith. A person in whom God lives, is never lonely, because he is never without purpose.


"If you belonged to the world, the world would love you as one of its own. But because you do not belong to the world and I have chosen you out of it, the world hates you." - John 15:19

A great VI tutorial - part 1

0 comments
It's hard to find really good content on the internet anymore as a lot of web sites are publishing whatever crap they can find to deliver advertisement in order to make a quick buck. A long time ago (waay back in 1996), I found a great VI tutorial that was indispensable reference material. I saved them on my hard drive, but I somehow lost it. Unbelievably, years later, I found them again. It's a 9-part tutorial that allows you to fully appreciate how powerful VI really is once you properly know how to use it. I thought I post them here for posterity so I don't lose them again. :)

Part 1: Vi Editor Fundamentals

By Walter Alan Zintz.



Why Vi?


A HEARTWARMING EDIT. Pity poor Hal, a corporate maintenance
programmer. A large module of badly- broken, poorly-patched
legacy code -- the spaghetti variety -- finally broke down
completely yesterday, leaving one corporate division running at
half speed. By dint of some inspired fixes during an all-nighter,
Hal has the module up and running again this morning...but just
as he's ready to go out for food that isn't from a vending
machine, in walks the corporation's VP of IS, with a big
surprise.


``Nice work on that crash fix, Hal; but right now I need some
formatted technical data about it, in a hurry. The Board of Directors'
Information Systems Committee has called a rush meeting this morning
to convince themselves they're on top of the problem. I'll be in
the hotseat, and I need technical data I can put up on the video
projector to keep them occupied.


``They'll want me to discuss the logfile of errors that led up
to the crash . . . yes, I know that's in /oltp/err/m7,
but appending puts the latest report lines at the bottom of the file.
Those suits aren't interested in what they think is ancient history,
and they wouldn't be caught reading anything but a commuter train
timetable from the bottom up,
so you'll have to make a copy with the order of the lines reversed:
what was the last line becomes the first line, what was the second
to the last line is now line number two, and so on.

``And let's take a look at that logfile.


374a12 44872 130295/074457 nonabort
5982d34 971 130295/221938 nonabort
853f7 2184 140295/102309 abort
...

Hmmm. Explaining the second column to them would be
advertising the fact that we knew this failure was just waiting
for a chance to happen. So while you're at it, go through and
erase all but the first and last digits of each number in column
two.


``Oh, and when they get tired of that they'll want to
scrutinize the Lint report. Last month I told them that our Lint
substitute was the greatest thing since Marilyn Monroe, so now
they'll want me to tell them why the messages it still generates
on this module aren't real hazards. Just run Lint over the
revamped module; then combine the Lint output with a copy of the
source file by taking each message line like:


Line 257: obsolete operator +=


and putting the significant part at the end of the source line it
refers to. And put a separator, like XXX, between
the source line and the message so I can page through quickly.
Nothing like a hefty dose of source code they can't begin to fathom
to make the meeting break up early.

``And get right on this. The meeting starts in 35 minutes.''



Our VP walks away inwardly smiling, thinking he's getting out
of detailed explanations and putting all the blame on an
underling, just by demanding more editing than anyone could do in
the time available. ``I'll tell the Information Systems
Committee that I made it perfectly clear to the programmer that
we needed this at 9:30, but when I asked him for it a minute ago
he said it wasn't finished and he wasn't sure when it would be.
Then I'll remark that those programmers just can't understand
that keeping management informed is every bit as important as
writing code!''

But Hal has a secret weapon against this squeeze play: an expert
knowledge of the Vi editor.

Reversing the order of the lines in a file is a piece of cake
with this editor. The eight keystrokes in:


:g/^/m0(ret)

will do it. Taking the digits out of the middle of the second column
throughout the file also requires just one command line:


:%s/^\([^ ]* [0-9]\)[0-9]*\([0-9] \)/\1\2(ret)

And integrating the Lint messages into a copy of the source
code? Even that can be automated with the Vi editor. The editor
command:


:%s/Line \([0-9][0-9]*\): \(.*\)/\1s;$; XXX \2(ret)

will turn that file of Lint messages into an editor script,
and running that script on a copy of the source file will mark it
up as requested.

Rather than being portrayed as a bungler, Hal can have it all
ready in a couple of minutes, just by typing a few lines. He'll
even have time to guard against vice-presidential prevarication,
by disappearing into the coffee shop across the street and
reappearing just as the meeting is getting started, to tell the
VP (and everyone else in earshot), ``Those files you wanted are
in slash-temp-slash-hal''.


THE PLAN OF THIS ONGOING TUTORIAL.

I'm writing here for editor users who have
some fluency in Vi/Ex at the surface level. That is, you know
how to do the ordinary things that are belabored in all the
``Introducing Vi'' books on the market, but rarely venture beyond
that level.

This tutorial series will explore a lot of other capabilities
that hardly anyone knows are in Vi/Ex. That includes quite a few
tricks that may be built on editor functions we all use every day,
but which nonetheless are not obvious -- for instance, telling the
global command to mark every line it encounters. I'll also be
clarifying the real nature of the many misunderstood aspects of
this editor.

To do all this, I'll be explaining things in more depth than
you might think warranted at first. I'll also throw in exercises
wherever they seem helpful. And to save you readers from gross
information overload, I'll write this tutorial in a large number
of fairly small modules, to be put up on our website at a calm,
reasonable pace.


The Editor's Basic Concepts

To get a real grasp on this editor's power, you need to know
the basic ideas embodied in it, and a few fundamental building
blocks that are used throughout its many functions.


One cause of editor misuse is that most users, even
experienced ones, don't really know what the editor is good at
and what it's not capable of. Here's a quick rundown on its
capabilities.


First, it's strictly a general-purpose editor. It doesn't
format the text; it doesn't have the handholding of a word
processor; it doesn't have built-in special facilities for
editing binaries, graphics, tables, outlines, or any programming
language except Lisp.


It's two editors in one. Visual mode is a better full-screen
editor than most, and it runs faster than those rivals that have
a larger bag of screen-editing commands. Line editing mode
dwarfs the ``global search and replace'' facilities found in word
processors and simple screen editors; its only rivals are
non-visual editors like Sed where you must know in advance exactly
what you want to do. But in the Vi/Ex editor, the two sides are
very closely linked, giving the editor a combination punch that
no other editor I've tried can rival.


Finally, this editor is at its best when used by people who
have taken the trouble to learn it thoroughly. It's too capable
to be learned well in an hour or two, and too idiosyncratic to be
mastered in a week, and yet the power really is in it, for the
few who care to delve into it. A large part of that power
requires custom-programming the editor: that's not easy or
straightforward, but what can be done by the skillful user goes
beyond the direct programmability of any editor except (possibly)
Emacs.


Search Patterns

In quite a few functions of this editor, you can use
string-pattern searching to say where something is to be done or
how far some effect is to extend. These search patterns are a
good example of an editor function that is very much in the Unix
style, but not exactly the same in detail as search patterns in
any other Unix utility.

Search patterns function in both line editing and visual
editing modes, and the work the same way in both, with just a few
exceptions. But how you tell the editor you're typing in a
search pattern will vary with the circumstances.


SEARCHING FROM WHERE YOU ARE NOW.

The more common use for search patterns is
to go to some new place in the file, or make some editing change
that will extend from your present position to the place the
pattern search finds. (In line editing mode it's also possible
to have an action take place from one pattern's location to where
another pattern is found, but both searches still start from your
present location.)

If you want to search forward in the file from your present
location (toward the end of the file), precede the search pattern
with a slash (/) character, and
type another to end the pattern. So if you want to move forward
to the next instance of the string ``j++'' in your file,
typing:


/j++/(ret)

will do it. And so will:


/j++(ret)

When there is nothing between the pattern and the RETURN key,
the RETURN itself will indicate the end of the search pattern, so
the second slash is not necessary. And if you are in visual
mode, the ESCAPE key works as well as RETURN does for ending
search input, so


/j++(esc)

is yet another way to make the same request from visual mode.

To search backward (toward the start of the
file)
, begin and end with a question mark instead of a slash.
The same rules of abbreviation apply to backward searches, so


?j++?(ret)
?j++(ret)
?j++(esc)

are all ways to head backward in the file to the same pattern.

Either way, you've expressed both your request for a pattern
search and the direction the search is to take in just one
keystroke. But don't assume that if you search backward, any
matching pattern the editor finds will be above your present
position in the file, and vice versa if you search forward. The
editor looks there first, certainly, but if it gets to the top or
bottom line of the file and hasn't found a match yet, it wraps
around to the other end of the file and continues the search in
the same direction. That is, if you used a question mark to
order a backward search and the editor searches all the way
through the top line of the file without finding a match, it will
go on to search the bottom line next, then the second-to-the-bottom
line, and so on until (if necessary) it gets back to the point
where the search started. Or if you were searching forward and
the editor found no match up through the very last line of the
file, it would next search the first line, then the second line,
etcetera.

If you don't want searches to go past either end of the file,
you'll need to type in a line mode command:


:set nowrapscan(ret)

This will disable the wraparound searching during the present
session in the editor. If you want to restore the wraparound
searching mechanism before you leave the editor, typing


:set wrapscan(ret)

will do it, and you can turn this on and off as often as you like.


THE FIND-THEM-ALL SEARCH.

Up to now, I've been considering searches
that find just one instance of the pattern; the one closest to
your current location in the file, in the direction you chose for
the search. But there is another style of search, used primarily
by certain line editing mode commands, such as
global and substitute. This search
finds every line in the file (or in a selected part of the file)
that contains the pattern and operates on them all.

Don't get confused when using the global and
substitute commands. You'll often use both styles of
search pattern in one command line. But the find-one-instance
pattern or patterns will go before the command name or abbreviation,
while the find-them-all pattern will come just behind it.
For example, in the command:


:?Chapter 10?,/The End/substitute/cat/dog/g(ret)

the first two patterns refer to the preceding line closest to
the current line that contains the string ``Chapter 10'' and the
closest following line containing the string ``The End''. Note
that each address finds only one line. Combined with the
intervening comma, they indicate that the substitute
command is to operate on those two lines and all the lines in
between them. But the patterns immediately after the
substitute command itself tell the command to find
every instance of the string ``cat'' withing that range of lines
and replace it with the string ``dog''.

Aside from the difference in meaning, the
two styles also have different standards for the delimiters that
mark pattern beginnings and (sometimes) endings. With a find-
them-all pattern, there's no need to indicate whether to search
forward or backward. Thus, you aren't limited to slash and
question mark as your pattern delimiters. Almost any punctuation
mark will do, because the editor takes note of the first
punctuation mark to appear after the command name, and regards it
as the delimiter in that instance. So


:?Chapter 10?,/The End/substitute;cat;dog;g(ret)
:?Chapter 10?,/The End/substitute+cat+dog+g(ret)
:?Chapter 10?,/The End/substitute{cat{dog{g(ret)

are all equivalent to the substitution command above. (It is
a good idea to avoid using punctuation characters that might have
a meaning in the command, such as an exclamation point, which
often appears as a switch at the end of a command name.)

The benefit of this liberty comes when
the slash mark will appear as itself in the search pattern. For
example, suppose our substitution command above was to find each
pair of consecutive slash marks in the text, and separate them
with a hyphen -- that is, change // to /-/.
Obviously,


:?Chapter 10?,/The End/substitute/////-//g(ret)

won't work; the command will only regard the first three slashes as
delimiters, and everything after that as extraneous characters at the
end of the command. This can be solved by backslashing:


:?Chapter 10?,/The End/substitute/\/\//\/-\//g(ret)

but this is even harder to type correctly than the first attempt was.
But with another punctuation mark as the separator


:?Chapter 10?,/The End/substitute;//;/-/;g(ret)

the typing is easy and the final command is readable.


SIMPLE SEARCH PATTERNS. The simplest search pattern is just a
string of characters you want the editor to find, exactly as
you've typed them in. For instance: ``the cat''. But, already
there are several caveats:



  1. This search finds a string of characters, which may or may not
    be words by themselves. That is, it may find its target in the middle
    of the phrase ``we fed the cat boiled chicken'', or in
    the middle of ``we sailed a lithe catamaran down the coast''.
    It's all a matter of which it encounters first.

  2. Whether the search calls ``The Cat'' a match or not depends
    on how you've set an editor variable named
    ignorecase. If you've left that variable in its
    default setting, the capitalized version will not match.
    If you want a capital letter to match its lower-case equivalent,
    and vice versa, type in the line mode command.

    :set ignorecase(ret)

    To resume letting caps match only caps and vice versa, type


    :set noignorecase(ret)

  3. The search absolutely will not find a match where ``the''
    occurs at the end of one line and ``cat'' is at the start of the
    next line:

    and with Michael's careful help, we prodded the
    cat back into its cage. Next afternoon several

    It makes no difference whether there is or isn't a space
    character between one of the words and the linebreak. Finding a
    pattern that may break across a line ending is a practically
    impossible task with this line-oriented editor.

  4. Where the search starts depends on which editor mode you're using.
    A search in visual mode starts with the character next to the cursor.
    In line mode, the search starts with the line adjacent to the current
    line.



METACHARACTERS. Then there are search metacharacters or ``wild cards'':
characters that represent something other than themselves in the
search. As an example, the metacharacters . and
* in


/Then .ed paid me $50*!/(ret)

could cause the pattern to match any of:


Then Ted paid me $5!
Then Red paid me $5000!
Then Ned paid me $50!

or a myriad of other strings. Metacharacters are what give
search patterns their real power, but they need to be well
understood.

To understand these, you must know the varied uses of the
backslash (\) metacharacter in turning the ``wild
card'' value of metacharacters on and off.

In many cases, the meta value of the metacharacter is on
whenever the character appears in a search pattern unless it is
preceded by a backslash; when the backslash is ahead of it the
meta value is turned off and the character simply represents
itself. As an example, the backslash is a metacharacter by
itself, even if it precedes a character that never has a meta
value. The only way to put an actual backslash in your search
pattern is to precede it with another backslash to remove its
meta value. That is, to search for the pattern ``a\b'', type


/a\\b/(ret)

as your search pattern. If you type


/a\b/(ret)

the backslash will be interpreted as a metacharacter without
any effect (since the letter b is never a metacharacter) and your
search pattern will find the string ``ab''.


Less-often-used metacharacters are used in exactly the
opposite way. This sort of character represents only itself when
it appears by itself. You must use a preceding backslash to turn
the meta value on. For example, in


/\<cat/

the left angle bracket (<) is a metacharacter; in


/<cat/

it only represents itself. These special metacharacters are
pointed out in the list below.

Finally there is a third class, the most difficult to keep
track of. Usually these metacharacters have their meta values on
in search patterns, and must be backslashed to make them
represent just themselves: like our first example, the backslash
character itself. But if you've changed the default value of an
editor variable named magic to turn it off, they work
oppositely -- you then must backslash them to turn their meta value
on: like our second example, the left angle bracket. (Not that
you are are likely to have any reason to turn magic
off.) These oddities are also noted in the list below.

And don't forget the punctuation
character
that starts and ends your search pattern, whether
it is slash or question mark or something else. Whatever it is,
if it is also to appear as a character in the pattern you are
searching for, you'll have to backslash it there to prevent the
editor thinking it is the end of the pattern.


TABLE OF SEARCH PATTERN METACHARACTERS


.

A period in a search pattern matches any single character,
whether a letter of the alphabet (upper or lower case), a digit,
a punctuation mark, in fact, any ASCII character except the
newline. So to find ``default value'' when it might be spelled
``default-value'' or ``default/value'' or ``default_value'',
etcetera, use /default.value/ as
your search pattern. When the editor variable magic
is turned off, you must backslash the period to give it its meta
value.

*

An asterisk, plus the character that precedes it, match any
length string (even zero length) of the character that precedes
the asterisk. So the search string
/ab*c/ would match ``ac'' or
``abc'' or ``abbc'' or ``abbbc'', and so on. (To find a string
with at least one ``b'' in it, use
/abb*c/ as your search string.)
When the asterisk follows another metacharacter, the two match
any length string of characters that the metacharacter matches.
That means that /a.*b/ will find
``a'' followed by ``b'' with anything (or nothing) between them.
When the editor variable magic is turned off, you must
backslash the asterisk to give it its meta value.

^

A circumflex as the first character in a search pattern means
that a match will be found only if the matching string occurs at
the start of a line of text. It doesn't represent any character
at the start of the line, of course, and a circumflex anywhere in
a search pattern except as the first character will have no meta
value. So /^cat/ will find
``cat'', but only at the start of a line, while
/cat^/ will find ``cat^'' anywhere
in a line.

$

A dollar sign as the last character in a search pattern means
the match must occur at the end of a line of text. Otherwise
it's the same as circumflex, above.

\<

At the start of a search pattern, a backslashed left-angle
bracket means the match can only occur at the start of a simple
word; at any other position in a search pattern it is not a
metacharacter. (In this editor, a ``simple'' word is either a
string of one or more alphanumeric character(s) or a string of
one or more non-alphanumeric, non-whitespace character(s), so
``shouldn't'' contains three simple words.) Thus
/\<cat/ will find the last three
characters in ``the cat'' or in ``tom-cat'', but not in
``tomcat''. To remove the meta value from the left angle bracket,
remove the preceding backslash:
/<cat/ will find ``<cat''
regardless of what precedes it.

\>

At the end of a search pattern, a backslashed right angle
bracket means the match can occur only at the end of a simple
word. Otherwise the same as the left angle bracket, above.

~

The tilde represents the last string you put into a line by
means of a line mode substitute command, regardless
of whether you were in line mode then or ran it from visual mode
by preceding it with a colon
(``:''). For instance, if your last
line mode substitution command was
s/dog/cat/ then a
/the ~/ search pattern will find
``the cat''. But the input string of a substitute
command can use metacharacters of its own, and if your last use
involved any of those metacharacters then a tilde in your search
pattern will give you either an error message or a match that is
not what you expected. When the editor variable magic
is turned off, you must backslash the tilde to give it its meta
value.



CHARACTER CLASSES. There is one metastring form (a
``multicharacter metacharacter'') used in search patterns. When
several characters are enclosed within a set of brackets
([]), the group matches any one
of the characters inside the brackets. That is,
/part [123]/ will match ``part 1'',
``part 2'' or ``part 3'', whichever the search comes to first.
One frequent use for this feature is in finding a string that may
or may not be capitalized, when the editor variable
ignorecase is turned off (as it is by default). Typing
/[Cc]at/ will find either ``Cat''
or ``cat'', and /[Cc][Aa][Tt]/ will
find those or ``CAT''. (In case there was a slip of the shift key
when ``CAT'' was typed in, the last pattern will even find
``CaT'', ``CAt'', etcetera.)

There's more power (and some complication) in another feature
of this metastring: there can be metacharacters inside it.
Inside the brackets, a circumflex as the first character reverses
the meaning. Now the metastring matches any one character that
is NOT within the brackets. A /^[^ ]/
search pattern finds a line that does not begin with a space character.
(You're so right if you think that the different meta values of the
circumflex inside and outside the character class brackets is not
one of the editor's best points.) A circumflex that is not the
first character inside the brackets represents just an actual
circumflex.

A hyphen can be a metacharacter within the brackets, too.
When it's between two characters, and the first of the two other
characters has a lower ASCII value than the second, it's as if
you'd typed in all of the characters in the ASCII
collating sequence from the first to the second one,
inclusive. So /[0-9]%/ will find
any numeral followed by the percent sign (%), just
as /[0123456789]%/ would. A
/[a-z]/ search pattern will match
any lower-case letter, and /[a-zA-Z]/
matches any letter, capital or lower case. These two internal
metacharacters can be combined: /[^A-Z]/
will find any character except a capital letter. A hyphen that
is either the first or the last character inside the brackets has
no meta value. When a character-hyphen-character string has a
first character with a higher ASCII value than the last
character, the hyphen and the two characters that surround it are
all ignored by the pattern search, so
/[ABz-a]/ is the same as
/[AB]/.

Backslashing character classes is complex. Within the
brackets you must backslash a right bracket that's part of the
class; otherwise the editor will mistake it for the bracket that
closes the class. Of course you must backslash a backslash that
you want to be part of the class, and you can backslash a
circumflex at the start or a hyphen between two characters if you
want them in the class literally and don't want to move them
elsewhere in the construct. Elsewhere in a search pattern you
will have to backslash a left bracket that you want to appear as
itself, or else the editor will take it as your attempt to begin
a character class. Finally, if magic is turned off,
you'll have to backslash a left bracket when you do want it to
begin a character class.

Integrating OpenVPN and Yubikey

1 comments
Integrating Yubikey into OpenVPN is pretty straightforward, first, you need to download the Yubico C client and PAM library. Then, add these three lines into /etc/openvpn/server.conf:

plugin /usr/lib/openvpn/openvpn-auth-pam.so openvpn
client-cert-not-required
username-as-common-name

The "openvpn" is the pam module filename located in /etc/pam.d. In client.ovpn, add this line:

user-auth-pass

Now, in /etc/pam.d, create a mapping file for your users. The format of the file is:

username:publicId


Where publicId is the first 12 ASCII characters of your OTP from the Yubikey. My mapping file is called yubimap. Now create /etc/pam.d/openvpn file containing the following line:


auth required /usr/local/lib/security/pam_yubico.so authfile=/etc/pam.d/yubimap id=16
@include common-auth
@include common-account
@include common-session
@include common-password

That's supposed to be it. However I ran into a problem where the PAM authentication spits out this error:


PAM [error: /lib/security/pam_yubico.so: undefined symbol: pam_set_data]
pam_authenticate FAILED for . Reason: Module is unknown


The solution for this is to modify the /etc/init.d/openvpn script and add to the beginning of the file:

export LD_PRELOAD=/lib/libpam.so.0.81.6


And that's all. The Yubikey is now required for OpenVPN authentication.

OpenVPN installation and gateway issues

0 comments
In setting up my OpenVPN so all traffic goes through the encrypted tunnel, an annoying error keeps coming up:

"Cannot read current default gateway from system"

It took me over an hour to figure out why: The server-bridge parameter should specify the gateway on your LAN instead of the OpenVPN server.

server-bridge 192.168.1.100 255.255.255.0 192.168.1.200 192.168.1.220

In this case 192.168.1.100 is the LAN gateway, not the OpenVPN server (say 192.168.1.50).

On the client side,

redirect-gateway def1
dhcp-option DNS 192.168.1.100


The "def1" in redirect-gateway causes the default route to use 128/0 netmask instead of 0/0 so your original default route isn't wiped out.

On the server side,

push "dhcp-option DOMAIN blah.com"


Pushing the domain to the client seems to cause problems with DNS lookups so that blah.com is used as the domain suffix. For example, looking up www.msnbc.com through nslookup ends up in www.msnbc.com.blah.com.

DNSmasq is running on my gateway, and for some reason pointing the DNS there (via "dhcp-option DNS") seems to avoid the problem. So, everything is working well so far, and now I can create an encrypted tunnel to my LAN whenever I'm mobile and not worry too much about someone snooping my wifi traffic.

Apart from the above issues, the OpenVPN installation and setup was pretty painless. I used JeOS (based on Ubuntu) as the operating system. Installation consists of:

  • Installing the OpenVPN package
  • Setting up the bridge interface
  • Generating the server certificate
  • Generating the client certificate
  • Creating the scripts to bring the bridge interfaces up and down.

All of the above steps are described in detail below in case the original Ubuntu page is down for some reason. Note that following the steps below results in split-tunneling-- i.e. your internet traffic does not go through the VPN.


Intro/Overview

Overview

OpenVPN is a Virtual Private Networking (VPN) solution provided in the Ubuntu Repositories. It is flexible, easy-to-use, reliable and secure. I'll walk you through setting up a Bridged VPN on Ubuntu 8.04 using x509 certs. Furthermore, I will walk you through general administration tasks.

What is a bridged VPN?

A bridged VPN allows the clients to appear as though they are on the same local area network (LAN) as the server system. The VPN accomplishes this by using a combination of virtual devices one called a bridge and the other called a tap device. A tap device acts as a virtual Ethernet adapter and the bridge device acts as a virtual hub. When you bridge a physical Ethernet device and a tap device, you are essential creating a hub between the physical network and the remote clients. Therefore, all LAN services are visible to the remote clients. My use case was creating a virtual lab for my companies Sale's Engineers so that it was possible to net boot remote embedded clients anywhere in the world.

Setting up the System

Setting up a bridged VPN solution is not hard. However, it does require that you understand how to use the Linux shell and the Linux networking stack.

This entire installation was performed using Ubuntu Jeos 8.04 in a KVM virtual machine but could just have easily been performed on Ubuntu Server. In my configuration eth0 is connected to the internet and eth1 is connected to the network that will be bridged. All of my comments in configuration files are proceeded by two pound signs (##).

Installing the Server

OpenVPN is installed by

sudo apt-get install openvpn bridge-utils

Setting up the Bridge

Now you need to edit /etc/network/interfaces

Commonly, you have a linux server behind a NAT firewall, and you want to provide access to a small network. Your /etc/network/interfaces probably looks something like

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo eth0
iface lo inet loopback

# The primary network interface
## This device provides internet access.
iface eth0 inet static
address 192.168.1.10
netmask 255.255.255.0
gateway 192.168.1.1

We're going to edit this and add a bridge interface. Go ahead and

sudo vi /etc/network/interfaces

After you're done editing it, it it should look approximately like below

## This is the network bridge declaration
auto lo br0 ## start on boot

iface lo inet loopback

iface br0 inet static
address 192.168.1.10
netmask 255.255.255.0
gateway 192.168.1.1
bridge_ports eth0

iface eth0 inet manual
up ifconfig $IFACE 0.0.0.0 up
up ip link set $IFACE promisc on
down ip link set $IFACE promisc off
down ifconfig $IFACE down

If you are running linux inside a virtual machine, you may want to add the following parameters to the bridge connection:

  bridge_fd 9      ## from the libvirt docs (forward delay time)
bridge_hello 2 ## from the libvirt docs (hello time)
bridge_maxage 12 ## from the libvirt docs (maximum message age)
bridge_stp off ## from the libvirt docs (spanning tree protocol)

to restart networking run

sudo /etc/init.d/networking restart

The bridging decelerations here come from the libvirt documentation. I really only understand the bridge_ports directive and the bridge_stp directive. Therefore if you know more than me help me out.

Generating Certificates

Next, we need to generate certificates for the server. In order to do this I will setup my own Certificate Authority using the provided easy-rsa scripts in the /usr/share/doc/openvpn/examples/easy-rsa/ directory. Another alternative is using the graphical program tinyca to create your CA.

Step 1:

  • Copy files to the /etc/openvpn/easy-rsa/ directory
    sudo mkdir /etc/openvpn/easy-rsa/
    sudo cp -R /usr/share/doc/openvpn/examples/easy-rsa/2.0/* /etc/openvpn/easy-rsa/

Step 2:

  • Edit /etc/openvpn/easy-rsa/vars
    sudo vi /etc/openvpn/easy-rsa/vars
    Change these lines at the bottom so that they reflect your new CA.
    export KEY_COUNTRY="US"
    export KEY_PROVINCE="CA"
    export KEY_CITY="SanFrancisco"
    export KEY_ORG="Fort-Funston"
    export KEY_EMAIL="me@myhost.mydomain"

Step 3:

  • Setup the CA and create your first server certificate
    cd /etc/openvpn/easy-rsa/ ## move to the easy-rsa directory
    sudo chown -R root:admin . ## make this directory writable by the system administrators
    sudo chmod g+w . ## make this directory writable by the system administrators
    source ./vars ## execute your new vars file
    ./clean-all ## Setup the easy-rsa directory (Deletes all keys)
    ./build-dh ## takes a while consider backgrounding
    ./pkitool --initca ## creates ca cert and key
    ./pkitool --server server ## creates a server cert and key
    cd keys
    openvpn --genkey --secret ta.key ## Build a TLS key
    sudo cp server.crt server.key ca.crt dh1024.pem ta.key ../../

Your Certificate Authority is now setup and the needed keys are in /etc/openvpn/

Configuring the Server

By default all servers specified in *.conf files in the /etc/openvpn/ directory are started on boot. Therefore, all we have to do is creating a new file named server.conf in the /etc/openvpn/ directory.

First, we're going to create a couple of new scripts to be used by the openvpn server.

sudo vi /etc/openvpn/up.sh

This script should contain the following

#!/bin/sh

BR=$1
DEV=$2
MTU=$3
/sbin/ifconfig $DEV mtu $MTU promisc up
/usr/sbin/brctl addif $BR $DEV

Now, we'll create a "down" script.

sudo vi /etc/openvpn/down.sh

It should contain the following.

#!/bin/sh

BR=$1
DEV=$2

/usr/sbin/brctl delif $BR $DEV
/sbin/ifconfig $DEV down

Now, make both scripts executable.

sudo chmod +x /etc/openvpn/up.sh /etc/openvpn/down.sh

And now on to configuring openvpn itself.

sudo vi /etc/openvpn/server.conf

mode server
tls-server

local ## ip/hostname of server
port 1194 ## default openvpn port
proto udp



#bridging directive
dev tap0 ## If you need multiple tap devices, add them here
up "/etc/openvpn/up.sh br0"
down "/etc/openvpn/down.sh br0"

persist-key
persist-tun

#certificates and encryption
ca ca.crt
cert server.crt
key server.key # This file should be kept secret
dh dh1024.pem
tls-auth ta.key 0 # This file is secret

cipher BF-CBC # Blowfish (default)
comp-lzo

#DHCP Information
ifconfig-pool-persist ipp.txt
server-bridge 192.168.1.10 255.255.255.0 192.168.1.100 192.168.1.110
push "dhcp-option DNS your.dns.ip.here"
push "dhcp-option DOMAIN yourdomain.com"
max-clients 10 ## set this to the max number of clients that should be connected at a time

#log and security
user nobody
group nogroup
keepalive 10 120
status openvpn-status.log
verb 3

Don't forget to either reboot or run the command below. This will restart openvpn and load the new config.

sudo /etc/init.d/openvpn restart

Getting Clients Connected

This section walks you through creating client certificate and key files, plus setting up a client configuration file. The files can then be used with OpenVPN on a client platform. The described configuration will work with OpenVPN installations of OpenVPN GUI for Windows and Tunnelblick for Mac OS X clients. For a detailed discussion of each, refer to their respective home pages. It should also be compatible with Linux OpenVPN clients.

Generating Client Certificate and Key

Generating certificates and keys for a client is very similar to the process used for generating server certificates. It is assumed that you have already set up the /etc/openvpn/easy-rsa/ directory and updated the /etc/openvpn/easy-rsa/vars file as described above. You should have already setup your Certificate Authority and created your server certificate and keys.

cd /etc/openvpn/easy-rsa/ ## move to the easy-rsa directory
source ./vars ## execute your vars file
./pkitool client ## create a cert and key named "client"

Configuring the Client

The client configuration has been adapted from the OpenVPN 2.0 sample configuration file. For Windows, the file should be named client.ovpn and for other operating systems, the file should be named client.conf. The file can be created using vi or other editor that can create plain text files.

The configuration file assumes that there is only one TUN/TAP device configured on the client.

### Client configuration file for OpenVPN

# Specify that this is a client
client

# Bridge device setting
dev tap

# Host name and port for the server (default port is 1194)
# note: replace with the correct values your server set up
remote your.server.example.com 1194

# Client does not need to bind to a specific local port
nobind


# Keep trying to resolve the host name of OpenVPN server.
## The windows GUI seems to dislike the following rule.
##You may need to comment it out.
resolv-retry infinite

# Preserve state across restarts
persist-key
persist-tun

# SSL/TLS parameters - files created previously
ca ca.crt
cert client.crt
key client.key

# Since we specified the tls-auth for server, we need it for the client
# note: 0 = server, 1 = client
tls-auth ta.key 1

# Specify same cipher as server
cipher BF-CBC

# Use compression
comp-lzo

# Log verbosity (to help if there are problems)
verb 3

Place the client.ovpn (or client.conf) configuration file along with the certificate and key files in the openvpn configuration directory on the client. With the above set up, the following files should be in the configuration directory.

client.ovpn
ca.crt
client.crt
client.key
ta.key

For OpenVPN GUI for Windows, the default location for the files is C:\Program Files\OpenVPN\config.

For Tunnelblick for Mac OS X, the default location for the files is ~username/Library/openvpn.

For further instructions, you may consult the official OpenVPN Howto