MEWBIES@:  Facebook  Twitter  G+  YouTube  DeviantArt  Forum  Wall
 SHARE:
    ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
   ██                                                                       ██
  █▌                 -   GIMPS (FREEBSD, LINUX, MAC, WIN)  -                 █▌
 █▌                                                                           █▌
 █                                                                            ▐▌
 █ 'GIMPS' 'Great Internet Mersenne Prime Search' is a large internet         ▐▌
 █ community working together (distributed computing) to discover the next    ▐▌
 █ largest 'Mersenne prime' by each person running a tiny portable program in ▐▌
 █ the background of their PC, each working on a piece of the greater puzzle. ▐▌
 █ You don't need to know a single thing about prime numbers to join in :).   ▐▌
 █ GIMPS site is HERE. It is 100% free, open source and you can be            ▐▌
 █ completely anonymous if you like. You can allocate how much CPU usage you  ▐▌
 █ want the program to use and when.                                          ▐▌
 █                                                                            ▐▌
 █ I made this a tutorial on GIMPS' program mprime, from information          ▐▌
 █ collected at their forum, from the always helpful GIMPS peeps, because     ▐▌
 █ I've mentioned it in 'Terminal Fun 4 - Numbers' under GEEK FUN section.    ▐▌
 █                                                                            ▐▌
 █ Join Team Mewbies:                                                         ▐▌
 █ Update: I just created team mewbies account on GIMPS. Maybe 1 of the few   ▐▌
 █ people that might read this has a shell that they can spare some CPU       ▐▌
 █ cycles and join team mewbies :) . You can even create your own team. To    ▐▌
 █ join a team though you will need to sign up. You'll have your own private  ▐▌
 █ account, then you can join or leave a team with a push of a button; click  ▐▌
 █ HERE after you login to view the team page, search for mewbies, then press ▐▌
 █ the button 'Join'. No one, including other team members can view your      ▐▌
 █ private information.                                                       ▐▌
 █                                                                            ▐▌
 █ For my Debian x32:                                                         ▐▌
 █ Sign up, anonymous is fine.                                                ▐▌
 █ Check HERE first for the latest and correct version for your OS.           ▐▌
 █ mkdir gimps && cd gimps                                                    ▐▌
 █ wget http://www.mersenne.info/gimps/p95v279.linux32.tar.gz                 ▐▌
 █ tar -zxvf p95v279.linux32.tar.gz                                           ▐▌
 █ To launch mprime the first time to enter your preferences you will use     ▐▌
 █ the '-m' switch. It will launch in a window that is only interactive for   ▐▌
 █ mprime; can't interact other commands to your shells like this:            ▐▌
 █ ~/gimps/mprime -m                                                          ▐▌
 █ So instead I use 'screen' that will launch another screen for mprime and I ▐▌
 █ can switch back and forth easily between mprime and my shell:              ▐▌
 █ screen ~/gimps/mprime -m                                                   ▐▌
 █ At this point you will be presented with a number of questions.            ▐▌
 █ To select its default shown just hit Enter.                                ▐▌
 █                                                                            ▐▌
 █ To leave 'screen' and view your shell again type Ctrl + a  then  d         ▐▌
 █ To return to view mprime running type:                                     ▐▌
 █ screen -r                                                                  ▐▌
 █ To pause mprime:                                                           ▐▌
 █ 4                                                                          ▐▌
 █ To stop mprime (will kill (/quit) screen too):                             ▐▌
 █ 5                                                                          ▐▌
 █                                                                            ▐▌
 █ Stop mprime if it's running:                                               ▐▌
 █ killall -9 mprime                                                          ▐▌
 █ You can now run mprime without being prompted for input. Also after you    ▐▌
 █ logout mprime isn't killed (as it's running in screen mode) then next      ▐▌
 █ login you can still view its log and live:                                 ▐▌
 █ screen ~/gimps/mprime -d                                                   ▐▌
 █ If you don't want to use screen and run mprime in the background then use: ▐▌
 █ ~/gimps/mprime &                                                           ▐▌
 █ Problem is once you logout the process will be killed. So to run mprime    ▐▌
 █ in the background and not kill it once you logout use nohup (no hang up):  ▐▌
 █ nohup ~/gimps/mprime -d &                                                  ▐▌
 █                                                                            ▐▌
 █ If after you want to change any settings you entered on the first run of   ▐▌
 █ mprime, for example the MB you allocated it during setup:                  ▐▌
 █ Daytime P-1/ECM stage 2 memory in MB (8): 100                              ▐▌
 █ Nighttime P-1/ECM stage 2 memory in MB (8): 100                            ▐▌
 █ Then edit this file:                                                       ▐▌
 █ pico ~/gimps/local.txt                                                     ▐▌
 █ Change these two lines to your desired settings (8 was default), P04 is    ▐▌
 █ daytime, P05 is nighttime settings:                                        ▐▌
 █ SrvrPO4=100                                                                ▐▌
 █ SrvrPO5=200                                                                ▐▌
 █                                                                            ▐▌
 █ There are also other settings on this file: ~/gimps/prime.txt              ▐▌
 █ For example as per the undoc.txt to slow mprime down for heat reasons:     ▐▌
 █ pico ~/gimps/prime.txt                                                     ▐▌
 █ Add this line for mprime to run 40% of the time and the other 60% be idle: ▐▌
 █ Throttle=40                                                                ▐▌
 █                                                                            ▐▌
 █ AUTOSTART MPRIME:                                                          ▐▌
 █ `````````````````                                                          ▐▌
 █ If you want your mprime to run automatically even after a reboot it's      ▐▌
 █ simple- just a few steps are involved. We will make a 'bash script' and    ▐▌
 █ 'crontab' it. This will check every 10 minutes if it is running, if not    ▐▌
 █ it will start it for you.                                                  ▐▌
 █                                                                            ▐▌
 █ WRITE A BASH SCRIPT FOR CRONTAB TO START MPRIME:                           ▐▌
 █ 1. FIND THE LOCATION OF BASH:                                              ▐▌
 █ which bash                                                                 ▐▌
 █ My reply is: /bin/bash                                                     ▐▌
 █ So that will be the path in the top line of the bash script. Your reply    ▐▌
 █ might be different. Make a note of the reply/path that it gave you.        ▐▌
 █                                                                            ▐▌
 █ 2. CREATE BASH SCRIPT:                                                     ▐▌
 █ cd ~                                                                       ▐▌
 █ pico m_prime.sh  (this will create the non-existing file, name it          ▐▌
 █ anything.sh you want except 'mprime')                                      ▐▌
 █ Copy/paste in, changing: 'user' to your user name, bash & mprime to your   ▐▌
 █ own correct paths:                                                         ▐▌
#!/bin/bash
SERVICE="mprime"
RUNIT="nohup /home/user/gimps/mprime &"
if /bin/ps ax | /bin/grep -v /bin/grep | /bin/grep $SERVICE > /dev/null
then
    echo "$SERVICE service running, everything is fine"

else

$RUNIT

fi
exit

 █ Save the file: Ctrl + x then y, press Enter key.                           ▐▌
 █ Now set the perms on your new file:                                        ▐▌
 █ chmod 744 m_prime.sh                                                       ▐▌
 █                                                                            ▐▌
 █ Stop mprime if it's running:                                               ▐▌
 █ killall -9 mprime                                                          ▐▌
 █ Test the bash script it works correctly:                                   ▐▌
 █ ./m_prime.sh                                                               ▐▌
 █                                                                            ▐▌
 █ 3. CRONTAB BASH SCRIPT:                                                    ▐▌
 █ If all went well kill it again so we can test crontab:                     ▐▌
 █ killall -9 mprime                                                          ▐▌
 █ This will make crontab run the m_prime.sh every 10 minutes. Where ever     ▐▌
 █ you pico/created your bash script is its path - you need to have the       ▐▌
 █ correct full path, change 'user' to your user name.. Create a crontab:     ▐▌
 █ crontab -e                                                                 ▐▌
 █ Paste in, below the other crontab jobs if there are any:                   ▐▌
 █ 0,10,20,30,40,50 * * * * /home/user/m_prime.sh >/dev/null 2>&1             ▐▌
 █                                                                            ▐▌
 █ It will reply: crontab: installing new crontab                             ▐▌
 █ Wait 10 (looong) minutes and then see if it's running:                     ▐▌
 █ ps x                                                                       ▐▌
 █ 32568 ?        SNl    2:48 /home/user/gimps/mprime &                       ▐▌
 █                                                                            ▐▌
 █ Or to auto start mprime on boot up read the post HERE.                     ▐▌
 █                                                                            ▐▌
 █ //----------------------------------------------------------------------   ▐▌
 █                                                                            ▐▌
 █ If you find mistakes, have suggestions, and or questions please post at    ▐▌
 █ mewbies forum HERE - thank you.                                            ▐▌
 █                                                                            ▐▌
 █ Last update on 09 Apr '13                                                  ▐▌
 █                                                                            ▐▌
 █▌                                                                           █▌
  █▌                          -   mewbies.com   -                            █▌
   █▌                                                                       █▌
    ██▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄██