Category Archives: Linux

Linux is a family of free and open-source software operating systems built around the Linux kernel. Typically, Linux is packaged in a form known as a Linux distribution for both desktop and server use.

SSL Certs

Issuing SSL Certs using Let’s Encrypt in Ubuntu

Issuing SSL Certs Overview

This Video goes over Issuing SSL Certs using Let’s Encrypt in Ubuntu 16.04. The basic steps outlined in the video are adding the repository, installing certbot, issuing a certificate, and enabling SSL.

Links

Let’s Encrypt @ https://letsencrypt.org/
Certbot @ https://certbot.eff.org/

Command List for Issuing SSL Certs

sudo apt-get update
sudo apt-get install software-properties-common -y
sudo add-apt-repository ppa:certbot/certbot
sudo apt-get update
sudo apt-get install python-certbot-apache -y
sudo certbot --apache

Finishing Up

After performing these steps you will make your site secure and it will automatically renew this certificate. This is a great set it and forget solution, expecially if you are running your own site on a budget.

Leave any Questions and Comments below and I’ll get back to you. I regularly publish on YouTube, Steemit, and christitus.com so if you’d like to see more videos please like, subscribe, and follow me.

Linux Subsystem

Installing Linux Subsystem for Windows 10

Linux Subsystem Overview

The following video goes over installing Linux Subsystem on Windows 10. Most notably it allows you to run Linux terminal commands in Windows 10 without having a virtual machine or dual boot into a Linux operating system.

Enable Linux Subsystem Feature

cd ~
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

Note: Perform in PowerShell

PowerShell Installation Method

Invoke-WebRequest -Uri https://aka.ms/wsl-ubuntu-1604 -OutFile Ubuntu.appx -UseBasicParsing
Rename-Item -Path ~/Ubuntu.appx -NewName Ubuntu.zip
Expand-Archive ~/Ubuntu.zip ~/Ubuntu cd Ubuntu ./ubuntu.exe

Microsoft Store Installation Method

  • Open the Microsoft Store
  • Browse to Ubuntu-1604 and subsequently click the Install button

In Closing

The Linux Subsystem is a welcomed addition to Windows 10 because most things that come from the Microsoft store are garbage. Above all using this will give you the ability to check out and compile many GitHub projects. It is now one of the first options I enable when I do fresh installs of Windows 10 due to the fact Linux is not practical all the time.

Leave any Questions and Comments below and I’ll get back to you. I regularly publish on YouTube, Steemit, and christitus.com so if you’d like to see more videos please like, subscribe, and follow me.

Always on VPN

Setup an always on VPN in Ubuntu

Always on VPN Overview

This is a guide on how to set up an always on VPN in Ubuntu, and basic troubleshooting of VPNs in ubuntu server. I used Private Internet Access as an example VPN connection.
Use my affiliate link to get a Private Internet Access VPN: http://www.privateinternetaccess.com/pages/buy-vpn/christitus. This is a must-have for a dedicated Linux box specifically for privacy concerns.

Setup VPN in Ubuntu – No Commentary

Setup VPN in Ubuntu – With Commentary

VPN setup commands:

sudo su
apt-get install openvpn -y
cd /etc/openvpn
wget https://www.privateinternetaccess.com...
unzip openvpn.zip
rm openvpn.zip
nano .secrets
###PASTE YOUR INFO### p1234567
###PASTE YOUR INFO### MyPIAPassword
chmod 600 .secrets
mv 'US Texas.ovpn' texas.conf
nano texas.conf
###CHANGE THIS LINE### auth-user-pass .secrets
systemctl start [email protected]
systemctl status [email protected]
nano /etc/default/openvpn ###UNCOMMENT AUTOSTART
reboot

Diagnostic Commands

Use the following commands for diagnostics of VPNs and testing them, most notably is finding the external IP as that is needed to make sure it is working. If your VPN is failing to connect I recommend using tail on the syslog so consequently, you can find any issues that are stopping the connection.

###Extra Tools###
Find External IP: dig TXT +short o-o.myaddr.l.google.com @ns1.google.com | awk -F'"' '{ print $2}'
Debug as necessary: tail -f /var/log/syslog|grep ovpn

In closing, make sure you always use a VPN when you are concerned about your privacy. I’ve also set these up on Linux boxes between offices and it makes for a great inexpensive site-to-site VPN. Therefore, you don’t have to spend tons of money on proprietary gateways that go out of date in a couple years.

Leave any Questions and Comments below and I will get back to you. I regularly publish on YouTube, Steemit, and christitus.com so if you’d like to see more videos please like, subscribe, and follow me.

Moving servers to Google, Amazon, or Microsoft.

Your Current Environment

The following article outlines what moving servers to Google Cloud Compute, Amazon Web Services, or Microsoft Azure means. Most businesses want to move to the “cloud” but have no idea what that means. If you’re a small business you typically have a couple computers scattered around with one storage device. If you’re a medium or large business you probably already have several servers at a location in a contract. Moving to the cloud is often pitched to businesses using Software-as-a-Service replacing the current system with a web application that runs through your browser. While this is ideal, in most instances it isn’t practical. So you keep paying for a bloated IT infrastructure that is dated, isn’t as reliable, and unable to change with your business needs.

The Solution

Leverage Google Cloud Compute, Amazon Web Services, or Microsoft Azure to move those servers to an enterprise environment. In all businesses, moving your servers will often end up costing between $100 – $400 per server a month depending on your environment and space requirements. When you factor in that there is no capital expenditure, maintenance, or power costs this is a far cheaper solution than your current environment. You also gain a SUBSTANTIAL increase in flexibility, performance, and reliability. So why hasn’t everyone transitioned to these services?

Migration Pains

The main issue is getting to these services. It’s hard to find businesses, technicians, or engineers that will do the migration. The reason for this is very simple… for employee’s they are afraid that their job will no longer be needed, for external help, it is too risky for them to take on the task with a very little reward at the end. So it is finding and hiring the right people to do this. In the end, you should be paying these companies directly.

Pitfalls

  1. Contracting a company that uses their own hardware and you pay them for substandard service and equipment on a monthly basis.
  2. Not understanding the extended downtime that is required for moving to these services. If you have 30+ servers it will take months for preparation, transfer time, and deployment.
  3. Degraded service if you have to work in a hybrid environment. This applies to large migrations, where you have servers with a cloud provider, and local servers connected through a VPN for the extended time it takes to complete the full migration.
  4. Mass Storage – Most of the cost of using these services come from storage, and typically it’s not till you hit the petabytes that you’d run into ROI issues. As a general rule of thumb, anything less than 1000 Terabytes is more cost-effective using these services.

Conclusion

I think every business should be leveraging this technology. The larger the business the harder the migration will be. Small businesses I’ve done in the course of a day, whereas larger businesses take considerably longer. Stay the course and keep searching for talent capable of helping with this transition. As far as personal preference I enjoy using all three of these major players in the market, but for Website Hosting and Linux boxes I like Google Cloud Compute the most, and for businesses already running Office 365 and Windows Server 2008+ Microsoft Azure makes for the easiest transition.

swapfile

Create Swap file on Cloud VM (AWS, GCloud, or Azure)

Use the commands below to create a swap file on a micro instance on cloud providers or a basic Linux operating system. This creates a 2GB Swap file to help alleviate low system ram.

Run the following from your SSH window
sudo fallocate -l 2G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
sudo swapon -s

then change fstab (/etc/fstab) so it automatically mounts your swap file on startup
/swapfile none swap sw 0 0

FTP Credentials Required for AWS Wordpress Update to Plugins/Themes

If you are getting errors on a WordPress update that say you need FTP credentials, your apache install doesn’t have rights to do the changes. You could install vsftpd, but it is MUCH easier to just grant apache access to your WordPress:

sudo chown -R apache:apache path/to/wordpress

Here is the syntax I used for my ec2-instance

sudo chown -R apache:apache /var/www/html/