dah85.com

*not* just another blog ;)

I recently signed up for a shared hosting package from Alpharacks which has the following specs:

Shared Hosting Special #1: - 15 GB Space - 200 GB Monthly Bandwidth - 1 Hosted Domain - Shared IP address - cPanel Control Panel - Softaculous Auto-Installer - LiteSpeed Web Server Powered - CloudLinux Optimized - DDoS Protection Included - Instantly Activated - $0.99/year (you read it right, 99 cents per year, price never goes up, there is no catch! Perfect plan for those looking to start a website) ORDER NOW

99 cents.. wow!

I'll be honest, my expectations are extremely low at this point. But for less than $1 what the heck, I'll try it out, even if I never use it.

After my experiences with Woothosting's cheap servers, I'm a little skeptical about anything cheap. So, the first thing I did was log into cPanel and look at the server stats.

Here's a screenshot: Vital stats from cPanel

Key points:

  • 21 load on an 8 core/thread server means it's about to go into meltdown.
  • 40% memory usage is actually very reasonable.
  • Swap is 100%... wait.. why are they swapping when there's plenty of RAM available.. hmm..
  • The disk is 97% full (or is that 3% empty?)
  • At least the tmp folders have room to breathe.

Okay, so we could pick on the server due to it's stats, but in practice that's not a reliable indicator of real world performance.

I have performed a few tests to see how it actually handles.

  • I installed Wordpress (which is pretty resource hungry, exactly why I don't use it on this blog) and it actually works great! I have had no issues loading it up by installing themes and plugins galore. I didn't expect that to work as well as it did to be honest!
  • The server seems to be hosted in LAX, which means I should be able to get a decent speed from here in Australia.
  • I'm able to max out my 100mbit NBN connection both uploading AND downloading. Here's the test file I uploaded if you want to check it for yourself.

No complaints really, it actually seems stable!

I'm hosted on their "latitude" server, which seems to be dedicated to this particular cheap offer. I can see the server is well used (and abused) but it's solid. It actually defies logic.

For 99 cents a year it'd be an absolute bargain even at twice the price.

Would I host something critical like a business website? Probably not.. I would definitely recommend this for anyone who is running a small hobby site where potential downtime isn't an issue.

Compared with Woothosting, this is amazing. Check out my review of Woothosting's shared hosting for reference.

If you want to get in on this Alpharacks deal, click here.

Proxmox allows a lot of powerful options when it comes to shared file systems, but nothing could be simpler than using sshfs and adding the directory to Proxmox as a storage option for backups, VMs and ISOs.

In my case, I have 2 Proxmox servers and a 3rd server running Ubuntu which I would like to store backups on.

I my 2 Proxmox servers which are an i5 and an i7 from SerweryDedyKowane.pl which are both hosted on the same network in Poland, and the backup server is an i5 V-Dedi from Wishosting which is hosted in Canada.

Here's what I did:

First, I set up sshfs to point to the storage on the backup server.

In this example, I have set up sshfs on both Proxmox servers. So, on each Proxmox server there is a folder called /mnt/remotebackup which is where I'd like to store my backups.

In the Proxmox UI, we need to click on Datacenter then click on Storage. From there, we need to Add a Directory.

  • I gave mine the ID of remotebackup
  • For Directory, I put in /mnt/remotebackup which if you're following this example, feel free to change to what you're using.
  • For Content, I have selected VZ Dump Backup File which allows me to store backups there. I have not tried using it to store anything else, but I plan to test that out at some stage.
  • Nodes are set to all, Enabled set with a tick, same with Shared.
  • I have set Max Backups to 5, but you can change that as you wish. This is the number of copies of the backup it will keep before it starts deleting the old ones to make room for new ones.

Now that we have that set up, on BOTH Proxmox servers (In my case, it actually copied across by itself so you may only need to do it once, but if not, do it on all the other Proxmox servers) - we can start using the storage.

To verify that backups will work, I will select a VM, and then go to the Backup tab and click on Backup Now - on this screen make sure that Storage is showing the new storage we made, in my case it's called remotebackups

Go ahead an make a backup, it'll take a little while depending on the size of the VM but it will be stored on the remote server.

Neat eh?

Setting up SSHFS

- Posted in Quick Tip by with comments

Today I will be setting up SSHFS, which will allow me to mount a remote folder as a local folder by using SSH.

In this example, I will be creating a folder called remotestorage which will link to a remote folder on a remote server.

First thing we need to do is install SSHFS:

sudo apt update & apt install -y sshfs

Then we need to create the local mount point, just like this:

sudo mkdir /mnt/remotestorage

Now, we can manually mount the remote folder:

sudo sshfs -o allow_other [email protected]:/ /mnt/remotestorage

Log in as requested, and you should be able to see the contents of your remote folder.

If you want to unmount, we just need to do this:

sudo umount /mnt/remotestorage

It's possible to have it automatically mount when the system starts, but it's a bit of a security risk and I wouldn't recommend it.

Remove a node from Proxmox 5

- Posted in Quick Tip by with comments

I have a Proxmox cluster set up using a few dedicated servers on the same network. I have decided to downsize my cluster and remove 2 of the nodes, leaving only 2 behind.

Normally, to remove a node from Proxmox it's a simple matter of shutting down the node to be removed and then on one of the Proxmox cluster members, removing it like this:

pvecm nodes

That will list the nodes in the cluster

pvecm delnode <nodename>

Which will remove it from the cluster.

However, when I went to do that I was given an error:

cluster not ready - no quorum?

Ruh roh! A simple fix is to let Proxmox know that there are only 2 servers left in the cluster, therefore the number of "votes" the quorum needs to do things will be set.

pvecm expected 2

Then try pvecm delnode again:

pvecm delnode testnode3

The output you will see if succesful will be similar to this:

Killing node 3

To remove them from the web UI, we need to delete the folders like this:

rm -rf /etc/pve/nodes/nodename

And we're done :)

I have a solution for the annoying issue you may encounter when using a Raspberry Pi with a USB mouse (both wired and wireless) where the mouse movement seems either jerky, laggy, erratic, slow, laggy etc.

What you need to do is take the SD card out of the Pi and put it into your main computer, and then open the BOOT partition, then look for a file named:

cmdline.txt

You will see a line in that file, what we need to do is add the following to the END of that line. NOT on a new line. It must be at the end of the line:

usbhid.mousepoll=0

Save, and safely unmount or eject the SD card. Pop that back into the Pi and boot up, you should have nice mouse movement now :)

A quick tip so that I don't forget this again. By default, VestaCP will set directories to disallow listings, for example, example.com/files would show a 403 error instead of listing the contents.

Sometimes, though, it's desirable to have a list shown to the user, so all we need to do is create or modify the .htaccess file in the top level folder.

For example, in /home/user/web/example.com/public_html/files/

nano .htaccess

Add the following to ALLOW listing:

Options +Indexes   

Or to DISALLOW:

Options -Indexes   

Hopefully this also helps someone :)

I'm a kid of the 80's and 90's, and I grew up playing classic games like Commander Keen and Wolfenstein 3D. Back in 1999 I started an Abandonware website called Metal Painkiller Abandonware which was quite popular.

I have decided to share my collection of old DOS and Windows games for you all, which can be found in the top menu of this site or by clicking here.

The games are all full versions, no demos or shareware. They're all named like this: Title (Year) (Publisher).zip

Today I will be setting up SSL certificates for Proxmox 5 so that when you go to the web UI, it will be HTTPS and not using the self-signed cert that comes with Proxmox, which is rather insecure.

I will be doing this with Certbot.

First, we need to install Certbot:

apt install certbot -y 

Now, we need to set up the domain we're using for PVE and obtain a certificate:

certbot certonly

I will be using option 2, to spin up a temporary webserver so that certbot can verify that the domain points to the IP of the Proxmox server.

Now, we need to copy the cert files into the Proxmox directory like this:

cp /etc/letsencrypt/live/**yourdomain.com**/fullchain.pem /etc/pve/local/pveproxy-ssl.pem
cp /etc/letsencrypt/live/**yourdomain.com**/privkey.pem /etc/pve/local/pveproxy-ssl.key

And when that's done, we need to refresh Proxmox so it can be aware of the changes:

systemctl restart pveproxy

You should be able to see that it's now accessing through HTTPS and with a valid certificate - no more warnings :)

We need to make this permanent, so we'll create a cron job to keep it updated and renew the cert as needed:

crontab -e

Then paste the following on a new line:

30 6 1,15 * * root /usr/bin/certbot renew --quiet --post-hook /usr/local/bin/renew-pve-certs.sh

Control-X to exit, Y to save and press Enter to save the file with the original name.

And we're done :)

I'm going to add something extra here because it might apply to you too, but if you're also running VestaCP on your Proxmox server with port 80 and 443 forwarding to your VestaCP server, the certbot method shown will fail - what we need to do is set up the PVE domain in VestaCP first, which will work, then copy the files from VestaCP to Proxmox and then follow the steps. I'll clarify this if someone comments requesting more details.

Note to self: Only use LTS releases

- Posted in Quick Tip by with comments

I, for some reason, had a VM running Ubuntu 17.04 which is not an LTS release. To be honest, I never knew what all the fuss about LTS was anyway.

As it turns out, unsupported means apt doesn't work!

Upgrade to the next distro by doing:

do-release-upgrade

And let it rip. In my case, I was trying to install an FTP server on a VM that was running Ubuntu 17.04 and apt kept saying that there was no release file, also giving me an error about not being able to securely download a list when trying to update.

Setting up FTP backups for VestaCP

- Posted in Quick Tip by with comments

By default, VestaCP will do a daily backup and store it on the same file system that VestaCP is installed on, which isn't great if something happened to that and that was our reason for wanting to restore!

What we're going to do is set VestaCP to backup to the local storage and also an FTP server.

I've already set up my FTP server, so all I need to do next is change the VestaCP config. First, we need to create the config file:

sudo nano /usr/local/vesta/conf/ftp.backup.conf

And then paste the following into it, keeping in mind that you will need to change the options to match your FTP server:

HOST='backupserver.yourdomain.com'
PORT='21'
USERNAME='backupuser'
PASSWORD='[email protected]'
BPATH='/home/backupuser/vestabackup'

Once you've got that done, it's time to let VestaCP know about this, so we're going to edit the config file an add ftp to the list of backup targets:

sudo nano /usr/local/vesta/conf/vesta.conf

Find the line that looks like this:

BACKUP_SYSTEM='local'

And change it to this:

BACKUP_SYSTEM='local,ftp'

Now when VestaCP does its daily backup, it will save it to the FTP server too.