Skip to main content

Posts

Showing posts from 2016

VirtualBox: access Windows-host shared folders from Ubuntu-guest

Dùng Vbox hay phải mount shared folder giữa win + ubuntu. Ubuntu guest no X-Server (no Window-UI) hay gặp vđ. Key 1: Cài VBox guest addtion từ command line. Key 2: Tên folder share trên windows vd: C:\Users\Desktop\SadHill khi chạy lệnh mount trong ubuntu sẽ là: sudo mount -t vboxsf SadHill /mnt/Blondie Thư mục /mnt/Blondie đc tạo từ trước. vboxsf là kiểu phân vùng như ntfs, fat32 ... ko rõ sao ko là vbox fs ? Key 3: Có thể cài vbox -guest addition từ apt hay yum bên CentOS. Tuy nhiên nếu cài = ISO trên ubuntu (debian-like) chú ý /media/cdrom đổi thành /dev/sr0 WebRefs: http://www.giannistsakiris.com/2008/04/09/virtualbox-access-windows-host-shared-folders-from-ubuntu-guest/ Làm thao để biết đã cài Vbox guest: http://www.binarytides.com/check-virtualbox-guest-additions-installed-linux-guest/ Thực tế thì ko chuẩn lắm. Cài = apt xong ko đc vẫn phải dùng Guest.ISO Mount cdrom linux guest : http://superuser.com/questions/270916/mounting-a-cdrom-in-ubuntu mount /dev/sr0 /mn

Li-ion Battery - What level of battery should we charge

Đang dính vụ sửa 1 bo mạch sạc dự phòng. Phải điều tra tài liệu về pin li-ion. Ngộ ra là nếu ko sạc full (<100%) thì tuồi thọ (số lần charge tiếp) mà vẫn đảm bảo capacity tốt hơn. Tiện thể tìm cái app notify khi pin level đến 1 mức nào đó. Mặc định khi gần hết pin < 15 hay 10% và khi charge full android sẽ notify. Mình muốn noti ngay khi pin tầm 70%. Ko có chuyện tự ngắt sạc bằng phần mềm được trừ khi smart-battery. Một số dòng laptop như của sony có chế độ sạch 50% (driver + phím tắt). Sẽ update các phần hay về pin li-ion sau.

MySQL views with union

// TODO tách dòng tạo view ra cho dễ coi // Thêm 1 số vd tạo view bá đạo khác. // Note ưu/nhược điểm của views       | vTempReportScore | CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `vTempReportScore` AS select `TempReportScore`.`C1` AS `score`,'C1' AS `ItemID`,`TempReportScore`.`TempReportID` AS `TempReportID` from `TempReportScore` union all select `TempReportScore`.`C2` AS `score`,'C2' AS `ItemID`,`TempReportScore`.`TempReportID` AS `TempReportID` from `TempReportScore` union all select `TempReportScore`.`C3` AS `score`,'C3' AS `ItemID`,`TempReportScore`.`TempReportID` AS `TempReportID` from `TempReportScore` union all select `TempReportScore`.`C4` AS `score`,'C4' AS `ItemID`,`TempReportScore`.`TempReportID` AS `TempReportID` from `TempReportScore` union all select `TempReportScore`.`C5` AS `score`,'C5' AS `ItemID`,`TempReportScore`.`TempReportID` AS `TempReportID` from `TempReportScore` union all select