2012年6月20日 星期三

Git Immersion: 一步一步實作了解 git 的入門文件

Git Immersion - Brought to you by EdgeCase
http://gitimmersion.com/index.html

[中文版] Git Immersion - Brought to you by EdgeCase
http://gitimmersion-apputu.rhcloud.com/


新增翻譯文章 – git immersion | FAQ Book
http://blog.faq-book.com/?p=5095

2012年6月18日 星期一

David McCullough's Commencement Speech from Wellesley High School:“You’re not special”

You Are Not Special [中文字幕版] - YouTube


You Are Not Special Commencement Speech from Wellesley High School - YouTube


Wellesley High grads told: “You’re not special” | The Swellesley Report
http://www.theswellesleyreport.com/2012/06/wellesley-high-grads-told-youre-not-special/

Dr. Wong, Dr. Keough, Mrs. Novogroski, Ms. Curran, members of the board of education, family and friends of the graduates, ladies and gentlemen of the Wellesley High School class of 2012, for the privilege of speaking to you this afternoon, I am honored and grateful. Thank you.

So here we are… commencement… life’s great forward-looking ceremony. (And don’t say, “What about weddings?” Weddings are one-sided and insufficiently effective. Weddings are bride-centric pageantry. Other than conceding to a list of unreasonable demands, the groom just stands there. No stately, hey-everybody-look-at-me procession. No being given away. No identity-changing pronouncement. And can you imagine a television show dedicated to watching guys try on tuxedos? Their fathers sitting there misty-eyed with joy and disbelief, their brothers lurking in the corner muttering with envy. Left to men, weddings would be, after limits-testing procrastination, spontaneous, almost inadvertent… during halftime… on the way to the refrigerator. And then there’s the frequency of failure: statistics tell us half of you will get divorced. A winning percentage like that’ll get you last place in the American League East. The Baltimore Orioles do better than weddings.)

But this ceremony… commencement… a commencement works every time. From this day forward… truly… in sickness and in health, through financial fiascos, through midlife crises and passably attractive sales reps at trade shows in Cincinnati, through diminishing tolerance for annoyingness, through every difference, irreconcilable and otherwise, you will stay forever graduated from high school, you and your diploma as one, ‘til death do you part.

No, commencement is life’s great ceremonial beginning, with its own attendant and highly appropriate symbolism. Fitting, for example, for this auspicious rite of passage, is where we find ourselves this afternoon, the venue. Normally, I avoid clichés like the plague, wouldn’t touch them with a ten-foot pole, but here we are on a literal level playing field. That matters. That says something. And your ceremonial costume… shapeless, uniform, one-size-fits-all. Whether male or female, tall or short, scholar or slacker, spray-tanned prom queen or intergalactic X-Box assassin, each of you is dressed, you’ll notice, exactly the same. And your diploma… but for your name, exactly the same.

All of this is as it should be, because none of you is special.

You are not special. You are not exceptional.

Contrary to what your u9 soccer trophy suggests, your glowing seventh grade report card, despite every assurance of a certain corpulent purple dinosaur, that nice Mister Rogers and your batty Aunt Sylvia, no matter how often your maternal caped crusader has swooped in to save you… you’re nothing special.

Yes, you’ve been pampered, cosseted, doted upon, helmeted, bubble-wrapped. Yes, capable adults with other things to do have held you, kissed you, fed you, wiped your mouth, wiped your bottom, trained you, taught you, tutored you, coached you, listened to you, counseled you, encouraged you, consoled you and encouraged you again. You’ve been nudged, cajoled, wheedled and implored. You’ve been feted and fawned over and called sweetie pie. Yes, you have. And, certainly, we’ve been to your games, your plays, your recitals, your science fairs. Absolutely, smiles ignite when you walk into a room, and hundreds gasp with delight at your every tweet. Why, maybe you’ve even had your picture in the Townsman! And now you’ve conquered high school… and, indisputably, here we all have gathered for you, the pride and joy of this fine community, the first to emerge from that magnificent new building…

But do not get the idea you’re anything special. Because you’re not.

The empirical evidence is everywhere, numbers even an English teacher can’t ignore. Newton, Natick, Nee… I am allowed to say Needham, yes? …that has to be two thousand high school graduates right there, give or take, and that’s just the neighborhood Ns. Across the country no fewer than 3.2 million seniors are graduating about now from more than 37,000 high schools. That’s 37,000 valedictorians… 37,000 class presidents… 92,000 harmonizing altos… 340,000 swaggering jocks… 2,185,967 pairs of Uggs. But why limit ourselves to high school? After all, you’re leaving it. So think about this: even if you’re one in a million, on a planet of 6.8 billion that means there are nearly 7,000 people just like you. Imagine standing somewhere over there on Washington Street on Marathon Monday and watching sixty-eight hundred yous go running by. And consider for a moment the bigger picture: your planet, I’ll remind you, is not the center of its solar system, your solar system is not the center of its galaxy, your galaxy is not the center of the universe. In fact, astrophysicists assure us the universe has no center; therefore, you cannot be it. Neither can Donald Trump… which someone should tell him… although that hair is quite a phenomenon.

“But, Dave,” you cry, “Walt Whitman tells me I’m my own version of perfection! Epictetus tells me I have the spark of Zeus!” And I don’t disagree. So that makes 6.8 billion examples of perfection, 6.8 billion sparks of Zeus. You see, if everyone is special, then no one is. If everyone gets a trophy, trophies become meaningless. In our unspoken but not so subtle Darwinian competition with one another–which springs, I think, from our fear of our own insignificance, a subset of our dread of mortality — we have of late, we Americans, to our detriment, come to love accolades more than genuine achievement. We have come to see them as the point — and we’re happy to compromise standards, or ignore reality, if we suspect that’s the quickest way, or only way, to have something to put on the mantelpiece, something to pose with, crow about, something with which to leverage ourselves into a better spot on the social totem pole. No longer is it how you play the game, no longer is it even whether you win or lose, or learn or grow, or enjoy yourself doing it… Now it’s “So what does this get me?” As a consequence, we cheapen worthy endeavors, and building a Guatemalan medical clinic becomes more about the application to Bowdoin than the well-being of Guatemalans. It’s an epidemic — and in its way, not even dear old Wellesley High is immune… one of the best of the 37,000 nationwide, Wellesley High School… where good is no longer good enough, where a B is the new C, and the midlevel curriculum is called Advanced College Placement. And I hope you caught me when I said “one of the best.” I said “one of the best” so we can feel better about ourselves, so we can bask in a little easy distinction, however vague and unverifiable, and count ourselves among the elite, whoever they might be, and enjoy a perceived leg up on the perceived competition. But the phrase defies logic. By definition there can be only one best. You’re it or you’re not.

If you’ve learned anything in your years here I hope it’s that education should be for, rather than material advantage, the exhilaration of learning. You’ve learned, too, I hope, as Sophocles assured us, that wisdom is the chief element of happiness. (Second is ice cream… just an fyi) I also hope you’ve learned enough to recognize how little you know… how little you know now… at the moment… for today is just the beginning. It’s where you go from here that matters.

As you commence, then, and before you scatter to the winds, I urge you to do whatever you do for no reason other than you love it and believe in its importance. Don’t bother with work you don’t believe in any more than you would a spouse you’re not crazy about, lest you too find yourself on the wrong side of a Baltimore Orioles comparison. Resist the easy comforts of complacency, the specious glitter of materialism, the narcotic paralysis of self-satisfaction. Be worthy of your advantages. And read… read all the time… read as a matter of principle, as a matter of self-respect. Read as a nourishing staple of life. Develop and protect a moral sensibility and demonstrate the character to apply it. Dream big. Work hard. Think for yourself. Love everything you love, everyone you love, with all your might. And do so, please, with a sense of urgency, for every tick of the clock subtracts from fewer and fewer; and as surely as there are commencements there are cessations, and you’ll be in no condition to enjoy the ceremony attendant to that eventuality no matter how delightful the afternoon.
The fulfilling life, the distinctive life, the relevant life, is an achievement, not something that will fall into your lap because you’re a nice person or mommy ordered it from the caterer. You’ll note the founding fathers took pains to secure your inalienable right to life, liberty and the pursuit of happiness–quite an active verb, “pursuit”–which leaves, I should think, little time for lying around watching parrots rollerskate on Youtube. The first President Roosevelt, the old rough rider, advocated the strenuous life. Mr. Thoreau wanted to drive life into a corner, to live deep and suck out all the marrow. The poet Mary Oliver tells us to row, row into the swirl and roil. Locally, someone… I forget who… from time to time encourages young scholars to carpe the heck out of the diem. The point is the same: get busy, have at it. Don’t wait for inspiration or passion to find you. Get up, get out, explore, find it yourself, and grab hold with both hands. (Now, before you dash off and get your YOLO tattoo, let me point out the illogic of that trendy little expression–because you can and should live not merely once, but every day of your life. Rather than You Only Live Once, it should be You Live Only Once… but because YLOO doesn’t have the same ring, we shrug and decide it doesn’t matter.)

None of this day-seizing, though, this YLOOing, should be interpreted as license for self-indulgence. Like accolades ought to be, the fulfilled life is a consequence, a gratifying byproduct. It’s what happens when you’re thinking about more important things. Climb the mountain not to plant your flag, but to embrace the challenge, enjoy the air and behold the view. Climb it so you can see the world, not so the world can see you. Go to Paris to be in Paris, not to cross it off your list and congratulate yourself for being worldly. Exercise free will and creative, independent thought not for the satisfactions they will bring you, but for the good they will do others, the rest of the 6.8 billion–and those who will follow them. And then you too will discover the great and curious truth of the human experience is that selflessness is the best thing you can do for yourself. The sweetest joys of life, then, come only with the recognition that you’re not special.

Because everyone is.

Congratulations. Good luck. Make for yourselves, please, for your sake and for ours, extraordinary lives.

2012年6月15日 星期五

[Ubuntu] show directory/file name mixed with Japanese and Chinese correctly in Terminal

I have a samba server sharing a disk with directories/files name mixed with Japanese and Chinese. My Ubuntu 10.04 which mount the disk just show a bunch of "???" or other mystic characters.



The option "iocharset" given to "mount" plays a critical role to have folder/file name display correctly.
"iocharset=cp950" with "LANG=zh_TW.big5".
"iocharset=cp932" with "LANG=ja_JP.shiftjis"
"iocharset=utf8" with "LANG=zh_TW.utf8" and "LANG=en_US.utf8" (I guess all XXX.utf8 would work)
UTF8 is most suggested to be used.

To Install a new locale:
$ sudo ./install-language-pack EUC-JP
$ sudo locale-gen ja_JP.EUC-JP
Generating locales...
ja_JP.EUC-JP... done
Generation complete.
$ locale -a
(.......)
en_ZW.utf8
ja_JP.eucjp
ja_JP.utf8
tt_RU
(.......)

Configure the Terminal
After the locale is installed/configured properly, you need to change the Terminal's default locale:
LANG=ja_JP.utf8
or
LANG=ja_JP.eucjp
(Just temporarily, or make the changes to /etc/environment for permanent change)
And the Character Encoding:
[Terminal] -> [Set Character Encoding] -> [Japenease (EUC-JP)] or the one that match the LANG setting.


commands:
locale -a
locale-gen
/usr/share/locales/install-language-pack

files:
/var/lib/locales/supported.d/local
/etc/environment
/etc/default/locale
/usr/share/i18n/SUPPORTED



LocaleConf - Community Ubuntu Documentation
https://help.ubuntu.com/community/LocaleConf
For Anti-UTF-8 people
https://help.ubuntu.com/community/LocaleConf#For_Anti-UTF-8_people
See the first column of the file /usr/share/i18n/SUPPORTED and identify your language codes, example: en_US es_VE pt_BR es_ES. Note that the second column shows the encoding to be used with that language code and remember that we don't want UTF-8 as encoding.

After you know which language codes you will use, go to the terminal and type the following:

$ sudo locale-gen LANG1 LANG2 LANG3 ...

Where LANG1, LANG2, ... are the language code you selected. As an example, a user in Venezuela may want:

$ sudo locale-gen es_VE en_US

After that, you should reboot your computer.


Running the Platform in another language - Pentaho Engineering - Pentaho Wiki
http://wiki.pentaho.com/display/PEOpen/Running+the+Platform+in+another+language
Instructions for setting up Japanese Shift_JIS charset on Ubuntu Linux:

1. Install the language pack:
$ sudo apt-get install language-pack-gnome-ja language-pack-ja
2. List the currently installed locale's
$ locale -a
3. We need to add the following to /var/lib/locales/supported.d/local
ja_JP.SHIFT_JIS SHIFT_JIS
4. List the available charsets
$ locale -m
You should see SHIFT_JIS in the list
5. Compile the ja_JP.shiftjis locale
$ sudo localedef -f SHIFT_JIS -i ja_JP ja_JP.Shift_JIS
6. List the currently installed locales to see if our new one is now available
$ locale -a


Ubuntuでlocaleを設定する。 - redtower's memo
http://redtower.plala.jp/2010/06/06/ubuntu-locale.html

HOWTO: Install a new locale (language pack) - Ubuntu Forums
http://ubuntuforums.org/showthread.php?t=196414

2012年6月14日 星期四

[Ubuntu] Change the default and supported locale

locale - Yu-Teh Wiki
http://ytshen.wikidot.com/locale
sudo vim /etc/default/locale

LANG="en_US"
LANGUAGE="en_US:en"
locale -a
sudo vim /var/lib/locales/supported.d/locale
zh_TW.UTF-8 UTF-8
en_US.UTF-8 UTF-8
sudo locale-gen
echo "LANG=en_US.utf-8" » /etc/environment
echo "LC_ALL=en_US.utf-8" » /etc/environment




Building buildroot/uClibc might failed due to host locale setting.

[Buildroot] problem with locale
http://lists.busybox.net/pipermail/buildroot/2009-October/029503.html

2012年6月13日 星期三

OpenRelief

OpenRelief Project
http://openrelief.org/index.html

Introducing OpenRelief - YouTube


What Is OpenRelief?
http://openrelief.org/what-is-openrelief.pdf

Understanding The Technology Behind OpenRelief
http://openrelief.org/understanding-openrelief.pdf

OpenRelief - Gitorious
http://www.gitorious.org/OpenRelief

Profile | SolderPad
http://www.solderpad.com/OpenRelief

2012年6月8日 星期五

Linux ESN window size

static struct xfrm_link xfrm_dispatch[XFRM_NR_MSGTYPES]
xfrm_add_sa(struct nlattr **attrs)
xfrm_state_construct
rta= attrs[XFRMA_REPLAY_ESN_VAL]
xfrm_alloc_replay_state_esn(struct nlattr *rta)
nla_data(rta);
return (char *) nla + NLA_HDRLEN;
xfrm_replay_state_esn_len


x.replay_esn
struct xfrm_state
struct xfrm_replay_state_esn *replay_esn;
replay_window
bmp[]
bmp_len
x->props.replay_window = sa->sadb_sa_replay;


static pfkey_handler pfkey_funcs[SADB_MAX + 1]
pfkey_add
pfkey_msg2xfrm_state or xfrm_state_clone(CONFIG_XFRM_MIGRATE)
xfrm_init_state
__xfrm_init_state
xfrm_init_replay




[strongSwan] anti-replay window size?
https://lists.strongswan.org/pipermail/users/2009-August/003748.html

currently the kernel interface method add_sa() of the IKEv2 daemon
sets the replay window size to a constant value of 32:

(.......)

whereas in the kernel interface method netlink_add_sa() of the IKEv1
daemon the size is configurable:

(.......)

but in kernel.c where netlink_add_sa() is called, the value is set
invariably to 32,

Strongswan also limits the maximum window size to 64 in pfkey_prop_parse().


IPSec Anti-Replay Window: Expanding and Disabling - Cisco Systems
http://www.cisco.com/en/US/docs/ios/12_3t/12_3t14/feature/guide/gt_iarwe.html
IPsec Anti-Replay Window

Cisco IPsec authentication provides anti-replay protection against an attacker duplicating encrypted packets by assigning a unique sequence number to each encrypted packet. (Security association [SA] anti-replay is a security service in which the receiver can reject old or duplicate packets to protect itself against replay attacks.) The decryptor checks off the sequence numbers that it has seen before. The encryptor assigns sequence numbers in an increasing order. The decryptor remembers the value X of the highest sequence number that it has already seen. N is the window size, and the decryptor also remembers whether it has seen packets having sequence numbers from X-N+1 through X. Any packet with the sequence number X-N is discarded. Currently, N is set at 64, so only 64 packets can be tracked by the decryptor.

At times, however, the 64-packet window size is not sufficient. For example, Cisco quality of service (QoS) gives priority to high-priority packets, which could cause some low-priority packets to be discarded even though they could be one of the last 64 packets received by the decryptor. The IPsec Anti-Replay Window: Expanding and Disabling feature allows you to expand the window size, allowing the decryptor to keep track of more than 64 packets.

Increasing the anti-replay window size has no impact on throughput and security. The impact on memory is insignificant because only an extra 128 bytes per incoming IPsec SA is needed to store the sequence number on the decryptor. It is recommended that you use the full 1024 window size to eliminate any future anti-replay problems.

2012年6月5日 星期二

Girl with a funny talent.

Girl with a funny talent. [original video]


Hi Everyone, Follow up Video.

Doodling in Math: Spirals, Fibonacci, and Being a Plant

Doodling in Math: Spirals, Fibonacci, and Being a Plant [1 of 3] - YouTube


Doodling in Math Class: Spirals, Fibonacci, and Being a Plant [2 of 3]


Doodling in Math: Spirals, Fibonacci, and Being a Plant [Part 3 of 3]


How To Find the Lucas Angle

2012年6月1日 星期五

GIT: Push to remote branch of remote repo

Push to remote branch of remote repo

git push <remote_name> +<br_name>:refs/remotes/<my_name>/<br_name>

I suddenly realize this is a convenient command to push updates to each working copy, which may have the same branch name checkout. Git wont allow you to push to a checkout branch. This prevent that from happening.

Make an alias for this:
[alias]
rpush = !sh -c 'git push $1 +HEAD:refs/remotes/$2/$3' -
Then you can do:
git rpush <remote_name> <my_name> <br_name>




Aliases - Git SCM Wiki
https://git.wiki.kernel.org/index.php/Aliases#Advanced_aliases_with_arguments