Michael Gagliano

Started from the bottom... and well still here.

Menu Close

Month: December 2016

JS | ASCII Text Display

While attempting to format my console output in hackmud, I found myself spending entirely too long formatting, copy, and pasting ASCII letters directly into a messy echo. I decided to write a script to display ASCII Text dynamically, by supplying an array of ASCII text broken down by row along with an display string.

Initially I attempted to concat strings whole letters at a time and found it too sloppy of a process and ultimately meant a messy output with little flexibility. I settled on taking the ASCII font a row at a time. Utilizing .indexOf() I compared the string letter against a string containing the alphabet and used that value to display the ASCII font. I looped through the display string each row and concated a row together before moving onto the next row. Finally displaying the rows separated by a new line character. I wanted the script to be more flexible allowing for variable width and height letters, so I included 2 parameters defining those dimensions.

I had originally wrote this in a golf friendly way. I have expanded the code slightly for readability, commented it and put it into a JSFiddle for you to explore and test.


FOGProject | Overview Ubuntu 16.04 Common Issues

This morning as I sat down to my desk, I decided to implement an imaging server to the workshop. We stock and deploy plenty of Dells on a regular basis so I was looking for a way to streamline our workflow. I had previous experience with Acronis and Norton Ghost, which were fantastic in a structured corporate environment. However, in a consultant position, they are less valuable and definitely not worth their license costs for my use case. I set out on my Googletrek with three criteria in my mind.

Three Criteria:

  1. Must be open source software, capable of being self hosted on a low-end computer
  2. Must be modular; meaning I am able to alter and augment the capture process and manipulate images afterwards
  3. Include a reporting and inventory system, this will be valuable for audit purposes

I discovered FOGProject and to my delight, it seemed to satisfy all of my criteria. It is completely OSS, with the ability to script and automate certain aspects of the imaging process, and incredibly includes a robust inventory system.  After seeing the vast community resources available, especially this in depth Installation Guide. I decided this was my solution. In my quest for using latest Ubuntu Server available, I caused myself 3 hours of headaches. It was a bad decision, I should have turned tail and installed 14.04. However, my head banging ends in a benefit for you as I’ve discovered the 3 most encountered issues with using FOGProject and Ubuntu 16.04.

Use the Git branch!

Seriously, don’t use 1.2.0. It will not work on Ubuntu 16.04, you might be able to Frankenstein some solution… but don’t do that. It’s quite simple to install FOGProject from Git. Version 1.3.0 of FOG will work on 16.04 within reason.

PHP-5? What’s that?

Ubuntu 16.04 does not have php-5 packages in their default repos and really that’s OK. php-7 has brought vast improvements in both performance and functions, which makes FOGProject just that more efficient. You’ll have to pass some variables to the installer script, but aside from that the developers have corrected the installer script from 1.2.0.

The official wiki suggests you use the -y option, however I prefer to know what my configuration values. I caught an improper IP address while installing on a virtual machine, so it never hurts to verify what your programs are doing.

MySQL WILL make you angry

For some reason I haven’t bothered to debug, MySQL and FOG don’t play well upon initial installation. My guess is that the issues arises from FOG using NO PASSWORD for root. Normally I’d be writing a strongly worded email to the developers, but being this will be used internally for simple OS deployment I’m not too shaken up about it. In order for you to install FOG properly, you will need to open another terminal or SSH session and set MySQL root user to blank.

Note: I encountered a second issue on my second development test. MySQL would not accept a connection period, if this is happening to you and you’ve verified the service is running and you’re root try the steps below:

Aside from these 3 problems, other errors will be mostly unknown. I suggest spending some time troubleshooting and then filing a bug report on their forums. The developers and community are quick to help you diagnose issues. Feel free to leave a comment if you’re still having issues with these issues, I’ll surely try to help you out.