https://karnsonline.com/Ghost 0.11Sat, 15 Dec 2018 13:10:10 GMT60When attempting to use tab completion on my ubuntu 16.04 box running on an AWS EC2 instance I was greeted with the following error in the terminal.

cannot create temp file for here-document: No space left on device with plenty of space left

]]>There are plenty of reasons you might want to use multiple versions of PHP on a server. In my case I needed to set up a staging server that will be used to demo various websites and web apps that have different PHP requirements.

There are plenty of reasons you might want to use multiple versions of PHP on a server. In my case I needed to set up a staging server that will be used to demo various websites and web apps that have different PHP requirements.

The following diagram shows the flow the system will take to segregate the different instances.

TLDR;

All the following steps have been accumulated into a shell script that will get you going.

]]>So you have a beast of a machine running GitLab and your like, "Man I feel like this thing could probably host some static websites too". Well, you're in luck. The following procedures will have you running additional virtual hosts with the nginx server that is installed with the omnibus]]>https://karnsonline.com/omnibus-gitlab-and-additional-nginx-virtual-hosts/3ea31aa1-0edd-4318-989b-f57b5c2125c8Sat, 27 Oct 2018 23:40:02 GMT

So you have a beast of a machine running GitLab and your like, "Man I feel like this thing could probably host some static websites too". Well, you're in luck. The following procedures will have you running additional virtual hosts with the nginx server that is installed with the omnibus version of GitLab.

Result

By adding a line to your hosts file you should now be able to access your newly created virtualhost.

vi /etc/hosts

192.168.1.13 example.com #change the ip to whatever the address is of your gitlab server

Troubleshooting

If for some reason the nginx server does not come back up, you can tail all the services to find out what the problem is with the following command.

gitlab-ctl tail

]]>The Problem

By default, MacOs uses a filesystem format that is not case sensitive Mac OS Extended (Journaled). That means that the directories a and A are essentially the same. This is a problem when working collaboratively with people using Linux or another case sensitive file system.

Real world Example

By default, MacOs uses a filesystem format that is not case sensitive Mac OS Extended (Journaled). That means that the directories a and A are essentially the same. This is a problem when working collaboratively with people using Linux or another case sensitive file system.

Real world Example

Magento uses some wacky theory for storing product images when they are uploaded in case sensitive directories. So the following files would go into the respective directories.

This may not be an issue if you are developing without using Git or some other type of version control (like a maniac). In a collaborative environment where Git is used, when you try to clone or pull the changes to the catalog/product directory it will combine the directories and the site will not be able to find the correct product images.

The Solution

The best solution is to use the Mac OS Extended (Case-sensitive, Journaled) filesystem. You can create a new partition that is case sensitive without much hassle using Disk Utility on the mac.

Convenience

Move your project directory to the new case sensitive partition. For example if you use the ~/Sites directory for projects, you would issue the following command in the terminal.

$ mv ~/Sites /Volumes/Case\ Sensitive/

Create a symlink to the new case sensitive directory so you dont disrupt your workflow.

$ ln -nfs /Volumes/Case\ Sensitive/Sites/ ~/Sites

]]>Lets be honest folks. If SSL encryption is available free of charge and was easy to implement, wouldn't it be foolish not to use it?

Here are some snippets to get you started using letsencrypt on your Ubuntu 16 LTS machine running Apache2.

Certificate Removal

]]>https://karnsonline.com/ubuntu-preload-answers-to-apt-install/a7852772-65e3-4264-a259-39dd29d94701Fri, 16 Jun 2017 14:37:44 GMTWhenever I install a package on a server I always create a bash provisioning script of the process so I can easily reproduce the installation in the future.

One of the roadblocks you may run into while attempting to script an install is answering prompted questions for the install.

Luckily Ubuntu/Debian has a tool to let you store preconfigured answers to those prompts so the process can be completely automated.

The question however I find myself asking however is, what are the variable names that I am allowed to preconfigure so I can preload them.

The only downside I have found is that you must first install the package and answer the prompts so that it will populate the debconf database so you can query the selection variables to write your script.

]]>Tired of a cluttered desktop? Yeah me too.

Execute the following command in your terminal and your screenshots will be stored out of the way in your Documents/Screenshots directory.

]]>Searching the Internet for downloadable content is pretty easy since there are a lot of people out there hosting "files" for their personal use. What they don't know/don't care about is that google is indexing their public apache or nginx webroot.

We can easily search for the public index

]]>https://karnsonline.com/search-for-files-using-google/9c6119e4-b75b-4c63-b798-62223e16d296Mon, 03 Oct 2016 01:45:16 GMTSearching the Internet for downloadable content is pretty easy since there are a lot of people out there hosting "files" for their personal use. What they don't know/don't care about is that google is indexing their public apache or nginx webroot.

We can easily search for the public index of peoples unprotected web servers running on their computers in their homes, and modify the search to look for specific filenames.

]]>https://karnsonline.com/help-me-rhonda/9932c29c-9810-45a7-9ae5-9d2aa636afb3Mon, 03 Oct 2016 01:11:04 GMTLet's face it. We can all use a little help sometimes. Rhonda Helper was born out of a desire to write less code when developing with PHP.

It addresses some common issues and tasks that need to be accomplished when developing in PHP.

]]>https://karnsonline.com/google-places-jquery-plugin/47e96250-9130-4de1-a659-9bb1a9b7ebeeFri, 30 Sep 2016 01:49:31 GMTGetting reviews onto your website shouldn't be difficult. I made the Google places jQuery plugin to give a quick path to showing some reviews on a website based on the google place ID.

]]>I was recently introduced to a tool to help with my web development by giving me some benchmark results. This will allow you to emulate multiple users accessing your site and to verify that the load times are acceptable.

ApacheBench, which is bundled with the standard distribution of Apache will

]]>https://karnsonline.com/untitled/6c7af52b-8848-41f4-8f0a-662cb93c5229Wed, 10 Jul 2013 03:54:00 GMTI was recently introduced to a tool to help with my web development by giving me some benchmark results. This will allow you to emulate multiple users accessing your site and to verify that the load times are acceptable.

ApacheBench, which is bundled with the standard distribution of Apache will let you do some pretty cool benchmarking tasks. And to sweeten the deal if your using a Mac the tools are already installed for you.

Here is an example of its use:

Open a terminal

Applications -> Utilities -> Terminal

$ ab -n 100 -c 10 http://www.google.com/

This will execute 100 HTTP GET requests, using 10 threads (10 requests per thread) to the specified URL, in this example, http://www.google.com

]]>In order to calculate distance between two points on a map you first need to have the Latitude and Longitude of your two locations. This snippet of code is one that I am using when a user registers their address in the sign up process.

It seemed much more efficient

]]>https://karnsonline.com/php-geocode/2397bbd5-ab62-40d2-909f-16037fa9cd43Mon, 22 Aug 2011 01:23:00 GMTIn order to calculate distance between two points on a map you first need to have the Latitude and Longitude of your two locations. This snippet of code is one that I am using when a user registers their address in the sign up process.

It seemed much more efficient to do this geocoding once at registration and store the values in a database rather than request the data with every request the user makes