Author: truongan

  • Birthday – a view of mine.

    The fact that it's easier to write in Vietnamese also make it harder to write on some specific topic. Like some emotional situations that are said to not be able to express in words? It's because people know too many words in their mother tongue that it's difficult to pick out the closest resemblant for their mind. With foreign language, that problem's solved. Even though the word you choose is not the best one, it is the closest you know, and you don't hesitate to use it because you don't know that it may not be suitable. Ignorance's some time a form of sincere – especially when you can blame that sincere to be an error based on incompetent language skill. Therefore I will wrote this entry in English, then translate it later.

    Birthday! It's a time to celebrate, to throw party(ies) to get present and… to spend money. Well, but it's not always the case! My family doesn't celebrate birthday party, perhaps it's family tradition. When my mod and dad was just little kid, their family were too poor for birthday party. They even did not know what birthday party is, because my grandparents didn't tell them. Why? Because my grandparents as well was too poor for birthday party.

    Now perhaps your are thinking of some poor orphaned kids on TV or movie that don't even know what birthday means. Well that's not my parents' case. They will eventually know what birthday mean when they go to school and the other kids will sure mentioned about birthday party. They would knew but wouldn't have much time to think about it. They had to take care of their little brother and sister, they had to do the housework, they knew they would never get invited because don't play along with those rich kids. Life didn't leave them much time to jealous.

    And so the grew up, two birthday-(party)-less people, they came to each other and they had me. I remember they first time I'm aware of birthday celebration. It's when I was invited to a birthday party in the neighborhood. Well, in fact, I was invited earlier but I was too little to remember and get a hold on what had happened. Later, My parents show me pictures and tell me that I even tried to take the toy from the party host! What an embarrassment, I was lucky not be able to remember it. The first time I'm able to aware that I'm invited was a little bit confusing! I didn't understand the custom. What the hell is that party? If it's to celebrate the date you was born, why didn't my parents have it? And the cake and candle stuffs and the present stuffs, all seem so strange.

    Let's take a look more carefully at my situation: I remembered asking my parents for toys, but most of the time they will try to make me forget that demands. They will delay it, use "busy" as an excuse – in my father's way of demand evading, or in my mother's – she let me know the price of that toy by convert it into the number of snack I can get, the number of meat it took to make my favorite meal, the number of days she have to work to afford it. And if the toy cost too much, it will be denied flatly, no bargain! Therefore I seldom asked for toys, it's useless to ask for something that's so hard to get and will break anyway. But the time I was invited to a birthday party, my mother came home from the market with a marvelous toy car that can run on itself I was strikingly filled with SURPRISE!! I didn't dare to ask for this toy, why did she bought it – I keep wondering but didn't ask her right away. Eventually she let me know that the car is a birthday present that I will give to my friend in his birthday party.

    The selfish child in me was shock! Why did I have to give him this toy car? I had never got such great thing from my mother, why do I have to give it away? What is a birthday? What is so special about it that I have to give away something I have never dare to ask for?

    when they asked me whether I like a birthday party. I said no, because I don't know what to do with a birthday party

  • pulseaudio in gentoo

    You have to emerge alsa-plugins with pulseaudio USE flags. Otherwise alsa won't be able to talk with pulseaudio and will seize the sound devices instead.

    You also need a file /etc/asound.conf with the following content:

    pcm.pulse { 
         type pulse 
     } 
    
     ctl.pulse { 
         type pulse 
     } 
    
    
     pcm.!default { 
         type pulse 
     } 
     ctl.!default { 
         type pulse 
     }
    

    This file force alsa to use pulse instead of seizing the sound device for itself and its subordinate.

  • Gnome 3, move window’s close button and change toolbar style

    To Move windows' close button to the left:
    Use gconf-editor change key: desktop>gnome>shell>windows

    To change toolbar style:
    Use dconf-editor change key toolbar_style in org.gnome.desktop.interface

    To change mouse cursor theme:
    Use gconf-edigor to change key: /desktop/gnome/peripherals/mouse/cursor_theme
    Every other workaround simply won't work, event changing the file /usr/share/icons/default/index.theme won't work.

  • Destiny of a tech guy.

    I read PCWorld Vietnam this morning, one of a few IT – magazines in this country that seem somewhat serious about its content and don't rush for the script kiddie stuff. This month's issue features two article about three tragedy loss of the IT world this year. Steve Jobs' works were highlighted in an 8 pages long article with lots of pictures while John McCarthy and Dennis Ritchie was put together in an 2 pages only article with two faces (of them) in it, We must admit that two pages was much nicer than what other magazine would give them but that was it, only two pages.

    I put an status on facebook and an – so called – iFan said that I would not understand because I don't use iProduct. Then it strike me, what we, future engineer and scientist of this country, was destined to?

    We who committed this techy path is following the footstep of McCarthy and Ritchie, let's be known that may be not a single one of us will ever be able to accomplish as great a job as what they did. But even if we will we was destined to be poorer than Bill and Steve, to be inferior as a public figure, to be less missed when we pass away. Be sad as much as you want, but that was what destiny await us and we can't change that. For Steve to be able to bring iPhone to the world, many engineers spent many sleepless night working hard. I doubt any iFan could remember the name of any of those engineers.

    The destiny is settled, but what we can change is our attitude. Let us all aware that we are the one who made the whole things possible. Unix set the standard for modern operating system and almost every operating system was written in C or its variants. Without McCarthy and Ritchie there will be no Windows, no MacOS, no iOS, no linux, no android, no anything. They are great man and they will be missed, at least among the rank of engineer and scientist they will be missed.

    There are great heroes, but the greatest hero is the one who doesn't have our recognition.

  • 2011-09-23

    Đêm thì vắng, code thì khó, người rảnh rỗi, sinh nông nổi, viết lôi thôi.

    Ngoại ơi!
    Hôm giỗ ngoại con có về! Khách khứa đông lắm ngoại, nhưng mà chắc ngoại ở trên kia cũng thấy rồi. Có điều giỗ này không thoải mái như mấy giỗ xưa, tới khi cúng xong con mới về, khách khứa vào mâm, người nhà thì bận rộn, con đứng giữa nhà mà thấy mình sao xa lạ lắm ngoại.
    Trời mưa rồi, hôm đám giỗ ngoại cũng mưa, mưa rỉ rả suốt cả ngày dài, buồn não ruột. Hôm đó con Bòn em kêu con chỉ nó làm tập làm văn, đề là viết thư cho ông bà, con tính viết luôn thư cho ngoại để nó làm mẫu luôn, không hiểu sao lúc đó nhiều cảm nghĩ nhưng lại chẳng viết được gì. Tới hôm nay mới đặt phím gõ được mấy dòng này, đúng là làm cái gì chỉ để khoe mẽ với người khác thì khó mà thành được ha ngoại.
    Mẹ được 30 năm tuổi Đảng rồi ngoại, có huy hiệu với một lẵng hoa to tướng. Tiếc là không được ra Hà Nội, tổ chức gấp gáp quá mẹ không sắp xếp kịp, vướng anh Hai :(. Con nhìn không thấy mẹ buồn nhưng chắc là mẹ tiếc lắm, đời người có một lần 30 năm tuổi Đảng thôi chứ mấy. Con cũng thấy tiếc, nhưng sâu trong tâm con có một chút mừng vì không phải vắng mẹ mất 1 tuần, có vẻ con vẫn còn ích kỷ quá.
    Ngoại bao nhiêu tuổi Đảng rồi ngoại nhỉ? Nhớ hồi ngoại được huy hiệu 50 năm tuổi Đảng, ngoại kể với mẹ, mẹ mừng ra mặt, nhưng sao lần đó con không nhớ là có thấy ngoại vui? Ngoại với mẹ nói chuyện gì đó xa lạ lắm con chẳng nhớ nỗi là chuyện gì, cũng chẳng nhớ nỗi chính xác là năm nào nữa và con cũng không nhớ là bắt gặp ngoại cười trong lần đó! Trí nhớ con kém quá hay hồi đó con nhìn nét mặt người khác còn kém quá hay thật sự khi số tuổi Đảng đã quá cao người ta không còn mừng vui với những điều ấy nữa?
    Bây giờ con tốt nghiệp rồi ngoại, chưa chính thức nhưng cũng bảo vệ xong rồi. Chuyện Đảng chuyện đời chắc con cũng không còn ngây thơ như trước, không biết bây giờ nếu con hỏi ngoại về dịp 50 năm tuổi Đảng trước đây không biết ngoại sẽ nói những gì? Ngày xưa con chẳng bao giờ hỏi ngoại chuyện ấy, cũng chẳng nghĩ tới việc sẽ hỏi, mà thực ra ngày xưa con cũng chẳng dám hỏi ngoại chuyện gì. Bây giờ muốn hỏi thì… trễ 3 năm rồi ngoại nhỉ 🙁

  • Download a whole site (mirroring) with wget

    Pretty neat trick:

    Downloading an Entire Web Site with wget
    Sep 05, 2008 By Dashamir Hoxha
    in

    HOW-TOs

    If you ever need to download an entire Web site, perhaps for off-line viewing, wget can do the
    job—for example:

    $ wget \
         --recursive \
         --no-clobber \
         --page-requisites \
         --html-extension \
         --convert-links \
         --restrict-file-names=windows \
         --domains website.org \
         --no-parent \
             www.website.org/tutorials/html/

    This command downloads the Web site www.website.org/tutorials/html/.

    The options are:

    –recursive: download the entire Web site.

    –domains website.org: don't follow links outside website.org.

    –no-parent: don't follow links outside the directory tutorials/html/.

    –page-requisites: get all the elements that compose the page (images, CSS and so on).

    –html-extension: save files with the .html extension.

    –convert-links: convert links so that they work locally, off-line.

    –restrict-file-names=windows: modify filenames so that they will work in Windows as well.

    –no-clobber: don't overwrite any existing files (used in case the download is interrupted and
    resumed).

    Some times we will have to add

    -e robots=off

  • Chỉnh address book google tạo bằng online account trong gnome 3.2 làm treo evolution

    Có thể tạo addressbook google được nhưng đừng chọn một option nào cho nó cả nếu không khi khởi động lại máy và check mail evolution sẽ bị đơ.

  • Hiển thị hình ảnh người gửi email trong evolution:

    To make display the photograph of the sender in message header, do the following:

    Photograph Message Headers

    The photograph of the sender of an email can be shown at the right side of the message preview if the sender is in one of your address books and has a photograph.

    To enable this functionality, select Edit ▸ Preferences ▸ Mail Preferences ▸ Headers ▸ Show the photograph of sender in the message preview.

    By default only local address books are used for searching the photograph as accessing remote address books can cause delays. You can disable this by deselecting the option Search for sender photograph only in local address books.

    If there are multiple matches for a contact, the first one is always used.

  • vbulletin custom page.

    I hate propriety software, when it come to customization and developing you have almost no resource to look upon. To write a page that integrate components from (header, navigationbar, footer, etc…) you have to:

    // #################### DEFINE IMPORTANT CONSTANTS #######################
    define('THIS_SCRIPT', 'ly_lich_sv');
    define('CSRF_PROTECTION', true);
    define('CSRF_SKIP_LIST', '');
    define('VB_ENTRY', 'ajax.php');
    define('LOCATION_BYPASS', 1);
    define('NOPMPOPUP', 1);
    define('VB_ENTRY_TIME', microtime(true));
    

    THEN:

    // ######################### REQUIRE BACK-END ############################
    require_once('./global.php');
    

    then:

    $navbar = render_navbar_template(construct_navbits($navbits));	

    and finally:

    // Finish the main template

    $templater = vB_Template::create('ly_lich_sv');
    	$templater->register_page_templates();
    	$templater->register('navclass', 		$navclass);
    	$templater->register('HTML', 			$HTML);
    	$templater->register('navbar', 			$navbar);
    	$templater->register('pagetitle', 		$pagetitle);
    	$templater->register('template_hook', 	$template_hook);
    	$templater->register('includecss', 		$includecss);
    print_output($templater->render());
    

    But that is not all, it just the code. You will need the template. The template is some freaking file that this forum software read and the convert into html.