Skip to main content

Posts

Showing posts from February, 2017

History file, folder, source code Git, SVN, linux

Git list all file change between 2 commit. git diff --name-only SHA1 SHA2 http://stackoverflow.com/questions/1552340/how-to-list-the-file-names-only-that-changed-between-two-commits Svn list all change between 2 revision svn diff -r REVNO:HEAD --summarize history Bash diff folder (only list file) diff --brief -r source_dir/ dest_dir/ svn merge rabc:rdef branch to . bash find modified by time (update link here) gitk - tool GUI for find all change history of a file /folder (easy browse like sourceTree in Windows/OSX) Bash recursive list file change by time. http://serverfault.com/questions/61822/how-do-i-merge-two-svn-branches http://unix.stackexchange.com/questions/146282/rsync-to-copy-files-which-has-changed ou can use the -n option (or --dry-run) to check your command. It will show what it would do without actually copying any files. Therefore: rsync -uan /var/lib/mysql/mysql-bin.*  /dbdata/binarylog/ and once you're happy that the files are listed co...

Safari session cookie do not work with API server.

I have problem with session on Safari. My server is Apache Laravel on a dedicated AWS. Admin is angularJS on an Windows XAMPP server. My problem occur on UAT Testing site (like staging) Live server do not have problem. The cause is so simple but it take me about 2-3 day to figure of what the heck with Safari. It caused by domain admin web and API do not match. So the fix is so simple and in the real app it rarely apear because normaly api and web app use same domain name abc.com. But on testing, sometime we have to work with IP or not real domain name. This post I note something that I've learned when debug Why Safari could not write session (or more exactly, Why session cookie do not work on safari with api server) Cookie domain: admin.abcxyz.test.co api.123.vps.com => Default chrome work well (like allow all cookie). But default Safari only Allow from websites I visite. After some trial and digging, I end up with figure out the different behavior of Safar...

Best Place for Validation in Model/View/Controller Model?

If you're validating the data on client side (i.e Javascript validation) which is absolutely not enough and not secure at all, You should implement it in View. If you're validating data on server side, And your validation does not require application business logic (i.e you're not checking to see if the user has enough credit in his account), You should validate in the controller. If the validation requires business logic, Implement it inside the model and call it via controller. Postback validation is not good since it puts lots of pressure and delay, And the only advantage is to the programmer (not to be accounted). You can use regex for most of validation, Which has the same syntax (almost) on PHP and JS.