Weekly Dalai Lama Teaching

Knowing one's limitations
If a boss gives more work to do and it is beyond their capacity, then I think they have to say something. They have to say 'This is too much work for me' and talk to the boss and try to reduce it. If that doesn't work, then they may need to look for new work.

"However, at that point let's say that the boss agrees to extra pay, and the employee agrees, then that is a person's decision and there's no cause to complain about overload. But if the boss gives too much work without increase of salary, then this 'over-load' is just exploitation.

The Art of Happiness at Work - Dalai Lama

Saturday, May 31, 2008

Mounting smb drive in Ubuntu with chinese char

sudo mount //192.168.1.2/torrent$ /home/pete/emule -o username=pete****,password=********,iocharset=utf8,codepage=unicode,unicode

Thursday, May 15, 2008

IP Routing and MAC address

http://groups.google.ca/group/comp.dcom.sys.cisco/msg/1b8aac0039384ff5
================================================================================
:In basic TCP/IP, if a packet is NOT destined for a host on the local
:subnet, it will then send the packet to the default gateway. Here is my
:question, when the host's deems the packet to need routing, what exactly
:does it do to with the packet when it is sent to the router ?

:Does it encapsulate it in a 'routing' packet (for lack of a better term),
:then send it to the router ?

No.

:When the router receives it, does it strip
:the 'routing' packet info, examine it, and then transmit it out onto the
:LAN ?

Not applicable because no such encapsulation is occuring.

:If the router has to send it to another gateway, does it then re-
:encapsulate it in another 'routing' packet ?

No.

When a device (host or router) determines that a packet is not destined
locally, it looks through it's routing tables to find the IP of the
next hop device. The next-hop IP that it finds from this lookup should
be one that the first device does NOT have to be route to (e.g., the
next hop IP is in an IP address range served by one of the interfaces
of the first device.)

The sending device then looks in its ARP tables for that next-hop IP to
see if it knows the MAC address of the next-hop IP: there might be
a static entry for it in the table, or it might recently have looked
it up and still remember what the MAC was. If the sending device does
not know the next-hop IP's MAC address, then the sending device sends
out a broadcast ARP packet with the destination IP filled in; all
devices that receive that ARP packet look into the packet to see if their
IP is there, and the one whose IP it is sends back an ARP reply
containing the MAC address. If the sending device did indeed have to
ARP the IP to locate the MAC address, then the sending device could
buffer the original packet until it gets a reply, or the sending device
could instead drop the original packet: if the protocol was one
that offers reliable transportation (such as TCP) then the original
sender will retransmit the packet, and if the protocol protocol was
not one that offers reliable transportation (such as UDP), then the
router is just exercising the unreliability part of the transport ;-)

So now we're in the state where the sending device knows the next-hop
IP and the MAC address of that next hop. It then takes the packet that
it was working with, and rewrites the destination MAC to be the MAC
of the next hop, and rewrites the source MAC to be it's own MAC address.
It fixes up the checksums on the packet, and dispatches the packet out
the appropriate interface. It does NOT re-write the destination IP!

Now, when you are working with TCP/IP all the time, it's easy to get
into the habit of thinking that devices pay attention to packets that
have their IP address as the destination, but that's really not how
ethernet works. Instead, devices pay attention only to packets which
contain their MAC address as the destination MAC, or else contain
one of the special broadcast or multicast MAC addresses. Thus, the
next-hop device will receive the packet not based upon the IP address
(which might be somewhere on the other side of the world), but based
upon the fact that the sender found the specific MAC address to send
to on the local segment at the level -below- IP addresses. Therefore
when the next-hop device receives the packet, the destination IP
in the packet will still be the ultimate destination IP, not the IP
of the router.

The next-hop device then goes through the whole routing table lookup
sequence, finding the next hop IP to send the packet to, finding the
MAC address of that next hop IP, rewriting the source and destination
MACs, fixing the checksum, and sending on to the next hop.

It all works through a chain of routing devices, each one of which
might not know how to directly reach the destination, but knows
which device that it can talk to directly that it can send the packet
to in order to get the packet further towards it's IP destination.

The reason the source MAC is re-written as well as the destination
MAC is so that the next-hop device knows how to directly send back
replies [such as ICMP Unreachable] without having to go through
the routing table to figure out how to reply.

Further to this: anytime a device needs to reply to a packet for any
reason (e.g., it might be part of a TCP stream that is carrying FTP
traffic and it needs to respond with an ACK), then the device creating
the reply can in theory just blindly copy out the source IP and source
MAC from the packet it is replying to, put those in the destination IP
and destination MAC fields, copy out the destination IP and destination
MAC from the packet it is replying to, put those in the source IP and
source MAC fields, add the data it wants, and then just dispatch the
reply packet *without going through the routing procedure* (as long as
it knows which interface to use.)

Taking this one step further: if you have communication over a local
loop with no routing involved, then the -only- time any IP needs to
be paid attention to is for the very first routing decision that
located the MAC of the destination machine. After that, in theory
the entire rest of the connection could work entirely at the MAC
layer with nonsense IPs (or stealth data transfer ;-0) in the packet
headers. MACs are important for getting traffic where it is really
supposed to go, and the IP is only used to find out what the next
MAC along the line should be. [In practice, unix-type machines
often -do- go through routing for each packet, as the unix networking
control structures usually do not keep track of the interface,
and because routing can change dynamically in the middle of a connection,
and because you don't necessarily want the reply packets to go out
the same interface that the original packets came in.]
--
Beware of bugs in the above code; I have only proved it correct,
not tried it. -- Donald Knuth

Thursday, May 8, 2008

Detox the mind

Excerpt from the book Boundless Healing: Meditation Exercises to Enlighten the Mind and Heal the Body
by Tulku Thondup

http://healing.about.com/od/meditation/a/tthondup.htm

TO FIND TRUE WELL-BEING, the best place to look is close to home. We could travel around the globe a hundred times, turning over every stone on earth in the quest for happiness. Yet this would not necessarily give us what we seek. Money does not necessarily grant well-being either, nor does a youthful or healthy body. Health and money can help us, of course. But the real source of peace and joy is our minds.

The mind wants to be peaceful; this is really its natural state.
But there are so many distractions and cravings that can obscure our peaceful nature. A characteristic of our time is the speed of our daily lives, especially in the West. Everything is a rush. Meditation can slow us down so that we touch our true nature. Any meditation can help us. The object of our contemplation could be a flower, a religious image, or a positive feeling. Or it could be our own bodies.

One especially rich way to develop a peaceful mind is to meditate upon the body. By doing this, we promote the welfare of our whole being.

Through meditation, we can learn how to encourage our minds to create a feeling of peace in the body. This can be as simple as relaxing and saying to ourselves, "Let my body be calm and peaceful now," and really feeling that this is happening. It is the beginning of meditation -- and of wisdom, too.

This approach is a kind of homecoming. We are reintroducing ourselves to our bodies and establishing a positive connection between mind and body. Quite often, we have a rather strained and distant relationship to our own bodies. We think of the body as unattractive or ugly, or maybe our health is poor. Or else we like the body, cherish it, and foster cravings around it. But even if we cherish the body, we worry that it could be better than it is or that it will get sick or grow old. So we are conflicted and ambivalent. The body is an object of anxiety.

The meditations in this book will help us approach the body with a realistic attitude, accepting it as it is. Then we will practice how to see the body as very peaceful, a body filled with light and warmth. So many mental and physical afflictions are associated with the body, and meditation can help to heat them.

Mind and body are intimately connected, and the relationship of mind to body in meditation is very interesting. When we see the body as peaceful and beautiful, who or what is creating these feelings? The mind is. By creating peaceful feelings in the body, the mind is absorbed in those feelings. So although the body is the object to be healed, it also becomes the means of healing the mind -- which is the ultimate goal of meditation.

When our minds are peaceful in meditation, there is no other mind. Even if the peaceful feeling goes away, we are developing the habit of a peaceful mind. Our minds are becoming accustomed to their true nature. Really, it all comes back to the mind. This is where our true happiness is. The Buddha said:

Mind is the main factor and forerunner of all actions:
Whoever acts or speaks
With a pure thought
Will enjoy happiness as the result.

Like a physician treating a patient, Buddhism deals with mental, emotional, and physical afflictions by diagnosing the cause and treating it.

In this world of ceaseless change, the mind tends to develop a grasping quality and gets attached to all kinds of illusory wants and desires. This is at the root of our suffering. We heal ourselves to the extent that we can release that grasping.

As it was first practiced in the ninth century, Tibetan medicine viewed the body as composed of four elements -- namely, earth, water, fire, and air -- and as having hot and cold temperatures. Western medicine has given us a wonderfully detailed and up-to-date knowledge of the body and how it works, and we can take advantage of this. Yet even today, the ancient Tibetan picture of the body is very useful, both as an aid to meditation and as a way to understand the various qualities of the mind.

According to this view, when the four elements are in balance, we are in our natural healthy state, but when there is disharmony, emotional or physical disease can take root and flourish. The third Dodrupchen writes:

"The ancient masters said that if you do not foster dislike and unhappy thoughts, your mind will not be in turmoil. If your mind is not in turmoil, the air [or energy of your body] will not be disturbed. If the air is not disturbed, other physical elements of your body will not experience disharmony. Harmonious elements [in turn] will help the mind stay free from turmoil. Then the wheel of joy will keep revolving."

The mind is the source of true well-being. So before we get to the guided meditations upon the body later on, we would do well to consider the qualities of the mind and how we can improve our lives.