Wednesday, November 28, 2018

Ubuntu 12.04 post upgrade process with Zend Server and Zend Framework 1

After upgrading Ubuntu Server to version 12.04, your web application based on ZendServer will stop working. The reason is that newly upgraded Apache 2 web server is incompatible with your Zend Server. So if you don't want to go through a painful process of compiling the right version of Apache 2 to work with your Zend Server, you can instead remove the Zend Server and just use the Zend Framework. You will lose the goodies of Zend Server - but if sole Zend Framework is enough to run your site, these steps will get you there. Note that these instructions apply to Zend Framework 1.

Remove Zend Server

sudo apt-get remove zend-server-ce-php-5.3

Backup apache configuration

cd /etc/apache2/
mkdir ~/apache2-backup
cp -R * ~/apache2-backup/

Get rid of any remnants of previous installation of php5 and Zend Server

sudo apt-get remove php5
sudo apt-get autoremove

Install php5 (plus optional extensions)

sudo apt-get install php5 php5-mysql php5-gd

Download and unzip Zend Framework 1 to shared location

sudo cp /usr/local/zend/share/
cd /usr/local/zend/share/
sudo unzip
sudo rm

Include path to the Zend Framework in /etc/php5/apache2/php.ini

include_path = ".:/usr/share/php:/usr/local/zend/share/ZendFramework/library"

In my case I also updated these variables in /etc/php5/apache2/php.ini

post_max_size = 32M
upload_max_filesize = 32M

As a side note to the Ubuntu Server 12.04 upgrade, I also had to modify my Apache 2 configuration in ssl-default file to change ServerName from .local to fully qualified domain name like I also added ServerAlias

Friday, August 3, 2018

DNS Installation and Configuration on Ubuntu Linux

  • Prerequisites for our configuration:

    • 2 servers, one for primary DNS, the other for secondary DNS
    • server 1 - primary DNS
      • static IP
      • gateway
      • DNS,
      • hostname ns in file /etc/hostname
      • entry ns in /etc/hosts
    • server 2 - secondary DNS
      • static IP
      • gateway
      • DNS,
      • hostname ns2 in file /etc/hostname
      • entry ns2 in /etc/hosts
  • Install bind9 DNS server software:

    sudo apt-get install bind9 bind9utils bind9-doc
  • Verify content of named.conf. This is the primary configuration file for the bind DNS Server. It usually contains only includes of other configuration files.

    cat /etc/bind/named.conf

    Default content:

    include "/etc/bind/named.conf.options";
    include "/etc/bind/named.conf.local";
    include "/etc/bind/named.conf.default-zones";
  • Edit named.conf.options:

    sudo nano /etc/bind/named.conf.options

    The example of the file. The acl clause allows fine-grained control over what hosts or users may perform what operations on the name server. Within the goodclients block, list the IP addresses or networks that should be allowed to use this DNS server. Block forwarders contains the IP addresses of the recursive name servers that we want to forward requests to. We will use Google's public DNS servers ( and

    acl goodclients {
    options {
            directory "/var/cache/bind";
            recursion yes;
            allow-query { goodclients; };
            forwarders {
            forward only;
            dnssec-enable yes;
            dnssec-validation yes;
            auth-nxdomain no;    # conform to RFC1035
            listen-on-v6 { any; };
  • Make a copy of local zone configuration template. The new file will hold our zone configuration.

    sudo cp /etc/bind/db.local /etc/bind/
  • Define zone in named.conf.local file and point to your newly created zone file

    sudo nano /etc/bind/named.conf.local

    The zone definition should look like this:

    zone "" {
      type master;
      file "/etc/bind/";
  • Configure your zone definition file

    sudo nano /etc/bind/

    The following is zone configuration example. NS entry type identifies the nameservers. The ns, ns2, archive, and mirror entries map the subdomain names to the IP addresses. $TTL entry dictates timeout for the DNS cache (in seconds). After the timeout, the DNS entries are reloaded again.

    ; BIND data file for local loopback interface
    $TTL    604800
    @       IN      SOA (
                                2         ; Serial
                           604800         ; Refresh
                            86400         ; Retry
                          2419200         ; Expire
                           604800 )       ; Negative Cache TTL
            IN      A
    www     IN      A
    @       IN      NS
    @       IN      NS
    @       IN      A
    @       IN      AAAA    ::1
    ns      IN      A
    ns2     IN      A
  • To apply the new configuration, restart the DNS server:

    sudo service bind9 restart


File /etc/nsswitch.conf contains order of preference in using hosts file and DNS. In our scenario, we use DNS first, then the hosts file:

  hosts:          dns files

Sunday, January 3, 2016

Breaking apart A/C controller unit

Microcontroller ATMEGA329PA (32KB rewritable flash, 2KB RAM) 

This is new to me: the backlight reflection panel (white)