SSH and Firewalls

So working from home just became a bit easier. Back when I used a windows machine it was a piece of cake. Login to the VPN, and remote desktop to my computer and then I could work. It was awkward, but it was doable.

Fast forward to moving to Ubuntu and I knew I could ssh in. But in the process of setting up the Linux box I forgot I installed ufw as a firewall and never set it up to accept ssh.

I knew I could do it. I had installed the ssh server. I set up the ssh key and all that and still I was a no go.

It all came down to ufw blocking my port. Oops. But a quick google search, and my laptop can now successfully SSH into my work computer while I’m on the VPN.

My next step in working from home will be the ability to view the dev intranet environment on my computer at work while editing in nano. I suppose I could set up mssql drivers on my laptop as that’s really the only thing stopping me from just doing it fully on my laptop.

Dev Env #3

I love Laravel Mix. The ability to compile everything without having to know all those front end tools makes my life so much easier. Sadly it didn’t work straight out of the gate on Code Anywhere.

I had to update node in order to get it to work properly.

curl -sL | sudo -E bash -
sudo apt-get install nodejs
sudo apt-get install build-essential

And then npm run dev worked piece of cake.

Thanks to Digital Ocean for that help.

Dev Env #2

Posted about the basic set up yesterday, but while I was trying to view the site on the dev environment found a few other little problems going on. One Apache was still hooked into php 5 which no longer existed, and after fixing that there was a missing permissions in that original post – which if I had done my usual laravel install I would have followed.

So in addition to the post at Tildee you have to do a few more commands. In order to simplify the resource I’m going to post all the commands (and their corrections) here.

In the Code Anywhere terminal (or if you’ve ssh’d into from your computer)

sudo apt-get update
sudo apt-get install npm

sudo apt-get purge php5-common -y
sudo apt-get install software-properties-common python3-software-properties
sudo apt-get update
sudo apt-get autoremove

sudo apt-get install -y language-pack-en-base
sudo LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php7.0 php7.0-common php7.0-mysql php7.0-mbstring php7.0-zip php7.0-xml

curl -sS | sudo php -- --install-dir=/usr/local/bin --filename=composer

sudo a2dismod php5
sudo a2enmod php7.0

Go back into the IDE and delete the current directories and files i.e. larval application by right clicking on it and delete DON’T delete .htaccess. As a side note, don’t remove everything in the directory with a terminal command, you delete some codeanywhere files (I’m assuming) that make ‘running the project’ work. (I had to redo this entire setup because I did just that).

Now you can install Laravel per your favorite method.

Dev Environment

I typically develop at work so my system is pretty standard, but I like to code and learn new things everywhere so I try to keep that learning stuff to some sort of online environment so I can do it at both home and work. I typically use Cloud 9 IDE, but Codeanywhere has been looking pretty good lately so today I went ahead and started using it for my current home grown project and to learn more about TDD, Laravel 5.4 and Vue. Considering throwing Spark in, but I think I’ll stick with straight Laravel for now.

Laravel in the future will requires PHP 7 so I wanted to cut that out of the upgrade process for now. I could install that with CentOS, but I’d prefer to stick with Ubuntu since that’s what I use at work and would likely use if I could dual box my machine at home without worrying I’m going to lose information (I’m highly paranoid!!!) I had to upgrade the default install. Which actually was pretty easy with the nice handy guide over at Tildee. There was only one caveat: I had to use php7.0-xml instead of php-xml as composer gave an error for phpunit.

The upside to using Codeanywhere is it has a mobile app – so I can at least use it to some degree on my phone when I’m not at home and bored.