Quiver by HappenApps

Speaking of documentation – I would like to give a big shoutout to this amazing code/snippets repository App that I am using on all my devices. Say hello to Quiver by HappenApps. Developed by Yaogang Lian (who is an amazingly responsive developer), this app has become a part and parcel of my daily coding routine since they deprecated the Snippets app. Give it a shot!

 

Homelabs, ESXi and Virtual Machines, oh my…

I dabbled in the VPS world before getting a bit disillusioned with how much I needed to spend, in order to get a modicum of performance out of these machines. I initially signed up with a VPS I found on LowEndBox (shoutout to the awesome deals one may find there), but three months hence, I got annoyed by niggling throughput issues, and the upcharge to move to a SSD RAID plan. In the meantime I started to frequent /r/homelab and one thing led to another, and for the last 7 months I have been teaching myself how to host at home.

Specs

So, without further ado, here’s my humble initial setup, while I learn the ropes.

  • Dell Optiplex 9020 with Core i7 4th Gen 3.6GHz
  • 32GB of non-ECC RAM
  • 2x256GB ADATA SSD in RAID 1
  • 8TB Seagate Data Store
  • Intel PRO/1000 VT Quad Port Server Adapter LP PCI-E EXPI9404VT

Admittedly, it’s non-server class hardware, but for my homelab needs it will suffice.

Virtual Machines

On it, I am running VMWare ESXi 6.5, the free version, on which I currently I have  five virtual machines chugging away – all serving their good purpose.

  1. pfSense 2.3.4-RELEASE (amd64)
  2. Web Server – which is hosting this site, as well as sodhis.org, sodhis.net and edvpro.com along with the bevy of subdomains with specialized applications.
  3. Git server – running Gitlab Community Edition 9.4
  4. Oracle XE Server – running the XE (free) Oracle instance
  5. SOLR server – more on this in another post.

To be succinct, pfSense acts as a Router for my home, while separating my Homelab in another VLAN. Also separated into their own VLAN are all the IOT devices around the house – Thermostats, Printers, Refrigerators, etc. And yet another VLAN hosts any guests on a separate WiFi network.

Over the next few months I will detail how I implemented this infrastructure, if not for anyone else, but for me to document it somewhere.

 

Virtualmin and 127.0.0.2 loopback on OpenVZ VPS servers

I’ve gingerly stepped into the world of being a SysAdmin, and what better way to delve into the thick of things than to manage a VPS? To that end I signed up for a great deal at Nodeserve for an unmanaged DDOS protected OpenVZ VPS and have been using my free time in the evenings to set things up. Needless to say I’ve been reaching for that “Reset” button far too often. But here’s a problem that had me flummoxed, and it seems it afflicts the OpenVZ VPS servers.

I set up Webmin (and Virtualmin) on my Debian Wheezy install, after the initial checks it kept detecting and setting the IP to 127.0.0.2. Irritating, because that’s what it keeps trying to insert in the A records for the domain as well. After a bit of searching here’s what I did to fix that problem.

Webmin -> Networking -> Network Configuration -> Network Interfaces

Here’s what I see (thank goodness for the new Webmin skin – HTML5 goodness). The default interface is set to venet0 which defaults to 127.0.0.2, a known Debian hack AFAIK.

Virtualmin and 127.0.02 loopback on OpenVZ VPS Server

In most cases, one would want to use the venet0:0 interface. Let’s fix the issue.

Virtualmin -> System Settings -> Virtualmin Configuration (Networking Settings)

Scroll to the Networking Settings part, and under the field “Network interface for virtual addresses”. In all probabilities the radio is set to “Detect Automatically” or to venet0. Change it to say venet0:0 or whatever your chosen interface may be.

Virtualmin and 127.0.02 loopback on OpenVZ VPS Server

Click “Save”. Virtualmin will prompt you to refresh the configuration, after which it will ask to Update Incorrect IP Address. Go through the screens – there will be no need to change anything at this point, click Change Now to affect the changes, and bob’s your uncle.

Now create Virtual servers to your heart’s fancy.

 

Return of a Titan

No, I don’t just mean yours truly. Although just so much has happened in the interim between the last update and now. For one, we moved across the country, leaving the cold Buffalo winters behind and saying hello to 70F winters in Florida. Ah, the Bay area, with the best beach in the country some 30 minutes away. Stepping into a new city, uprooting our established lives didn’t come easy. We had our shares of ups and downs. Emotional highs and crushing lows. But we’ve come out better for it. A new house, a fresh, sunny outlook on life. Living in a City finally, with City amenities and City traffic. A new job doing what I love best, in a University and department I love! Back to the world of PHP and MVC.

A few changes under the hood though.

Thanks to “Let’s Encrypt”, this blog and all my sites are now SSL secured. I can’t laud this project enough. Free SSL certs for three months? Come on. But I do concur with the premise – there is really NO reason to be out in the open, sans HTTPS anywhere, anymore. What, or when are we? Back in the early 2ks?

I am reacquainting myself with an old friend “Blogo”. It was a fun app I used back in my 10.5-10.6 days to publish my blog posts here. I bought it back then, only to see them disappear along with my enthusiasm for blogging. They are back now on the MAS, and much more polished than before. Blogo v2 if you please.

Having espoused the responsive world, I am doing it right this time. Here’s to a wonderful new start.

 

Using Composer in shared hosts with allow_url_fopen off.

(AKA Using composer on hosts where one may not have root privileges).

Due to the nature of the servers used by a few clients, I found myself scratching my head on how best to use Composer on these shared hosts. I hate having to require files from all over the place, it just rubs me the wrong way. Some projects just don’t lend themselves to a full blown MVC solution, and for those, a relatively quick way to get up and running is Composer. However, due to the restrictions placed by shared hosts, PHP might not be compiled with the allow_url_fopen=on. That causes an issue with installing and using composer.

Here’s a quick way to get started for such hosts. This is assuming that you have access to the server via SSH.

Install Composer in the project folder via the terminal, while SSH’d into the remote server (to pull in dependencies and for autoloading components)

Create a composer.json file within the root. Initialize it as an empty JSON file with

Run composer install via the terminal.

Make edits to the composer.json file.

Make the server re-read the composer.json file by executing the following in terminal. Check the vendors directory to see whether the namespace is pointing to the right directory for the source.

Confirm that it works by pulling in the autoload.php and prefixing all the class instantiations with the namespace.

And Bob’s your uncle. That went well right? If not, and you are getting the dreaded “Class not found” error, most likely you didn’t name your class file, exactly like your class name.

Needs to be in User.php. Not user.php or uSer.php.

 

Excellent primer on Git

I must admit I have been living under a rock. I started off with SVN back in 2009, and have been using it faithfully for years now (six and counting). What was all the rage back then, soon lost its favor come the 2010s, but due to SVN being bundled with XCode, I continued to use it on my Mac, and Mac Server.

I resisted the urge to go to Git, and leave the warm, welcoming belly of SVN – mainly because of how well integrated SVN had become with my daily workflow (Sublime Text 3 + SVN plugin = effortless work).

But I recently came across an excellent free primer written for Git by Sean Fioritto  He is a prolific tech writer who maintains a great site with Angular JS tutorials and resources and much more. This primer goes over the essentials of getting started with Git on OSX and Windows. It took me only 20 minutes and I was a convert. Sure, I would need the terminal open alongside, but the amount of control I get in return is addicting!

I do agree with Sean, the GUI for Git (even SVN) adds much more complexity than is required for a day-to-day coding endeavor.

Check the pdf and judge for yourself. Thanks for providing such a great resource Sean!

 

Making my way back…

It has been too long of a break. What was meant as a sojourn turned into something near permanence. I remember my last post here. It was the day that Steve Jobs died. After his death, it was difficult to muster up the same enthusiasm and fervor for Apple and Apple products/software. Yet nearly four years since his passing, my fervor for all things Apple continues. A bit tempered but mostly unabated.

A lot has happened in the interim. New web technologies have risen, new stacks, frameworks. LAMP is so 2012, MEAN is where it’s at now. Front-end design and development has undergone a radical shift. Minimalism is in, skeuomorphism is out. Responsive is the mantra. Anything that doesn’t scale, might as well have scales (a la dinosaurs).

And so, I mark the renaissance of this space. Imparting knowledge and wisdom I’ve gained through the storms I have weathered, developing and leading development for the last ten years.

I will slowly yet surely reimport all the old content from timothevs.net. Some of the articles were the only resources on the web at the time. It will be fun, if only for nostalgia’s sake.

To reuse an oft abused phrase – Tally ho!