Skip to main content

Posts

Showing posts from April, 2017

ORMHate

https://martinfowler.com/bliki/OrmHate.html Long post about ORM which give u more detail about object/memory-mapping/relational, problems with ORM and how to deal with it. No 100% solution to this... http://blogs.tedneward.com/post/the-vietnam-of-computer-science/ https://martinfowler.com/eaaCatalog/ Alternative to RDMS https://martinfowler.com/bliki/DatabaseThaw.html https://martinfowler.com/bliki/PolyglotPersistence.html https://martinfowler.com/tags/database.html https://www.infoq.com/jaoo

Symlink in VBox npm install

https://github.com/mitchellh/vagrant/issues/713  npm install --only=production npm WARN txp-chat-demo@0.0.1 No repository field. npm ERR! Linux 4.4.0-72-generic npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "--only=production" npm ERR! node v4.2.6 npm ERR! npm  v3.5.2 npm ERR! path ../mime/cli.js npm ERR! code EROFS npm ERR! errno -30 npm ERR! syscall symlink npm ERR! rofs EROFS: read-only file system, symlink '../mime/cli.js' -> '/mnt/PROJECT/kkk/node_modules/.bin/mime' npm ERR! rofs This is most likely not a problem with npm itself npm ERR! rofs and is related to the file system being read-only. npm ERR! rofs npm ERR! rofs Often virtualized file systems, or other file systems npm ERR! rofs that don't support symlinks, give this error. npm ERR! Linux 4.4.0-72-generic npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "--only=production" npm ERR!

Encrypt image jpg, png ...

We know gpg can be encrypt text file, but with image it can not because image (normally jpg or png) was not gpg supported format. There are many other way to encrypt image, base idea is on bit or hex encrypt, modify ... TODO: write simple C program to do this http://stackoverflow.com/questions/26442162/decryption-of-png-and-jpg-files

Các lệnh tắt máy linux, khác bọt giữa shutdown. halt poweroff ...

http://askubuntu.com/questions/578144/why-doesnt-running-sudo-shutdown-now-shut-down Traditionally, the command  sudo shutdown now  will take you to the runlevel 1 (recovery mode); this will happen for both Upstart and SysV init. To get what you want, i.e., to shut down the computer properly, you need to give the  -h  switch to  shutdown . One thing to note here is that  halt  will close all the processes, turn off the CPUs and return the control to a ROM monitor of the mainboard needing the user to press the power button to get the power supply turned off, whereas  poweroff  after turning off the CPUs will simply turn off the power supply resulting in a proper shutdown. The  -h  switch of  shutdown  will either  halt  or  poweroff  the computer, the decision will be taken by the system although in Ubuntu I have seen that it would normally  poweroff  the machine. To be sure of that, you can use the  -P  switch with  shutdown  to  poweroff  the computer. To summarize, here are

VirtualHost and server timezone cronjob PHP and MySQL timestamp

According to Apache documentation: ServerName inheritance It is best to always explicitly list a ServerName in every name-based virtual host. If a VirtualHost doesn't specify a ServerName, a server name will be inherited from the base server configuration. If no server name was specified globally, one is detected at startup through reverse DNS resolution of the first listening address. In either case, this inherited server name will influenced name-based virtual host resolution, so it is best to always explicitly list a ServerName in every name-based virtual host. ServerName requires FQDN try change sitedemo1 in sitedemo1.localhost in configuration file (/etc/hosts and sitedemo1.conf) Add ServerAlias with:    ServerName sitedemo1.localhost MySQL see timezone (Windows Server) and SELECT NOW() return timestamp in Zone but PHP not. PHP still return UTC (php.ini set timezone not UTC but Berlin). So when you have cronjob with PHP and access MySQL pay attention to timezon