Deploy ứng dụng Angular

Câu lệnh để build(đối với ứng dụng đặt ở sub-dir):

ng build --base-href=./ --prod
 ng build --base-href='/dist/' --prod

ng build –base-href=’/dist/’ –prod

Với server window, ta có thể build ứng dụng trên máy chủ Apache. Đơn giản chỉ cần tải Xampp về cài, chỉ cần cài mỗi gói Apache.

Link hướng dẫn chi tiết cài thêm nếu cần.

ETL tool of Oracle

Oracle has 4 ETL tools:

  • ODI: the one from Sunopsis. This is the future.
  • OWB: the old OWB (without the new ODI functions), available with Oracle DB. Aka “Basic ETL”.
  • ODIEE: bundled license of OWB & ODI. EE stands for “Enterprise Edition”.
  • OWBEE: modified OWB, with the new ODI functions. EE stands for “Enterprise ETL”, not “Enterprise Edition”

https://docs.oracle.com/cd/B19306_01/server.102/b14223/ettover.htm

https://www.oracle.com/tools/downloads/apex-v191-downloads.html

Crawl dữ liệu với selenium

Mình vẫn hay phải crawl dữ liệu chơi chơi để làm một số công việc tự động. Ví dụ crawl vài trang blog hoặc web về IT để đưa lên máy đọc sách để đọc. Ngôn ngữ sử dụng thì trước là C#, sau là NodeJS và gần đây nhất là Python.

Mình gặp một vấn đề khi crawl là một số trường hợp không thể lấy được dữ liệu. Lần gần đây nhất mà mình tạm bỏ qua đó là trang Kipalog, mình không lấy được số lượt lưu trữ của mỗi bài viết. Khi load HTML thì các thuộc tính của nó không chứa dữ liệu. Hoặc 1 blog khác thì không lấy được các comment của bài viết…

Cũng nghe từ lâu rồi nhưng nay phải note lại để nghiên cứu làm thử. Đó là sử dụng selenium để crawl dữ liệu với những trang web sử dụng ajax để load dữ liệu, có capcha hoặc trang bắt phải login…

Selenium thường được biết đến là một môi trường test tự động cho trình duyệt web. Khi mình cần test website tự động thì cần dùng đến công cụ này… Mình sẽ tìm hiểu để triển khai thử việc test và crawl dữ liệu với Selenium.

Install wordpress on LAMP with CentOS

Trong khuôn khổ việc tìm hiểu và sử dụng APACHE, NGINX bước đầu mình sẽ dựng trước một blog wordpress trên server CentOS. Việc cài đặt sẽ thực hiện trên máy ảo CentOS dựng trên máy cá nhân của mình. Vừa rồi hệ thống bắt buộc sử dụng proxy để ra ngoài Internt nên mình bị chững lại để giải quyết. Giải pháp đã được cập nhật tại bài này.

Step 1: Installing Remi Repository on CentOS

yum -y install http://rpms.remirepo.net/enterprise/remi-release-7.rpm

Step 2: Config using default php 7

 yum install yum-utils
 yum-config-manager --disable remi-php54
 yum-config-manager --enable remi-php73

Step 3: Install LAMP: Linux, Apache, Mariadb (No using MySQL), PHP

 # yum install httpd mariadb mariadb-server php php-common php-mysql php-gd php-xml php-mbstring php-mcrypt
 #  systemctl start mariadb
 #  mysql_secure_installation
 #  systemctl enable mariadb
 #  systemctl start httpd
 #  systemctl enable httpd

Step 4: Create database for Worpress.

 mysql -u root -p
 CREATE DATABASE wordpress;
 CREATE USER wordpress@localhost IDENTIFIED BY "secure_password";
 GRANT ALL ON wordpress.* TO wordpress@localhost;
 FLUSH PRIVILEGES;
 exit;

Step 5: Prepare for install Worpress

Go to http://wordpress.org, download last version Worpress
Using terminal go to folder downloaded:

 cd /home/pktuy/download
 tar -xvzf wordpress.version.tar.gz -C /var/www/html
 chown -R apache /var/www/html/wordpress

Step 6:(maybe not) Creating Apache Virtual Host for WordPress

vim /etc/httpd/conf/httpd.conf

Add line:

<-VirtualHost *:80->
   ServerAdmin [email protected]
   DocumentRoot /var/www/html/wordpress
   ServerName tecminttest.com
   ServerAlias www.tecminttest.com
   ErrorLog /var/log/httpd/tecminttest-error-log
   CustomLog /var/log/httpd/tecminttest-acces-log common 
</VirtualHost->

Restart apache:

systemctl restart httpd

Step 7: Install blog WordPress

Access htt://localhost and next…