dah85.com

*not* just another blog ;)

Getting Steam to work in Manjaro Linux

- Posted in Quick Tip by with comments

This is a quick tip to remind myself (and others) that even though Steam appears to be installed in Manjaro Linux, it won't open.

Running these commands fixes that issue:

find ~/.steam/root/ \( -name "libgcc_s.so*" -o -name "libstdc++.so*" -o -name "libxcb.so*" -o -name "libgpg-error.so*" \) -print -delete

and

find ~/.local/share/Steam/ \( -name "libgcc_s.so*" -o -name "libstdc++.so*" -o -name "libxcb.so*" -o -name "libgpg-error.so*" \) -print -delete

After that, start Steam and it should start updating and work :)

Installing a minimal GUI on a KVM server

- Posted in Quick Tip by with comments

Recently I have found myself needing to install a very basic, light GUI on top of an otherwise blank Ubuntu Server system. This lead me to the following command, which will install the lightweight desktop environment LXDE along with the bare minimum that's needed to run it.

sudo apt install --no-install-recommends lubuntu-core

After that, we'll need a way to actually load the GUI so we need to install xinit. If you don't do this, when you type startx it will warn you to do this anyway.

sudo apt install xinit

Reboot and it will now show you the GUI login screen.

Logging in shows that there is a GUI and nothing else installed except a terminal, a file manager and desktop settings.

Spending more time with HostHatch VPS

- Posted in VPS by with comments

In my last post, I introduced you to the HostHatch VPS deal I found, which is located in my home country of Australia.

Since getting that VPS set up and doing the usual, it's actually proved to be quite useful for a couple of reasons.

Firstly, it's local to me, and the pings are the lowest of any of my VPS services. This low latency makes it perfect for using with Iodine DNS tunnelling, which is something I plan to write about in the future.

The other thing which is particularly useful to me is the fact that I can serve my wife's photography website from it, allowing her clients a much better connectivity than running from a US hosted Woothosting reseller plan.

Even this blog is powered by the VPS too.

Funny enough, this VPS is serving my needs perfectly which I did not really expect.

Reviewing a HostHatch Sydney VPS

- Posted in VPS by with comments

I came across a pretty good deal on an Australian VPS located in Sydney. I live in Australia so I thought this would be a good way to test out a local VPS to see if I can possibly get some better speeds.

256MB RAM
256MB vSwap
2x vCPU
30GB SSD
1TB transfer
1Gbps uplink
1x IPv4
/96 IPv6
OpenVZ/SolusVM
[$8/quarter][1]

Not going to set any speed records, that's for sure and it's not going to be useful for storage, but it may possibly be a cheap way to host a few local business websites as an alternative to shared hosting. I would also have the benefit (or burden, however you look at it) of having full control over the system.

As always, I've done some benchmarks.

CPU model:  Intel(R) Xeon(R) CPU E5-2620 v3 @ 2.40GHz
Number of cores: 2
CPU frequency:  2400.147 MHz
Total amount of RAM: 256 MB
Total amount of swap:  MB
System uptime:   33 min,       
I/O speed:  300 MB/s
Bzip 25MB: 5.46s
Download 100MB file: 27.3MB/s

Nice IO and CPU speed there, and the speed test isn't bad. Let's wait a bit and try some more.

CPU model:  Intel(R) Xeon(R) CPU E5-2620 v3 @ 2.40GHz
Number of cores: 2
CPU frequency:  2400.131 MHz
Total amount of RAM: 256 MB
Total amount of swap:  MB
System uptime:   3 days, 22:48,       
I/O speed:  490 MB/s
Bzip 25MB: 6.19s
Download 100MB file: 1.49MB/s

Nice IO, CPU and horrible network. I have 100mbit VDSL at home, and during peak times it crawls down to a single http stream at around 40 or 50 kilobytes per second. Seems like maybe it's not just my ISP affected by that. Let's try it again later..

CPU model:  Intel(R) Xeon(R) CPU E5-2620 v3 @ 2.40GHz
Number of cores: 2
CPU frequency:  2400.131 MHz
Total amount of RAM: 256 MB
Total amount of swap:  MB
System uptime:   8 days, 2:54,       
I/O speed:  522 MB/s
Bzip 25MB: 5.93s
Download 100MB file: 206KB/s

It makes me feel a little bit curious about the fact that a server hosted in a data centre has as good a connectivity as my consumer VDSL connection does.

Aside from the network issues, which are an artefact of the state of Australia's Internet connectivity, this VPS performs very well and has been useful for serving up web pages, which is great since I get a 50ms ping to this VPS from home and on average around 200-300 on overseas ones.

I need to migrate my nextCloud over to another server, which I will review later and maybe even document my experience migrating a nextCloud setup.

-Dave

Setting up LetsEncrypt free SSL

- Posted in Quick Tip by with comments

Today I will be installing and automatically renewing a free SSL certificate with LetsEncrypt.

Here's what I would do for the domain dah85.com

apt-get install nano python-letsencrypt-apache
letsencrypt --apache -d dah85.com
letsencrypt --apache --expand -d dah85.com -d www.dah85.com
letsencrypt renew
crontab -e
1 1 * * 1 /usr/bin/letsencrypt renew >> /var/log/letsencrypt-renewal.log

Done :)

This also sets up SSL in Apache for things like nextCloud if it's not already set up.

EDIT 0: If it complains that letsencrypt does not exist when installing, try installing python-certbot-apache instead. I found this happens in Ubuntu 17.04.

EDIT 1: Someone kindly pointed out that www.dah85.com didn't work, so I added the command "letsencrypt --apache --expand -d dah85.com -d www.dah85.com" after it and that fixed it :) Thanks Chris!

-Dave

Benchmarking a Linux machine

- Posted in Quick Tip by with comments

When I'm playing with a new VPS, the first thing I like to do is run a benchmark to see if I've got a good deal.

Running this in a terminal will start the benchmark (only need to install time and bzip2 once)

apt-get install time bzip2
bash <(wget --no-check-certificate -O - https://raw.github.com/mgutz/vpsbench/master/vpsbench)

You'll get an output similar to this

CPU model:  Intel(R) Xeon(R) CPU E5-2609 v3 @ 1.90GHz
Number of cores: 1
CPU frequency:  1897.804 MHz
Total amount of RAM: 1024 MB
Total amount of swap:  MB
System uptime:   6 min,       
I/O speed:  58.2 MB/s
Bzip 25MB: 6.76s
Download 100MB file: 34.2MB/s

Just got this new toy, off to play with it ;)

-Dave

Setting up UFW for the first time

- Posted in Quick Tip by with comments

Securing a Linux machine is always a good idea, and here's the simplest way to do it.

First, install ufw and check the status. It should be disabled by default.

apt-get install ufw
ufw status

Second, we will enable the default rules which will be to block all incoming and allow all outgoing.

ufw default deny incoming
ufw default allow outgoing

Now for specific ports to open. Here I will allow SSH (22), HTTP (80) and HTTPS (443), webmin (10000) and seafile (8000)

ufw allow ssh
ufw allow 80/tcp
ufw allow 443/tcp
ufw allow 8000/tcp
ufw allow 10000/tcp

Now we enable it, and then check the status.

ufw enable
ufw status

To disable it.

ufw disable

To reset back to default

ufw reset

And that's it, all incoming traffic is blocked except what has been explicitly allowed, and all outgoing traffic is allowed.

-Dave

Setting up virtual hosts in Apache

- Posted in Quick Tip by with comments

This is the first in a series of quick tips that I will write up. These mainly serve to refresh my memory when I do the same thing a few times but can't quite remember the exact thing to do.

Today, I set up 2 different virtual hosts in apache:

host1.dah85.com host2.dah85.com

To accomplish this, I first created A entries for those hosts and pointed them to the IP of the web server, which in this case is a VPS for testing with.

Once that's been done, we just need to create the directories that the sites will live in, and then set up the configs.

sudo apt-get update
sudo apt-get install apache2
sudo mkdir /var/www/host1.dah85.com/public_html
sudo mkdir /var/www/host2.dah85.com/public_html
sudo chmod -R 755 /var/www
sudo chown -R www-data /var/www
sudo nano /etc/apache2/sites-available/host1.dah85.com.conf
sudo nano /etc/apache2/sites-available/host2.dah85.com.conf

Contents of host1.dah85.com.conf

<VirtualHost *:80>
    ServerAdmin [email protected]
    ServerName host1.dah85.com
    DocumentRoot /var/www/host1.dah85.com/public_html
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

And host2.dah85.com.conf

<VirtualHost *:80>
    ServerAdmin [email protected]
    ServerName host2.dah85.com
    DocumentRoot /var/www/host2.dah85.com/public_html
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Then we enable the configs and restart Apache

sudo a2ensite host1.dah85.com.conf
sudo a2ensite host2.dah85.com.conf
sudo service apache2 restart

And that should be it for setting it up. Assuming you have something in each public_html directory, it should be working.

-Dave

Over the past posts I was reviewing a few different cheap VPS providers I have found. Since doing that, I came across another contender for my list of yearly VPS deals to play with.

I decided to put the openvirtuals 180gb for $20/year deal to use as a TV downloader using a mix of sickrage, transmission-daemon and apache2 for serving the files.

It was working fine until the I/O issues became noticeable to the point where that particular VPS was unusable for the task. It was very cheap at 11 cents per gigabyte.

It lead me to find a better deal and I came across this:

Pielayer

512MB DDR3 RAM
1 vCPU core
100 GB HDD RAID 10 space  (12 cents/GB)
800 GB traffic @ 1000 Mbit uplink
1x IPv4 & 10x IPv6
New York City,US based
OpenVZ/SolusVM
[$15/year][3]

This is 12c/GB which makes it also good value for the task.

It's time for some benchmarks. The openvirtuals VPS had horrible I/O under 5mb/sec, let's see how this Pielayer one goes:

CPU model:  Intel(R) Xeon(R) CPU E31230 @ 3.20GHz
Number of cores: 1
CPU frequency:  1600.000 MHz
Total amount of RAM: 512 MB
Total amount of swap: 0 MB
System uptime:   2 min,       
I/O speed:  38.1 MB/s
Bzip 25MB: 4.71s
Download 100MB file: 110MB/s

Woah! This is a great start!! The I/O is amazing compared to the previous deal, a fast CPU and a very fast network! I hope the next tests will be as good.

2 more for fairness, taken at different times:

CPU model:  Intel(R) Xeon(R) CPU E31230 @ 3.20GHz
Number of cores: 1
CPU frequency:  3201.000 MHz
Total amount of RAM: 512 MB
Total amount of swap: 0 MB
System uptime:   15:12,       
I/O speed:  114 MB/s
Bzip 25MB: 4.22s
Download 100MB file: 104MB/s

Nice to see the CPU scaled up to the full 3.2GHZ here..

And one more:

CPU model:  Intel(R) Xeon(R) CPU E31230 @ 3.20GHz
Number of cores: 1
CPU frequency:  1600.000 MHz
Total amount of RAM: 512 MB
Total amount of swap: 0 MB
System uptime:   20:02,       
I/O speed:  40.7 MB/s
Bzip 25MB: 11.75s
Download 100MB file: 102MB/s

Very, very nice! This is a very well performing VPS for the price!

After playing around with this server, I will be seriously considering not renewing the openvirtuals deal and instead keeping this one.

-Dave

In this final installment of my quest to learn about VPS, particularly the low end ones, I will be looking at this deal:

Httpzoom/Cloudxtiny

Storage: 1000GB ($0.084c/GB)
RAM: 512MB
Swap: 2GB
CPU: 2x 2.136GHz
Network: Gigabit
Bandwidth: 6TB
Type: KVM
Price: $7/month ($84/year)

For my nextCloud setup, I think this should be perfect. I am very excited to test this one out. The storage is the cheapest I've ever seen, has lots of bandwidth and is even a KVM.

Here are the results from the first benchmark I took:

CPU model:  Intel(R) Xeon(R) CPU           L5630  @ 2.13GHz
Number of cores: 2
CPU frequency:  2133.408 MHz
Total amount of RAM: 489 MB
Total amount of swap: 2047 MB
System uptime:   2:50,       
I/O speed:  245 MB/s
Bzip 25MB: 8.28s
Download 100MB file: 53.6MB/s

Nice! So far very impressed.

I will post 2 more tests, again, from different times for comparison:

CPU model:  Intel(R) Xeon(R) CPU           L5630  @ 2.13GHz
Number of cores: 2
CPU frequency:  2133.408 MHz
Total amount of RAM: 489 MB
Total amount of swap: 2047 MB
System uptime:   3:43,       
I/O speed:  274 MB/s
Bzip 25MB: 10.31s
Download 100MB file: 54.9MB/s
CPU model:  Intel(R) Xeon(R) CPU           L5630  @ 2.13GHz
Number of cores: 2
CPU frequency:  2133.408 MHz
Total amount of RAM: 489 MB
Total amount of swap: 2047 MB
System uptime:   22:17,       
I/O speed:  302 MB/s
Bzip 25MB: 7.43s
Download 100MB file: 57.8MB/s

These are very good results, I can't believe it! After doing these tests I have installed nextCloud and I am happy to report that it is working perfectly! In a future post I may talk about setting up nextCloud and some of the challenges I faced.

Now that I have collected data on the VPS plans that I have tried out, I will keep playing with them and see if I can push them to their limits.

I will work out which of the yearly plans I'll keep as a toy VPS, and decide between the ServerHub and Httpzoom for my nextCloud.

-Dave