Sunday, July 27, 2014

Tuesday, July 8, 2014

Nước ấm nấu ếch

Nước ấm nấu ếch: là câu chuyện ngụ ngôn của Trung Quốc. Khi bỏ con ếch thẳng vào nước nóng, nó sẽ lập tức nhảy ra. Nhưng nếu bỏ vào nước lạnh rồi chậm rãi đun lên, con ếch sẽ ở yên mà… chết từ từ

Ngụ ý: con người sống trong an nhàn quen rồi có thể khiến tinh thần sa đọa mà hại đến bản thân, bởi vì quá trình này diễn ra chậm chạp nên khi tỉnh ngộ thì đã muộn. Ngược lại, nếu đang ở “thiên đường” (điều kiện bình thường) mà bị ném xuống “địa ngục” (nước nóng), phản ứng sẽ rất mạnh, từ đó nhanh chóng đưa ra lựa chọn, không đến nỗi chết lúc nào không hay.


Thursday, July 3, 2014

Chụp ảnh dễ ẹc!

Giới thiệu

Chụp ảnh không khó! Muốn đẹp phải luyện!
Từ không biết gì đến làm chủ máy ảnh và tạo ra những tấm ảnh chất lượng.

Quảng Bình - Việt Nam
Canon IXUS   

Nội dung chương trình học sẽ lần lượt sẽ trả lời các câu hỏi: 

  • Chụp ảnh là gì? Học chụp ảnh dễ hay khó?
  • Cần gì để có thể chụp ảnh? Cần phải đầu tư bao nhiêu để chụp ảnh?
  • Ảnh nào là ảnh đẹp, ảnh nào là ảnh xấu? Làm như thế nào để ảnh đẹp?
  • Chụp ảnh có cần phải sử dụng máy ảnh xịn? Ống kính xịn? 

Thành phần cơ bản của máy ảnh DSLR

Body, Sensor, Function, Settings
Bài tập thực hành 1: làm chủ máy ảnh

Thông số nhiếp ảnh

Độ phơi sáng (Exposure): Độ nhạy sáng (ISO), Tốc độ màn trập (Shutter Speed), khẩu độ (Apeture)
Bài tập thực hành 2: làm chủ thông số

Ống kính (lens)

Khẩu độ (Apeture), độ sâu trường ảnh (Depth of Field - DOF), kính lọc (filter)
Bài tập thực hành 3: làm chủ ống kính, xóa phông và DOF

Cân bằng trắng (White Balance)

Bài tập thực hành 4: làm chủ môi trường

Bài tập thực hành 5: ra đường và mô tả cuộc sống thôi

Bài tập thực hành n: Your passion

Các chủ đề ảnh? (từ ý tưởng đến hiện thực)

Chủ đề khác: Metering Modes, Resolution, Image file formats, giữ gìn máy ảnh, ống kính.

Người học cần chuẩn bị

Máy ảnh: DSLR, compact, điện thoại (có khả năng chụp hình) ... ống kính nào cũng được (có súng nào dùng súng đó...không dùng súng nước =))
Kỷ luật: khổ luyện mới nên người
Một chút đam mê

Hướng dẫn:
Đức Trần - Freelance Photographer
Sơn Đỗ - Freelance Photographer

Troubleshooting Backuppc problems

My environment: Ubuntu 12.04 + BackupPC 3.2.1
Xfer Method: Rsync + SSH

Log file location: /var/lib/backuppc/log/LOG
Host per log: TOPDIR/pc/$host/LOG
Mine is: /data/backuppc/pc/$host/LOG


The easiest way to debug backup problems on a specific host is to run BackupPC_dump manually as the BackupPC user. This is the most important thing, run it at first to detect the source of problem
/usr/share/backuppc/bin/BackupPC_dump -v -f remote_host.vn > remote_host.log
http://backuppc.sourceforge.net/faq/

Common Backuppc Problem

Backuppc user in Visudo group of Remote host. But when the Server start sudo script it return this error

sudo: no tty present and no askpass program specified

In remote host:
visudobackuppc ALL=(root) NOPASSWD: /usr/bin/rsync, /bin/tar

In Backuppc Server
add -t option to ssh
DumpPreUserCmd  $sshPath -t -q -x -l backuppc $host /usr/bin/sudo /usr/local/bin/rsync_script.sh

no ping response

backuppc work only if it can ping the remote host, if it can not ping, you have to check your
  • Network connection to remote host
  • Firewall rules / Polices
If you can ping from backuppc console, it mean backppc ping configuration went wrong:
$Conf{Ping6Path} is not set by default in 3.2.1. The solution is easy. Set this in /etc/backuppc/config.pl
$Conf{Ping6Path} = '/bin/ping6';
If ping also not work -> try Echo (Solution from SysadminWorld.com)
In the BackupPC webinterface, click the client host name, Edit Config, go to the Backup Settings and change the setting PingCmd ($pingPath -c 1 $host by default) to/bin/echo

Don’t forget to check override and click the Save button to apply the change.

Use of qw(…) as parentheses is deprecated

Use of qw(...) as parentheses is deprecated at /usr/share/backuppc/lib/BackupPC/Storage/Text.pm line 302.
Use of qw(...) as parentheses is deprecated at /usr/share/backuppc/lib/BackupPC/Lib.pm line 1425.

apply one-liner patch from www.tolaris.com
wget -q http://www.tolaris.com/blog/wp-content/uploads/2012/05/BackupPC-3.2.1-CVE-2011-170886.diff -O- | patch -p0 -N -r - -d /usr/share/backuppc/

BackupPC displays bogus “Last email sent” messages

BackupPC will send error message emails to the administrator or user of a host (backup target) if it cannot reach the host for a set period of time. The user interface always displays this last message, even if it doesn’t exist:
Last email sent to user@example.com was at 2012-05-01 01:23, subject “”.
apply one-liner patch from www.tolaris.com
wget -q http://www.tolaris.com/blog/wp-content/uploads/2012/05/BackupPC-3.2.1-no_blank_email.diff -O- | patch -p0 -N -r - -d /usr/share/backuppc/

Got fatal error during xfer (aborted by signal=PIPE)

This is the most common Backuppc error message. It can be:
Your remote script execution (Xfer script, DumpPreUserCmd, DumpPostUserCmd): it depend on which user running the script, permission to run that script, status of the script, result of the script. Make sure you run the script successfully on the console of that host as backuppc user first , then try run the script remotely on Backuppc Server console for example:
ssh -t -c blowfish -q -x -l backuppc remote_server.vn /usr/bin/sudo /usr/local/bin/rsync_script.sh
Your remote location: Check your RsyncShareName in Host Xfer setting carefully. Make sure the directory you specify are exsits and backuppc have permssion to read it, do not add any extra blank line in RsysncShareName

Timeout: possibly the remote script take long time to return. Here is a work around
Try adding -o ServerAliveInterval=300 into RsyncClientRestoreCmd, RsyncClientCmd, DumpPreUserCmd, DumpPostUserCmd
$sshPath -c blowfish -o ServerAliveInterval=300 -q -x -l backuppc $host $rsyncPath $argList+

Backuppc wrong setting: make sure you don't have any typo mistakes on any fields, select the right xfer method.

Resouces on both host while running backup: RAM, CPU, DISK, Network...Any bottle neck?

Turn on Verbose

XferLogLevel=9, RsyncArgs -vv

Waiting for your comment :D