Blog

  • 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.

  • Mộng

    Khi nãy buồn ngủ mà giờ thì tỉnh như con sáo sậu. Ngồi thì buồn ngủ mà nằm thì tỉnh, thật là khó hiểu. Cái chu kỳ một buồn một vui lại ứng nghiệm, ôi ta buồn vời vợi làm sao. Mẫu giáo trường xịn, cấp một trường thường, cáp 2 trường nhất nhì trong quận, cấp 3 trường nhất nhì quận từ dưới đếm lên, lên được đại học quốc gia, tới khi bảo vệ điểm thấp nhất lớp. Cái đồ thì hình sin này uốn lượn tựa mây khói, mà sao linh ứng thật nhỉ, đời lên lên xuống xuống bất thường. Ngẫm nghĩ thử nguyên nhân là gì nhưng ngẫm không ra được, chỉ còn biết trách chính mình. Mơ mơ mộng mộng, mộng cao mộng ảo, thực tế lắm khi như mộng, lắm khi phủ phàng hay là tất cả đều như mộng?

    Cái cảm giác đứng trước một thử thách lớn thật là khó tả, từ lúc thi đại học tới giờ, nhưng mà sao khác quá lần này phũ phàng quá, lần trước như một cơn mộng, lần như như tỉnh cơn mộng, tiếc rằng… tỉnh trễ quá.

    Gá thân mộng,
    Dạo cảnh mộng,

    Mộng tan rồi,
    Cười vỡ mộng.

    Ghi lời mộng,
    Nhắn khách mộng,

    Biết được mộng,
    Tỉnh cơn mộng.

  • Entry

    That was tough. When something long seemed to be ok turn bad and became worse in the very last minutes, the world seem to turned up side down. Everything is reasonable, everything is understandable. It's just that the bad had been compressed for a time too long that when it's leaked, it busted out so fast for me to handle.

    Too much self confident plus too much reliance on other people plus too much underestimating of the hard work life will throw. All those stuff together will leave you just steps away from oblivion.

    You are not as good as guessing other people's altitude as you thought you were. Face it! you are growing up, things is not what it seems to be. No one will be there to help you out when you are down. Life is tough! Stand up, sit down, lying flat or any other posture, it will fuck you. It's your rights to choose the position.

    The lowest 8, this will be hard to swallow.

  • Linux and hibernation

    Yes, linux support "Suspend to disk" A.K.A "Hibernate" as windoze call it. But if your linux distro don't support it? You will have to install an utility call pm-ultils
    Consult the arch wiki for configuration and trouble shooting: https://wiki.archlinux.org/index.php/Pm-utils

  • mime.cache and defaults.list set default application in linux (Đặt ứng dụng mặc định cho một số định dạng file)

    Thông tin về các định dạng file được lưu tại /usr/share/mime, thông tin về các chương trình được lưu tại /usr/share/applications/
    Thông tin về chương trình nào mở file nào được lưu trong file /usr/share/applications/mime.cache Nội dung file này được tạo tự động bởi chương trình update-desktop-database, file này quy định chương trình nào sẽ mở file nào. Thứ tự các chương trình được sắp xếp theo alphabetically. Bởi vậy chương trình nào tên chữ A thường được dùng làm mặc định.

    Để chỉ định chương trình mặc định theo ý muốn, tạo một file tên là defaults.list trong cùng thư mục với mimecache.info, có nội dung tương tự mimecache.info, ví dụ (lưu ý dòng đầu tiên là bắt buộc phải có):

    [Default Applications]
    image/bmp=gthumb.desktop;
    image/gif=gthumb.desktop;
    image/jpeg=gthumb.desktop;
    image/png=gthumb.desktop;
    image/svg+xml=gthumb.desktop;

  • mime.cache and defaults.list set default application in linux (Đặt ứng dụng mặc định cho một số định dạng file)

    Thông tin về các định dạng file được lưu tại /usr/share/mime, thông tin về các chương trình được lưu tại /usr/share/applications/
    Thông tin về chương trình nào mở file nào được lưu trong file /usr/share/applications/mime.cache Nội dung file này được tạo tự động bởi chương trình update-desktop-database, file này quy định chương trình nào sẽ mở file nào. Thứ tự các chương trình được sắp xếp theo alphabetically. Bởi vậy chương trình nào tên chữ A thường được dùng làm mặc định.

    Để chỉ định chương trình mặc định theo ý muốn, tạo một file tên là defaults.list trong cùng thư mục với mimecache.info, có nội dung tương tự mimecache.info, ví dụ (lưu ý dòng đầu tiên là bắt buộc phải có):

    [Default Applications]
    image/bmp=gthumb.desktop;
    image/gif=gthumb.desktop;
    image/jpeg=gthumb.desktop;
    image/png=gthumb.desktop;
    image/svg+xml=gthumb.desktop;

  • Get rid of the fucking ugly Arial fonts on linux

    There are plenty pretty fonts out there but some web just insist on Arial. And the funny things is that although I don't have arial install,

    fc-list | grep -i arial 

    return nothing, but opera and firefox still some how manage to display that ugly fonts, and in an uglier way. So, I mess around with /etc/fonts/conf.d/ and grep all file for arial then I just make some guess and test editing and everything turn out wonderful on opera. The fonts name is still Arial, but opera will take Lucida Grande to display instead, not very cool, but it does sure wokr.
    Here is the config file, file name is 30-metric-aliases.conf

    <?xml version="1.0"?>
    <!DOCTYPE fontconfig SYSTEM "fonts.dtd">
    <fontconfig>
    
    	
    
    
    
    	
    	<alias binding="same">
    	  <family>Nimbus Sans L</family>
    	  <default>
    	  <family>Helvetica</family>
    	  </default>
    	</alias>
    
    	<alias binding="same">
    	  <family>Nimbus Roman No9 L</family>
    	  <default>
    	  <family>Times</family>
    	  </default>
    	</alias>
    
    	<alias binding="same">
    	  <family>Nimbus Mono L</family>
    	  <default>
    	  <family>Courier</family>
    	  </default>
    	</alias>
    
    
    	
    	<alias binding="same">
    	  <family>Liberation Sans</family>
    	  <family>Lucida Grande</family>
    	  <family>Albany</family>
    	  <family>Albany AMT</family>
    	  <default>
    	  <family>Arial</family>
    	  </default>
    	</alias>
    
    	<alias binding="same">
    	  <family>Liberation Serif</family>
    	  <family>Thorndale</family>
    	  <family>Thorndale AMT</family>
    	  <default>
    	  <family>Times New Roman</family>
    	  </default>
    	</alias>
    
    	<alias binding="same">
    	  <family>Liberation Mono</family>
    	  <family>Cumberland</family>
    	  <family>Cumberland AMT</family>
    	  <default>
    	  <family>Courier New</family>
    	  </default>
    	</alias>
    
    
    
    
    
    
    	
    	<alias>
    	  <family>Lucida Grande</family>
    	  <default>
    	  <family>Arial</family>
    	  </default>
    	</alias>
    
    	<alias>
    	  <family>Times</family>
    	  <default>
    	  <family>Times New Roman</family>
    	  </default>
    	</alias>
    
    	<alias>
    	  <family>Courier</family>
    	  <default>
    	  <family>Courier New</family>
    	  </default>
    	</alias>
    
    
    	
    	<alias>
    	  <family>Arial</family>
    	  <default>
    	  <family>Helvetica</family>
    	  </default>
    	</alias>
    
    	<alias>
    	  <family>Times New Roman</family>
    	  <default>
    	  <family>Times</family>
    	  </default>
    	</alias>
    
    	<alias>
    	  <family>Courier New</family>
    	  <default>
    	  <family>Courier</family>
    	  </default>
    	</alias>
    
    
    
    
    
    
    	
    	<alias binding="same">
    	  <family>Helvetica</family>
    	  <accept>
    	  <family>Nimbus Sans L</family>
    	  </accept>
    	</alias>
    
    	<alias binding="same">
    	  <family>Times</family>
    	  <accept>
    	  <family>Nimbus Roman No9 L</family>
    	  </accept>
    	</alias>
    
    	<alias binding="same">
    	  <family>Courier</family>
    	  <accept>
    	  <family>Nimbus Mono L</family>
    	  </accept>
    	</alias>
    
    
    	
    	<alias binding="same">
    	  <family>Arial</family>
    	  <accept>
    	  <family>Lucida Grande</family>
    	  <family>Liberation Sans</family>
    	  <family>Albany</family>
    	  <family>Albany AMT</family>
    	  </accept>
    	</alias>
    
    	<alias binding="same">
    	  <family>Times New Roman</family>
    	  <accept>
    	  <family>Liberation Serif</family>
    	  <family>Thorndale</family>
    	  <family>Thorndale AMT</family>
    	  </accept>
    	</alias>
    
    	<alias binding="same">
    	  <family>Courier New</family>
    	  <accept>
    	  <family>Liberation Mono</family>
    	  <family>Cumberland</family>
    	  <family>Cumberland AMT</family>
    	  </accept>
    	</alias>
    
    
    </fontconfig>