Attaching to BOINC project from Linux console

So my AWS EC2 free instance is running, for now I’ll use it as a Boinc maching, what is boinc?
The Berkeley Open Infrastructure for Network Computing (BOINC) is an open sourcemiddleware system for volunteer and grid computing. It was originally developed to support the [email protected] project before it became useful as a platform for other distributed applications in areas as diverse as mathematics, medicine, molecular biology, climatology, and astrophysics. The intent of BOINC is to make it possible for researchers to tap into the enormous processing power of personal computers around the world.
I try to put it everywhere I can, and I have figured out few simple steps to get it working.
  1. <span style=“line-height: 14px;”>Install boinc on your server: apt-get install boinc-client (This works for Ubuntu / Debian)</span>
  2. Attach to boinc project, in my case: boinccmd  –project_attach ac33820b6d74de35682d2ad98e7cede ( Your project key will be different)
  3. Add this entry to crontab (I have noticed that boinc process sometimes stops):
  4. 0 1 * * * root /etc/init.d/boinc-client restart

check if given number is prime

This problem in general is very complicated, but when we don’t need to be 100% sure (but probability is near 1) about our results there is a very easy way to do this.

We’ll use method isProblablePrime from class BigInteger.

This method as a argument gets probability level, it’s calculated as 1 – 1/(2^x), where x is argument, so for x = 20, we can be nearly fully sure about result, the probability is 0,99999904632568359375. For smaller numbers this method gives even more sure results.

How to use it:
long x = some_value;
BigInteger bi = BigInteger.valueOf(x);
boolean isPrime = bi.isProbablePrime();

Firstly we set x to some value, then a new BigInteger is created based on x value, next we use method to check if it’s prime.

more information about BigInteger you’ll find here: