Contributing to SETI@HOME with your Raspberry Pi

How to run BOINC in headless mode

BOINC (Berkeley Open Infrastructure for Network Computing) is an open-source middleware system used for distributed computing. Originally developed to support SETI@Home, the platform has since grown to support many different projects from many diverse domains such as mathematics, linguistics, medicine, climatology and others.

For this tutorial, we are going to configure the raspberry pi to execute workloads for the SETI@Home project. For those of you who aren't aware, SETI@Home is a distributed computing project that enables you to volunteer some of your computer's resources in order to aid the search for extraterrestrial intelligence. SETI@Home searches for possible evidence of radio transmissions using observational data from the Arecibo Observatory and the Green Bank Telescope, the observational data is sent to the main server, split down into small chunks in frequency and time, and then distributed to the volunteers on the network to analyse, process and send back to the main server once complete.

You can take part in other projects using the BOINC platform, however not all of them will be compatible with the raspberry pi, you can find out more by visiting the BOINC projects page.

What you will need?

  1. Raspberry Pi (recommended 1GB RAM)
  2. Micro SD Card (recommended pre-installed with Raspbian)
  3. Ethernet or Wifi
  4. SSH connection

Installation

Firstly, as always, make sure your system is up to date:

  $ sudo apt update
  $ sudo apt upgrade

Now you can install the BOINC command line:

  $ sudo apt install boinc-client

Done! BOINC is now installed and you you are now ready to start installing projects.

Getting started with SETI

If you don't already have an account, go and sign up at the SETI@Home project page. Once you have done this, you will need to query the project site for an account key:

  $ boinccmd --lookup_account http://setiathome.berkeley.edu <your_email> <your_password>

The above command should result in the following output:

  status: Success
  poll status: operation in progress
  ...
  account key: <your_account_key> 

Copy the account key, and then run the command below to attach your BOINC client to your SETI@Home account:

  $ boinccmd --project_attach http://setiathome.berkeley.edu <your_account_key>
Finally, start BOINC:
  $ sudo /etc/init.d/boinc-client start
That's it!, your account should now be active and your pi should start receiving workloads, to view current tasks, just issue this command:
  $ boinccmd --get_tasks
This should result in something similar to the following output:
======== Tasks ========
1) -----------
   name: blc45_2bit_guppi_58543_66421_HIP34115_0022.4686.409.22.45.226.vlar_0
   WU name: blc45_2bit_guppi_58543_66421_HIP34115_0022.4686.409.22.45.226.vlar
   project URL: http://setiathome.berkeley.edu/
   received: Tue Jul 16 02:40:07 2019
   report deadline: Sat Sep  7 07:39:48 2019
   ready to report: no
   state: downloaded
   scheduler state: uninitialized
   active_task_state: UNINITIALIZED
   app version num: 806
   resources: 1 CPU
   estimated CPU time remaining: 21100.854502
I hope you had fun setting up this cool and worthwhile little project on your pi, if you run into any trouble or would like to add anything then please feel free to let me know! :)


View

Running MySQL from a ZIP Archive

A Quick Guide for Windows Users.

This quick guide will teach you how to configure and run a MySQL server from a noinstall ZIP archive on Windows.


Reference


https://dev.mysql.com/doc/refman/5.7/en/windows-install-archive.html


Download the ZIP Archive


Firstly, download the MySQL Community Server 8.0.15 ZIP archive and extract it to the desired location for your installation (e.g. C:\Users\user.name\AppData\Local\Programs\mysql), then create the following directories:

  • MySQL Database data files: C:\Users\user.name\AppData\Local\Programs\mysql\db
  • MySQL Log files:  C:\Users\user.name\AppData\Local\Programs\mysql\logs

Create the configuration file


You'll need to create the required configuration file at C:\Users\user.name\AppData\Local\Programs\mysql\config.ini:


[mysqld]
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M

# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin

# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M 

sql_mode = NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
# set basedir to your installation path
basedir = "C:\\Users\\christopher.rowles\\AppData\\Local\\Programs\\mysql\\mysql-8.0.15-winx64"
# set datadir to the location of your data directory
datadir = "C:\\Users\\christopher.rowles\\AppData\\Local\\Programs\\mysql\\db"
# The port number to use when listening for TCP/IP connections. On Unix and Unix-like systems, the port number must be
# 1024 or higher unless the server is started by the root system user.
port = "3306"
# Log errors and startup messages to this file.
log-error = "C:\\Users\\christopher.rowles\\AppData\\Local\\Programs\\mysql\\logs\\log.err"

[mysqladmin]
user = "root"
port = "3306"
    

Initialise MySQL


You'll now need to initialise the MySQL database files:

  1. Open Windows command prompt (Hit Win + R, then type 'cmd' and press enter).
  2. Type the following command to initialise the files:
    "C:\Users\user.name\AppData\Local\Programs\mysql\mysql-8.0.15-winx64\bin\mysqld.exe" --defaults-file="C:\Users\user.name\AppData\Local\Programs\mysql\config.ini" --initialize-insecure --console

The command above should:

  • Create database files in the location specified in config.ini.
  • Initialise the root user with no password.
  • Log any errors to the current console.

Configure startup/shutdown scripts


Finally, create two batch scripts to manage your MySQL instance:


mysql-start.cmd:

"C:\Users\user.name\AppData\Local\Programs\mysql\mysql-8.0.15-winx64\bin\mysqld.exe" --defaults-file="C:\Users\christopher.rowles\AppData\Local\Programs\mysql\config.ini"

mysql-shutdown.cmd:

"C:\Users\user.name\AppData\Local\Programs\mysql\mysql-8.0.15-winx64\bin\mysqladmin.exe" --defaults-file="C:\Users\christopher.rowles\AppData\Local\Programs\mysql\config.ini" shutdown

These scripts can be invoked directly to start/stop your MySQL instance.


Finished


You should now have a functioning MySQL instance!


Please be aware that this guide does not provide a secure, production-ready configuration for your MySQL instance, it is only intended for development purposes.


Extra Steps


This guide showed you how to configure a basic MySQL instance with no password required for the root user, if you would like to configure the root user to use a password, follow these extra steps:

  1. Alter your config.ini file and include the following at the bottom of the [mysqld] section:
    default_authentication_plugin=mysql_native_password
  2. Execute the following query, replacing 'password' with your chosen password:
    ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password'
  3. Restart MySQL.

I hope this guide helps! If you have any questions, please feel free to contact me@rowles.ch :)



View

Setting up a Mail Server in EC2

A Quick Guide.

This guide will teach you how to configure an email server for your domain, using an Amazon EC2 instance


Requirements


  • A domain name, with control over the DNS records
  • An AWS account
  • Familiarity with Linux and the AWS ecosystem

Create a new EC2 Instance


Firstly you'll want to setup a dedicated host for sending and receiving email. I would recommend configuring a new instance with the following, which is within free-tier limits:

  • Amazon Linux 2 AMI (64-bit)
  • Type t2.micro
  • Default instance details
  • Default storage details
  • No tags
  • A new security group (details are directly below)

Your mail server will listen for incoming mail via SMTP, so you should create a new dedicated security group and open inbound TCP port 25 so that you will be able to receive mail.

Finally, allocate an Elastic IP address and associate it to the newly created instance. This will provide a static IP address for your mail server.


Add DNS Records


Next, youll need to create the required DNS records in order for emails to be properly routed through your host.

Create an A record for your host from mail.domain.tld to your new Elastic IP address

Then create an MX record for domain.tld to 10 mail.domain.tld


NOTE: Anti-spam software will require that any server sending mail has a valid reverse DNS record. You will need to Contact AWS to create this record.


Configure Host


Now we'll need to SSH into the new instance to configure it for mail.

Firstly, ensure your host knows its own name:

$ /etc/hosts
127.0.0.1    mail.domain.tld localhost localhost.localdomain
    
$ /etc/sysconfig/network
HOSTNAME=mail.domain.tld
    

Configure Postfix


We'll be using postfix to send and receive our mail. If it isn't already installed, please install it now:

$ sudo yum install -y postfix
    

The minimum changes we'll need to make are listed below:

$ /etc/postfix/main.cf
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
mydomain = domain.tld
myhostname = mail.domain.tld
mynetworks_style = host
myorigin = $mydomain
    

After the required changes have been made, start postfix and enable it to start on reboot:

$ sudo systemctl start postfix
$ sudo systemctl enable postfix
    

Finished


You should now have a functioning mail server! You can test this by installing a mail user agent such as mailx:

$ sudo yum install -y mailx
    

To test sending mail:

$ echo "Hello World" | mail -s subject existing-email@existing-domain.tld
    

To test receiving mail:

$ mail
Heirloom Mail version 12.5. Type ? for help.
"/var/spool/mail/ec2-user": 1 messages 1 new
...
...
    

I hope this quick guide helps! If you have any questions, please feel free to contact me@rowles.ch :)



View