Justin Cooney

Web Development Tips and Examples

  • Problems can happen if users enter a Shortname for a site URL instead of the FQDN (Fully Qualified Domain Name). For example if a user types the URL as http://abc instead of http://abc.example.com, then the site certificate can come back as invalid, resulting as an error message or login prompt for the end user. Better to compensate for that by redirecting users to the FQDN if they enter the Shortname by accident.

    (more…)
  • After installing and quickly uninstalling some software on my Ubuntu machine I saw an error on each boot saying: linux the list of sources could not be read. 

    It also included the name that was causing the problem abc.list. In my case it was a file called waydroid.list that was causing the trouble after I had tried installing their software but realizing I didn’t want it.

    To see the problem that’s happening you can open a command prompt and type:

    sudo apt-get check

    This should show some details of the problem.

    To debug:

    in Ubuntu open a command prompt and write:

    ls /etc/apt/sources.list.d/

    Now you should see a list returned including the offending .list file. In my case if was waydroid.list

    To remove this list you’ll need to type its path. In my case the removal statement was like this:

    sudo rm -r /etc/apt/sources.list.d/waydroid.list

    Once this is complete you can check that the problem file was removed using this:

    ls /etc/apt/sources.list.d/

    After this once you reboot, the problem should be gone. At least that was my experience and it worked very well.

  • It seems like a simple task, but can end up being a bit tricky depending on how you write your code. I’ve seen a lot of examples of getting the start date and end date for a month but a lot of them are inaccurate or even incomplete and fail to take certain situations into account. In this article I’ll go through an example of playing around with getting the start day and end day of the previous month along with finding the right starting and ending times.

    (more…)