svn st | grep “M ” | cut -d” ” -f 8
Category Archives: Sử dụng máy vi tính
Tạo thư mục đệ quy
PHP:
mkdir(‘/home/huypv/d1/d2/d3/d4’, 0775, true);
Linux (đã có bài đề cập nhưng nhắc lại ^^):
mkdir -p /home/huypv/d1/d2/d3/d4
Bonus: Tạo thư mục và set quyền khi gõ lệnh trong Linux
mkdir -p d1/d2/d3/writeable && chmod 777 d1/d2/d3/writeable
(man mkdir => mkdir có tham số -m nhưng hem quen)
The procedure entry point IsThreadDesktopComposited could not be located in the dynamic link library USER32.dll
Click Start, and then click My Computer.
Double-click the hard disk icon for the drive where Windows is installed. In most cases this will be C:\.
Double-click the WINDOWS folder, and then double-click the system32 folder.
Browse to the file dwmapi.dll.
Right-click the file, and then click Delete.
Or
Press Windows + R
Enter command:
del C:\Windows\system32\dwmapi.dll
Command line tips and tricks
#Mở một file .CHM
hh D:\manual\chm\banking.chm
#Làm sao thu được MD5 của một xâu nhanh nhất
#assume that we installed php
php -r “echo md5(‘123456’);”
#assume that we have MySQL client
mysql -uroot -p0hmyg0d -hlocalhost
tee C:\md5.txt
SELECT MD5(‘123456’);
notee
(Chẳng qua là tôi sẵn có và yêu thích PHP, MySQL nên show hàng ra thế thôi ^^)
#Mở MicrofSoft Word (require install office)
winword
#Mở MicroSoft Excel
excel
#Không in ra lỗi
Bình thường nếu gõ
clgt ???
Thì sẽ được
‘clgt’ is not recognized as an internal or external command,
operable program or batch file.
Nhưng hãy thử
clgt ??? 2>nul
(*Nếu mún tìm hiểu: 0 – stdin, 1 – stdout, 2 – stderr)
#Xem ip của một tên miền (domain) mà hem dùng ping
nslookup phungvanhuy.net
Một phần kết quả ra sẽ là
Name: phungvanhuy.net
Address: 118.70.250.169
Import/Restore big MySQL database
1. Máy chủ riêng và ta có quyền kiểm soát
Trong trường hợp này có 2 cách
– Nếu database quá lớn, việt xuất ra file .sql là rất bất tiện. Giải pháp : backup bằng cách copy y nguyên thư mục chứa các file của database, khi import lại thì copy vào thư mục chứa database của mysql (db mới thì tạo db trước khi copy, cũ thì copy đè lên). Sau đó CHMOD các file database đúng với owner chạy mysql và restart lại MySql là được.
– Nếu database ở khá lớn ở dạng file *.sql thì dùng lệnh của MySql. Login với quyền root, sau đó change sang database cần import. Lưu ý đến charset của database trước khi import, đặc biệt là hay dùng UTF8. Để set UTF8 chạy lệnh:
mysql> SET NAMES utf8
Sau đó chạy lệnh import:
mysql> source filename;
2. Import từ phía web client (phổ biến)
Giải pháp khá phổ biến và rất hay là dùng BigDump.
Cách làm : download bigdump về,upload file database .sql lên server (ví dụ : test.sql), sau đó up file bigdump.php đã config lên.
Sau đó trên web chạy : you.com/bigdump.php và bấm Start –> ko báo lỗi gì là ok.
Các tham số đáng chú ý với bigdump :
$db_server = ‘localhost’;// –> địa chỉ server
$db_name = ”;// –> tên database
$db_username = ”;// –> user
$db_password = ”; //–> mật khẩu
$filename = ‘test.sql’;// –> tên file database, ở đây là test.sql (Nên để trống)
$db_connection_charset = ‘utf8’;// –> (utf8 hoặc latin1) cái này quan trọng này, nếu không đúng database sẽ rất dễ bị lỗi tiếng Việt