tutorials

Hetzner Proxmox Network Setup

Setting up Proxmox can be somewhat difficult on a Hetzner dedicated server. Once the initial install is completed it gives one the false sense of hope that they are done with the install and ready to use it. In reality, setting up the network interfaces can be a time-consuming and quite annoying process. To alleviate the frustration from this, I have created a python script that is embedded below that will generate the file for /etc/network/interfaces. I recommend testing it while you still have KVM access to the server but that is not required and all “should” work fine. If you have any questions please email me at henry@hwrrobotics.com or use the contact form on this site. 

The Host’s IP, Host’s Gateway IP, and Hosts’s Netmask can be found in the Robot Console

https://robot.your-server.de/server

The Additional IP Information can be found in the Subnets section on the Robot page:

Clicking the second subnet so the checkmark appears and then clicking the plus will show all IP addresses:

You also need to turn on IP forwarding, run the command below to turn it on:

sysctl -w net.ipv4.ip_forward=1

If you would like an internal network between the VMs/Containers then copy and paste the below code to your /etc/network/interfaces file:

auto vmbr1
iface vmbr1 inet static
    address 10.20.30.1
    netmask 255.255.255.0
    bridge_ports none
    bridge_stp off
    bridge_fd 0
    post-up iptables -t nat -A POSTROUTING -s '10.20.30.0/24' -o eth0 -j MASQUERADE
    post-down iptables -t nat -D POSTROUTING -s '10.20.30.0/24' -o eth0 -j MASQUERADE

Posted by admin

Spacer Calculator

Need to know the distance between multiple parts over a fixed distance? 

The spreadsheet below should help with those calculations. 

Good Luck!

Posted by admin

Transfer Rate Calculator

 

Enter your transfer rate in kilobytes per second using the blue form below

Final amount transfered in GB shown in box

Posted by admin, 0 comments

Securely Backup Your Linux Server to Google Drive with AES Crypt and Rclone

Backing up to the cloud can be a great option for data backup. However, despite what companies may say about their security policies you are at their mercy once you upload your content to their servers. However, if you encrypt it before you upload it you have double security. It may seem super paranoid but worst case you just have two layers of security and it takes a little bit longer to work with the raw file, but if there is a hack that breaks into Google Drive, or Onedrive, or B2 or whatever cloud service provider you are using you are now at the mercy of the hacker. However, if you encrypt your files before uploading them you are safe as long as the hacker has not broken 256 bit AES which is highly unlikely.

Companies with Google Apps for Work or students with a school Google Drive Account probably have unlimited cloud storage. Now this is great for work or school documents but it is also a fantastic solution for easy to access server backups. Google Drive has very fast upload speeds and it does not charge for bandwidth like it’s bucket storage sibling does. Therefore, you have unlimited storage for free and possibly for life if your institution retains your email account after you graduate. If you keep working for the same company you probably will have access to the account as long as you are an employee for the company. With Logistics aside Google Drive provides a reliable place to store content. In this tutorial we are going to compress a folder with tar and pipe that command to AES Crypt after the file is encrypted we will run Rclone to upload it to Google Drive. We will also write the program for full cron compatibility so that you can run this command every day, every week, or whenever you want to.

Requirements:

  1. A linux machine that is connected to the internet with tar, AES Crypt, and Rclone installed.
  2. If running Ubuntu 14.04: How to install AES Crypt
  3. If running Ubuntu 14.04: How to install Rclone and configure it to use Google Drive
  4. Secure shell access to the server.
  5. 10 minutes to complete the install and modify the script to fit your needs.

If you have AES Crypt and Rclone installed and configured you should be able to modify the script below and have it run successfully.

 cd /opt
    mkdir websitebackup
    cd websitebackup
    rm hwrweb-$(date +%Y-%m-%d).tar.gz
    rm hwrweb-$(date +%Y-%m-%d).tar.gz.aes
    tar -cvf - /var/www/html | aescrypt -e -p plaintextpassword - >hwrweb-$(date +%Y-%m-%d).tar.gz.aes
    sudo /usr/sbin/rclone copy hwrweb-$(date +%Y-%m-%d).tar.gz.aes googledrive-backup:HWR-Robotics-webserver
    rm hwrweb-$(date +%Y-%m-%d).tar.gz
    rm hwrweb-$(date +%Y-%m-%d).tar.gz.aes

Posted by admin, 0 comments

Installing Rclone on Ubuntu 14.04

Backing up is crucial to the success of any website. However, backing up to cloud services such as Amazon S3, Google Drive, Google Bucket Storage, Yandex.Disk, and Backblaze B2 can be difficult and or time consuming to set up. However, Rclone makes that task so much easier. Today we are going to install Rclone on Ubuntu 14.04.

Yandex-Disk1.jpg

 

First you are going to want to go to their download page:

http://rclone.org/downloads/

 

You are going to want to download the appropriate version based on your system and whether it is 32 bit or 64 bit and whether or not it is running on ARM architecture.

We are going to use the 64 bit version which can be downloaded here:

http://downloads.rclone.org/rclone-v1.30-linux-amd64.zip




Once it is downloaded you are going to want to issue the following commands that are published on the Rclone website. Below I have copied and pasted the commands from their webpage, which is available here: http://rclone.org/install/

unzip rclone-v1.17-linux-amd64.zip
cd rclone-v1.17-linux-amd64
#copy binary file
sudo cp rclone /usr/sbin/
sudo chown root:root /usr/sbin/rclone
sudo chmod 755 /usr/sbin/rclone
#install manpage
sudo mkdir -p /usr/local/share/man/man1
sudo cp rclone.1 /usr/local/share/man/man1/
sudo mandb

If you want a complete install script I have composed one below that will download the file using wget and then implement the commands from Rclone’s website. It will also install the unzip package. The script is available below:

sudo apt-get install unzip -y

cd ~

wget http://downloads.rclone.org/rclone-v1.30-linux-amd64.zip

unzip rclone-v1.30-linux-amd64.zip

cd rclone-v1.30-linux-amd64

#copy binary file
sudo cp rclone /usr/sbin/
sudo chown root:root /usr/sbin/rclone
sudo chmod 755 /usr/sbin/rclone
#install manpage
sudo mkdir -p /usr/local/share/man/man1
sudo cp rclone.1 /usr/local/share/man/man1/
sudo mandb

 

Once it is installed you need to configure to work with your cloud storage host. The official configuration page is available here:

http://rclone.org/docs/

 

To setup Rclone for use with Google Drive you are going to want to type:

 

rclone config

n

#name of google drive remote host ex: googledrive-backup

googledrive-backup

6

#client_id leave blank

#client_secret leave blank

#If installing on a headless server type N

n

#you will be given a link to enter into your browser. The link will ask for your permission for Rclone to access your Google Drive account. Once permission is granted it will give you a verification code which you will copy and paste back into your ssh terminal.

#It will then ask you if the current setup is ok or if you want to edit it or delete it. If you are happy with the result press y which will set the remote host.

y

#If there are no more remote hosts that you want to add then you can type q to quit the configuration

q

Once you have your host set you can start copying files to it. For instance if we wanted to copy a file named test.txt into a folder on Google Drive named test (it doesn’t matter if the folder exists or not) we would enter the following:

rclone copy test.txt googledrive-backup:test

Note: If you are running rclone as an automated cron task you are going to need to include the full path to rclone or else it will not copy.

sudo /usr/sbin/rclone copy test.txt googledrive-backup:test

 

Congratulations! Now you are able to copy files from your server or computer to Google Drive with a few simple commands.

If you would like an offline version of this guide I have attached a pdf of it below:

Posted by admin, 0 comments

Installing AES Crypt on Ubuntu 14.04

Encryption is the backbone of modern computing and encrypting your files before uploading them to a cloud storage provider insures a higher level of security. AES Crypt is very simple to install on both Windows and Linux to make encryption very easy. In this tutorial we are going to install AES Crypt on Ubuntu 14.04.

First go to their website and download the appropriate file for your system (32bit or 64 bit) make sure it is the Gui version even though we will not be using the Gui version in this tutorial

https://www.aescrypt.com/download/

32 bit Linux https://www.aescrypt.com/download/v3/linux/AESCrypt-GUI-3.10-Linux-x86-Install.tgz

64 bit Linux https://www.aescrypt.com/download/v3/linux/AESCrypt-GUI-3.10-Linux-x86_64-Install.tgz

 

If you are on a 64 bit system you can use the following command to install AES Crypt:

wget https://www.aescrypt.com/download/v3/linux/AESCrypt-GUI-3.10-Linux-x86_64-Install.tgz

tar -zxf AESCrypt-GUI-3.10-Linux-x86_64-Install.tgz

sudo ./AESCrypt-GUI-3.10-Linux-x86_64-Install

 

You will be prompted with the following questions:

This will install AES Crypt for Linux on your computer.  Continue? [n/Y] Answer Y for the default install

Where do you want to install AES Crypt for Linux? [/usr/share/aescrypt] Press enter to complete the install unless you want to install AES Crypt to a different location.

 

If the installation completes it should display the following:

InInstalling Executables…         

InsIInstallation complete.

 

You can test the program by creating a file named test.txt and then encrypting it with the password of 123abc:

sudo nano test.txt

aescrypt -e -p 123abc test.txt

 

For more commands visit AES Crypt’s Linux usage page:

https://www.aescrypt.com/linux_aes_crypt.html

Below is a pdf of this guide for offline use:

Posted by admin, 0 comments

Helpful Links

  1. How to limit the amount of bandwidth Rsync uses:
    1. http://www.howtogeek.com/50794/keep-rsync-from-using-all-your-bandwidth/
  2. How to Find the largest files on your Linux system:
    1. http://www.cyberciti.biz/faq/how-do-i-find-the-largest-filesdirectories-on-a-linuxunixbsd-filesystem/
  3. How to limit program usage on a Linux server:
    1. blog.scoutapp.com/articles/2014/11/04/restricting-process-cpu-usage-using-nice-cpulimit-and-cgroups
  4. Export and Import a Docker Image Between Nodes
    1. http://www.jamescoyle.net/how-to/1512-export-and-import-a-docker-image-between-nodes
  5. CrashPlan management via a remote computer using X11 forwarding (easy)
    1. http://www.benwagner.net/computing/installing-crashplan-on-headless-server-x11-forwarding/
  6. Allowing “Allowfullscreen” in Drupal
    1. https://www.drupal.org/node/2347645
  7. How to reset your mysql database password
    1. https://www.howtoforge.com/setting-changing-resetting-mysql-root-passwords

 

Posted by admin, 0 comments

Free SSL, CDN, and DDoS Protection from Cloudflare!

       Have you ever wanted to secure your website with SSL to protect it and its users from MITM (man in the middle attacks)? Or increase your load times from different parts of the world? Well now you can for a whopping cost of $0. That’s right for free!

       Ok, enough with the sales pitch if you want to do all of the above use cloudflare.com. CloudFlare hosts tons of websites ranging from first websites to websites with millions of users. The free plan provides you with basic DDoS protection, a CDN (content delivery network), a free SSL certificate, and much more. DDos protection will protect your website from crashing due to a high influx of users either created by hackers or innocently by people who just want to view your content.

      The setup is relatively simple as you just have to go to cloudflare.com, create an account, add your website, and then transfer your nameservers for your domain to the ones that will be provided by CloudFlare. It says that it takes a few hours to transfer your domain, but it really only takes a couple on minutes. Once it is all synced up you will be able to configure your server from the control panel. 

Here is a simple tutorial from Digital Ocean on how to integrate CloudFlare with a Digital Ocean Droplet: https://www.digitalocean.com/community/tutorials/how-to-mitigate-ddos-attacks-against-your-website-with-cloudflare 

Posted by admin, 0 comments
Changing the Owncloud Login Logo

Changing the Owncloud Login Logo

Hello Everyone!

Today, we are going to change our default Owncloud logo from the one shown below:

 

  1. First, go to your Owncloud folder on your server. If you are running a default Owncloud instance on Ubuntu with Apache as the webserver the default path would probably be:

/var/www/html/owncloud

  1. Once you are there go to the core folder and then the img folder.

 

  1. You will find two files that you want to change. There is a logo.png and a logo.svg file.
  2. Simply upload your own version of the logo.png and the logo.svg file and you will have successfully changed your logo. (Note: If you are having problems trying to convert your logo to a .svg it is not all that big a deal because I have found that if you just change one line of the css code you don’t need a .svg.​

  1. To change your logo from a svg to a png go to your main Owncloud folder.
    1. If you are running Apache on an Ubuntu Server your default Owncloud folder is probably: /var/www/html/owncloud (This is the same path that is mentioned above).

  1. Then go into your core folder.

  1. Then go into your css folder and open up the header.css file.

 

  1. On line 73 of the file you should find a line named:

background-image: url(../img/logo.svg);

  1. Once you are done change the line should look like this:

background-image: url(../img/logo.png); (Also as shown above)

  1. Once you have found this line change logo.svg to logo.png and save and close the file as shown above.
  2. Restart your Apache Server and you are good to go!
Posted by admin, 0 comments