Skip to main content

Posts

Showing posts from January, 2017

mysql 3 cron backup

http://www.techiecorner.com/1619/how-to-setup-mysqldump-without-password-in-cronjob/ Nhắc lại query tìm cột xuất hiện ở table nào trong DB: SELECT * FROM information_schema.COLUMNS WHERE     TABLE_SCHEMA = 'db_name' AND TABLE_NAME = 'table_name' AND COLUMN_NAME = 'column_name' Export data MySQL with condition: mysql -e "select picture from post where picture like 'https://s3%'" -u username-p db_name > trump.txt Lệnh trên dump hết picture (url) lưu trên amazon S3 ra file với điều kiện là URL ảnh phải bắt đầu = https://s3 (ko lẫn với các ảnh khác) .

Runtime config apache

Using custom  php.ini  files is pretty straighforward for CGI/FastCGI based PHP installations but it isn't feasible when running PHP as Apache module (mod_php) because the whole server runs a single instance of the PHP interpreter. My advice: Set from PHP itself as many settings as you can: ini_set ( 'memory_limit' , '16M' ); date_default_timezone_set ( 'Europe/Madrid' ) ... In other words, directives that can be changed at runtime. Set the rest of stuff from per-directory Apache setting files (aka  .htaccess ): php_flag short_open_tag off php_value post_max_size 50M php_value upload_max_filesize 50M i.e., settings that need to be defined before the script starts running Please have a look at the  Runtime Configuration  for further details. Sometimes, you'll actually need  different  settings in development and production. There're endless ways to solve that with PHP code (from creating a boolean constant from the  $_SERVER[&

HIPAA Rules

HIPAA - Health Insurance Portability and Accountability Act là 1 bộ luật của Mỹ về y tế ban hành năm 1996. Bài này chúng ta sẽ tìm hiểu HIPAA là gì, tại sao nó lại quan trọng. Với developer chúng ta cần biết ai là người chứng thực chuẩn HIPAA cho hệ thống mình xây dựng, ai sẽ thanh tra hệ thống bất chợt hay thường niên. Bộ luật này nhằm nâng cao chất lượng y tế và bảo mật thông tin cá nhân thông qua các luật, cơ chế ... trong thời đại số. Trong bài này m sẽ trình bày về HIPAA là gì cho mọi người bình thường hiểu sơ qua. Phần sau dành cho developer về việc implement chuẩn HIPAA cho ứng dụng. Phần cuối là CASE study apply HIPAA comliant cho project cụ thể. Phần cuối này m sẽ giữ bí mật để đảm bảo ko leak thông tin cho dự án. HIPAA là bộ luật có nhiều phần (title) như việc thống nhất việc định danh các bọn liên quan đến y tế như tên viện, tên hãng thuốc ... sẽ được đánh mã ID duy nhất cho tiện quản lý và theo dõi. Có phần về bảo mật thông tin bệnh nhân là phần mà chúng ta sẽ bàn ở đâ

Fullstack developer

Some good define from Thoughtwork: The modern software developer has to be something of a swiss army knife. Of course, you need to write code that fulfills customer functional requirements. It needs to be fast. Further you are expected to write this code to be comprehensible and extensible: sufficiently flexible to allow for the evolutionary nature of IT demands, but stable and reliable. You need to be able to lay out a useable interface, optimize a database, and often set up and maintain a delivery pipeline. You need to be able to get these things done by yesterday.

Browserstack free account

Browser stack cho phép dùng device ảo (như máy thật) để test mobile và browser. Phí khá đắt 99$ cho 3 tháng hay 1 năm thì phải. Account free dù có nhiều hạn chế nhưng vẫn test khá ổn. Default free trial chỉ đc 30phút :) Chưa tìm ra cách có account free nên tạm thời dùng nhiều email để tạo nhiều account. 1 Email dùng 1 lần. Trước kia Gmail có cách dùng + hay . sau email để App nhận ra là 2 account riêng biệt trong khi Gmail vẫn hiểu là cùng 1 account. VD: blondie@gmail.com có thể dùng account  khác như: blondie+tuco@gmail.com để regist acc Browser Stack (BS). Sau 1 tg thì BS cũng nhận ra và update đoạn verify Unique => :( Dùng mail free (dump) như mailignator (inator ?) hay yopmail. => :( oẳng vì test có vẻ tất cả mail dump đều đc BS bắt. => Dùng các mail service free (ko cần mail verify hay phone number khi regist). List ở đây:  http://thesimplecomputer.info/free-webmail-for-better-privacy#openmailbox OK h có thể dùng dần tạm. BS có nhiều cái lợi như có thể debug In

Manual config network interface ubuntu

Xưa học môn mạng TH qua RedHat/CentOS hay động task này. # The primary network interface auto eth0 iface eth0 inet static address 192.168.X.X netmask 255.255.255.0 gateway 192.168.X.X dns-nameservers X.X.X.X If you have more than one DNS server, just add a space between each: dns-nameservers X.X.X.X Y.Y.Y.Y Z.Z.Z.Z DNS: vnpt: 203.162.1.191 Google 8.8.4.4 Thường dùng 8.8.8.8 và 8.8.4.4 nhưng đôi khi oẳng nên kết hợp GG + VNPT vô: 203.162.1.19[1/2] và 8.8.[4/8].[4/8] Up / down eth0 (network Interface) sudo ifdown eth0 sudo ifup eth0 edit file: /etc/network/interface

SVN command

http://stackoverflow.com/questions/1516188/svn-commit-specific-files http://svnbook.red-bean.com/en/1.6/svn.ref.svn.c.delete.html $ svn ci -m "Now works" --targets fix4711.txt svn rm vendor svn ci -m "Clean vendor" vendor/ Thời này mà còn sài SVN cám lợn. Lâu ko động svn với windows h dùng lại thấy tù vc. Nhất là khi proj mấy ông chơi cả vendor với plugin cả trăm MB lên. :) Update1: Remove some history revision svnadmin dump /path/to/current/repo -r9000:10000 > svn.dump svnadmin create /path/to/new/repo svnadmin load /path/to/new/repo < svn.dump