Quick Test Sending Mail in PHP

This is how I test my php code sending mail (with mail() function) using

Install MailCatcher

sudo apt-get install ruby ruby-dev

sudo gem install mailcatcher

Start PHP server

php -d sendmail_path="env /usr/local/bin/catchmail -f noreply@domain.com" -S 0.0.0.0:8080

Start MailCatcher

mailcatcher

Run and check

  • Run the script by visiting the page (that sends mail)
  • Check the mail at

Related tasks

  • check which php.ini is in effect by running php --ini
  • check sendmail_path has been set correctly or not by using echo phpinof() in a page
  • check the path of catchmail by running which catchmail
  • close the mailcatcher server from web interface
  • read mailcatcher help by running mailcatcher --help
  • read php help php --help

Unifi Controller 5 on Ubuntu 16.04 LTS

UniFi Controller is server application to manage UniFi Access Points by Ubiquiti Networks.

  • Download Controller 5 from Ubiquiti site
  • Install

    sudo gdebi unifi_sysvinit_all.deb
    

  • Start unifi service
    service unifi status
    
  • visit
    http://localhost:8443
    

Under the hood

  • compatible with Java 6, 7 & 8
  • MogoDB included
  • uses 8443, 8080, 8880, 8843, 27117, 3478, 8881, 8882

Some service that might uses the above ports

  • LXD – 8443
  • Apache2/httpd or Nginx – 8080

Make sure they are not running or not using the port before starting the unifi service.

Other resources

Printer dialog freezes after setting Properties

Problem

Printer dialog freezes after setting Properties of (any) printer.

Setup

Hardware

  • DELL Optiplex 9020
  • HP LaserJet 400 M401d (connected with USB)

Software/driver/firmware

  • Windows 7 64-bit
  • UAC notify
  • HP PCL 6 driver for Windows 7 64-bit
  • HP printer firmware 20160224

Steps tried before solution

  • carry out sfc /scannnow
  • carry out chkdsk
  • tried updating to lastest firmware and drivers
  • tried different setting in printer properties such as spooling, bidirectional support, rendering, etc.
  • change user role
    • When the user role is User, the printer dialog box freezes.
    • If the user role is Admininstrator, the printer dialog box does not freeze.
    • If the user role is Power Users, the printer dialog box does not freeze.

Solution

Set the user role to Power Users.

Remark

  • This will not solve all the freeze cases as there were other causes
  • Setting the user role to Power Users may not be feasible in certain cases.

Terminal alternative for Mac OS X

Terminal is part of the developer/administrator’s day to day tasks. Mac built-in terminal lacks features and the followings are the alternative I am using

  • iTerm2 – a terminal emulator of OS X that does amazing things
  • HyperTerm – JS/HTML/CSS Terminal

Bonus

If you want to learn terminal commands, head to Command Line Fu

Books

Other list