Thứ Tư, 10 tháng 10, 2012

Đăng ký DV 3G Viettel

Đăng ký DV 3G Viettel

Đăng ký chuyển đổi sang mạng 3G (Áp dụng với thuê bao trả trước và trả sau)
Có 2 cách:
Cách 1: Khách hàng đăng ký sử dụng 3G tại các cửa hàng Viettel trên toàn quốc.
Cách 2: Khách hàng tự đăng ký thông qua 3 bước đơn giản:
Bước 1: Đăng ký chuyển đổi mạng 3G
Khách hàng soạn tin nhắn nội dung: 3G ON gửi 161
Cước phí duy trì dịch vụ: 10.000đ/tháng
Sau khi chuyển sang 3G, khách hàng được giữ nguyên tính chất gói cước 2G cũ và bổ sung tính năng Video call, Mobile Internet.
Bước 2: Chuyển băng tần cho máy từ GSM sang UMTS băng tần 1900 – 2100 Mhz.
Menu >> Settings >>Phone >>Network >> Network Mode >> chọn UMTS


Bonus:  Dang ky Mimax: mimax gui 191

Thứ Ba, 2 tháng 10, 2012

Fix lỗi SQLSTATE[HY000]: General error: 145 Table xxx is marked as crashed and should be repaired

Hôm nay sau 1 hồi start, stop rồi kill MySQL thì gặp phải lỗi:

SQLSTATE[HY000]: General error: 145 Table xxx is marked as crashed and should be repaired

Cách fix:
 
REPAIR TABLE tablename

Thứ Sáu, 24 tháng 8, 2012

Kinh nghiệm làm việc với Nagios



Plugin NRPE: http://exchange.nagios.org/directory/Addons/Monitoring-Agents/NRPE--2D-Nagios-Remote-Plugin-Executor/details

Lỗi gặp phải khi cài đặt:
- Khi configure NRPE thì có lỗi không tìm được thư viện ssl
- Cách fix: 
+ apt-get install libcurl3-openssl-dev
+ ./configure --with-ssl=/usr/bin/openssl --with-ssl-lib=/usr/lib

Thứ Sáu, 17 tháng 8, 2012

Thư mục php-cli

Tìm mãi mới ra. Trong: /usr/bin/php

Trong đó gồm cả thập cẩm mấy thứ: php-ize, php-config....

Thứ Năm, 16 tháng 8, 2012

Regular Expression Wiki

In the BRE syntax, most characters are treated as literals — they match only themselves (e.g., a matches "a"). The exceptions, listed below, are called metacharacters or metasequences.
Metacharacter Description
. Matches any single character (many applications exclude newlines, and exactly which characters are considered newlines is flavor-, character-encoding-, and platform-specific, but it is safe to assume that the line feed character is included). Within POSIX bracket expressions, the dot character matches a literal dot. For example, a.c matches "abc", etc., but [a.c] matches only "a", ".", or "c".
[ ] A bracket expression. Matches a single character that is contained within the brackets. For example, [abc] matches "a", "b", or "c". [a-z] specifies a range which matches any lowercase letter from "a" to "z". These forms can be mixed: [abcx-z] matches "a", "b", "c", "x", "y", or "z", as does [a-cx-z]. The - character is treated as a literal character if it is the last or the first (after the ^) character within the brackets: [abc-], [-abc]. Note that backslash escapes are not allowed. The ] character can be included in a bracket expression if it is the first (after the ^) character: []abc].
[^ ] Matches a single character that is not contained within the brackets. For example, [^abc] matches any character other than "a", "b", or "c". [^a-z] matches any single character that is not a lowercase letter from "a" to "z". Likewise, literal characters and ranges can be mixed.
^ Matches the starting position within the string. In line-based tools, it matches the starting position of any line.
$ Matches the ending position of the string or the position just before a string-ending newline. In line-based tools, it matches the ending position of any line.
BRE: \( \)
ERE: ( )
Defines a marked subexpression. The string matched within the parentheses can be recalled later (see the next entry, \n). A marked subexpression is also called a block or capturing group.
\n Matches what the nth marked subexpression matched, where n is a digit from 1 to 9. This construct is theoretically irregular and was not adopted in the POSIX ERE syntax. Some tools allow referencing more than nine capturing groups.
* Matches the preceding element zero or more times. For example, ab*c matches "ac", "abc", "abbbc", etc. [xyz]* matches "", "x", "y", "z", "zx", "zyx", "xyzzy", and so on. \(ab\)* matches "", "ab", "abab", "ababab", and so on.
BRE: \{m,n\}
ERE: {m,n}
Matches the preceding element at least m and not more than n times. For example, a\{3,5\} matches only "aaa", "aaaa", and "aaaaa". This is not found in a few older instances of regular expressions.
Examples:
  • .at matches any three-character string ending with "at", including "hat", "cat", and "bat".
  • [hc]at matches "hat" and "cat".
  • [^b]at matches all strings matched by .at except "bat".
  • ^[hc]at matches "hat" and "cat", but only at the beginning of the string or line.
  • [hc]at$ matches "hat" and "cat", but only at the end of the string or line.
  • \[.\] matches any single character surrounded by "[" and "]" since the brackets are escaped, for example: "[a]" and "[b]".

Lỗi khi so sánh chuỗi trong PHP

Mọi hôm lười toàn so sánh kiểu ==

Hôm nay gặp lỗi so sánh 2 chuỗi: 01235000000000000000000000000000001235 &  01235000000000000000000000000000001234  cho kết quả bằng nhau
Giải pháp: chuyển sang strcmp

Sẽ cập nhật sau sự khác nhau giữa strcmp  vs  '=='