What does ‘set -e’ do, and why might it be considered dangerous?

set -e causes the shell to exit if any subcommand or pipeline returns a non-zero status. The answer the interviewer was probably looking for is: It would be dangerous to use “set -e” when creating init.d scripts: From http://www.debian.org/doc/debian-policy/ch-opersys.html 9.3.2 — Be careful of using set -e in init.d scripts. Writing correct init.d scripts requires … Read more

SSL Certificate Location on UNIX/Linux

For system-wide use, OpenSSL should provide you /etc/ssl/certs and /etc/ssl/private. The latter of which will be restricted 700 to root:root. If you have an application that doesn’t perform initial privilege separation from root, then it might suit you to locate them somewhere local to the application with the relevantly restricted ownership and permissions.

When does /tmp get cleared?

That depends on your distribution. On some system, it’s deleted only when booted, others have cronjobs running deleting items older than n hours. On Ubuntu 14: using tmpreaper which gets called by /etc/cron.daily, configured via /etc/default/rcS and /etc/tmpreaper.conf. (Credits to this answer). On Ubuntu 16: using tmpfiles.d. (Credits to this answer). On other Debian-like systems: … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)