Bitcoin Forum
June 17, 2024, 03:06:05 AM *
News: Voting for pizza day contest
 
  Home Help Search Login Register More  
  Show Posts
Pages: [1]
1  Local / Altcoins (criptomonedas alternativas) / Re: [PesetaCoin][PTC] Nuevo Monedero 0.8.8 [ACTUALIZACION OBLIGATORIA] on: August 12, 2015, 11:24:53 AM
Hola!

Os escribo porque hace probablemente más de un año entre aquí, aunque mayormente en silencio, formé parte de la comunidad con ilusión y me subscribí a este grupo para que me llegaran notificaciones de los mensajes de todos. En los buenos tiempos he llegado a tener varios millones de PTC, y aunque no soy de pump&dumps... hubo un línea de no retorno donde decidí que si se cruzaba, lo vendía todo, y así hice... La PTC se ha ido desvalorizando hasta el punto de hacerme perder el interés, y no he visto en los últimos tiempos una atividad en el grupo que me hiciera pensar que esto fuera a reflotar. Por supuesto tampoco quería perder mi inversión.. he visto poco apoyo en la PTC, algunos se han esforzado y han hecho lo que han podido, pero he vusto mucho español que pasa más tiempo echando trapos sucios que metiendo ideas constructivas, muy ejemplar para una moneda que cada dos por tres al borde de ser desactivada en bittrex.

Antes de despedirme, quiero expresar mi opinión sobre este foro: Me aburre profundamente. Acabo de desactivar las notificaciones, porque no me aporta nada encontrar cada dos por tres el buzon de correo petado de mensajes de críticas, unos insultando a otros, etc... No quiero herir supceptibilidades, pero no veo futuro a esto y mucho menos con una panda de españoles haciendo ruido.

Hasta siempre!
2  Local / Altcoins (criptomonedas alternativas) / Re: [ANN][NUEVA][PesetaCoin - PTC] Vuelve la Rubia / Esta Viva!! on: January 15, 2014, 10:04:20 PM
Hola a todos!!

Estoy encantado con este proyecto, ha sido verlo y me ha llegado al corazón...
Maldito Euro!! Viva la peseta!!!

Me he puesto a minar la moneda de inmediato en vuestro pool, quiero colaborar desde el principio.
Además, soy informático, y teleco y si necesitais algo de colaboración, contad conmigo.

Un abrazo!
Neich


3  Economy / Auctions / Selling buterflylabs account with 25% discount voucher on: October 19, 2013, 08:28:29 AM
Dear all,

I'm selling my bfl account that has a 25% discount voucher code inside.
I provide full control to my account, where you can find the discount code and use it in the purchase of other bfl products.
You can save lot of money in case you are intended to buy many BFL products.
Shipping address and account password can be changed as soon as the account is yours.

Start Bid: 1BTC
Bid Increments: 0,5 BTC
Auction ends 7 days from this posting.

Good luck!

Timer removed. End time: 2013-10-26+08:30:00UTC
4  Economy / Computer hardware / Re: 384 BFL ASIC chip coupons ($25 off $75) for sale [ESCROW] on: June 29, 2013, 08:00:15 AM
Dear all, I sell 32 chips coupon per 1.5 BTC.
It's about 4,5$ per chip (with each coupon you get a discount of 25$).

If you are interested, please send me a PM.
5  Bitcoin / Bitcoin Technical Support / Re: How to recover your wallet.dat encryption password (Brute force) on: June 17, 2013, 08:13:06 PM
Dear Sharky444,

It depends on how you can delimit your calculation...

Two cases:

(A) Let's imagine you know some of the characters you used... Or someone knows you usually use numbers and certain symbols.... a very short list would include 20 characters ...
But let's imagine you are very sure that with only 12 chars it would be enough..... With 12 chars you will reach an amount of 20^12 = 4096*10^12 combinations.
The current brute force has a bitcoin client passphrase limitation: It can only check about 10 phrases per second due to security reasons.
This means that one PC, will take 13.168.724 years.

Now lets imagine you can run up to 6 virtual machines in your PC, in each of them you run the brute force script against the bitcoin a copy of the wallet client.... then the pc will need 1.316.874 years.... Now lets imagine you are really rich or an awesome hacker and you can have 100.000 computers working for the wallet password.....  Then you will spend 13 years for obtaining the password...... In addition, you would need the wallet.dat file.... that in fact is not very easy to be obtained.

Now, go to a more realistic situation:
(B) You have no idea about the used password characters.... you may have upper-cases, lower-cases, numbers, symbols.... You should include a lot of characters for your combinations calculation... Then you may consider 85 characters...  {a...z, A...Z, 0..9, !"·$$%&/()=?¿^<>@#~|[]{}€*¨Ç;:_/*......... etc)

Same calculation will lead to a brute force time of 762.183.626 years
In this case, if you want to get the password in a reasonable time (about 1 month) you would need 762.183.626.000.000 computers.

From my point of view, 12 characters is a long and very safe password... maybe too long for our minds.
I think it is safe enough to use passwords of 10 characters, where you alternate text, upper/lower-cases, numbers, and rare symbols.... Considering that some brute-force dictionaries may not be treating very rare symbols for reducing the combinations number... if you are using rare symbols you will increase a lot your password safety:  "¬ ~| % ` [ ] } etc..."

6  Economy / Computer hardware / 32 BFL &25 chip coupons on: June 17, 2013, 06:42:02 PM
I am selling a 32 BFL $25 chip coupon. The coupon is worth for $25 off 32 chips, which are normally $75. You can get 32 chips at $50 each, and the coupon can be used together with other coupons purchased from others as well.

I am decided to sell all 32 x $25 coupons for a few BTCs. I have no starting bid... you can start!. Please note that the total discount of the chips is $25 x 32 = $800.
Please, send me your bids and I will transfer the coupon to the best bidder within the following days.

More information about chip program here: https://forums.butterflylabs.com/announcements/3272-customer-appreciation-chip-credit-program.html
7  Bitcoin / Bitcoin Technical Support / How to recover your wallet.dat encryption password (Brute force) on: April 08, 2013, 07:37:58 PM
Dear bitcoiners,

I forgot my pass for my encrypted wallet.dat. At the beginning I was not really worry, as I only had a few bitcoins... but currently, due to the high value of the coin I made big efforts for  recovering my password. Finally I was able to find the password by means of some scripts I built.
I hope they are useful for you also.

First, I installed an Ubuntu system in a VMware virtual machine. I then installed bitcoind, and ruby.

Then I figured out some rules for the developing of a passwords builder, obtaining a few personal dictionaries. This way I would run some dictionaries at home, and others in the office.
In my case I usually use passwords with a specific syntax... for example
1. Something like _bitcoin001$$$... the syntax will be:  [from zero to two characters]  + [word1] + [from 0 to a few numbers] + [a few characters]
2. Something like _coin13bitcoin001$$.... the syntax will be:  [from zero to two characters]  + [word1] + [a few numbers] + [word2] + [a few characters]
3....

I then assumed some general rules. In my case for example, I use to repeat the same character at the end... Normally I don't use digits above value 3, etc...
In your case you have to figure out your own rules and tune up my code.

I provide two scripts:

Build.rub will build your dictionaries according to the rules you have defined. This script will create a text file that will be used for searching for your lost password.
It is important to have this information in a file, as it will be mandatory for resuming from the last tested password in case you switch off the PC or you have a hard reset.

In the dictionaries building it is important to minimize the characters in the list (think about the common characters you use and discard those not used in your password, also do the same for the numbers you use). In addition, I looked for 6 unknown characters.... note that this leads to a searching of one month.... maybe your case is easier, and only forgot two or three characters..... I hope that !!. It is very useful to find rules that reduces the number of possibilities. For example in my case I normally repeat the same symbol several times instead of using different symbols consecutively.

Code:
#!/usr/bin/ruby -w build.rub

arrayNumSymbols = "\#$%&*+-=@_0123".chars.to_a
arraySymbols = "\#$%&*+-=@_".chars.to_a
arrayNumbers= "0123".chars.to_a

counter = 0
NumDiccionario = 1

#--------------------------------------------------------------------------------

min_left = 0  
max_left = 1  

min_center = 0
max_center = 2

min_right =  0
max_right =  4              #  This is not including an extra character that can be added at the end
max_Right_Symbol=3     # within right characters, this constant define the number of consecutive symbols
extra_symbol=1            # value 0 or 1. It defines if an extra character shall be added at the end

#-----------------------------------------------------------------
def storeWord(file,left,center,right,counter)
  
     case NumDiccionario
        when 1  then file.puts left + "word1" + right + "\n"                                 #_$word1$$$000+          -> LCR=2-0-6
        when 2  then file.puts left + "WORD1" + right + "\n"                               #_$WORD1$$$000+        -> LCR=2-0-6
        when 3  then file.puts left + "Word1" + right + "\n"                                 #_$Word1$$$000+         -> LCR=2-0-6
        when 4  then file.puts left + "word1" + center + "word2" + right + "\n"       #_word100word2$$$0+   -> LCR=1-2-4
        when 5  then file.puts left + "WORD1" + center + "WORD2" + right + "\n"    #_WORD100WORD2$$$0+   -> LCR=1-2-4
        when 6  then file.puts left + "Word1" + center + "Word2" + right + "\n"       #_Word100Word2$$$0+        -> LCR=1-2-4
     end
     counter = counter + 1
     return counter
end
#-----------------------------------------------------------------
left = ""
center = ""
right = ""

print "Building dictionary" + NumDiccionario.to_s + " .\n"
print "Wait...\n"

# --- This code defines the number of characters in the left, center and right of the generated password
case NumDiccionario
    when 1   then max_left = 2; max_center = 0; max_right = 6;
    when 2   then max_left = 1; max_center = 2; max_right = 4;
    when 3   then max_left = 1; max_center = 2; max_right = 4;
    when 4   then max_left = 2; max_center = 0; max_right = 5;
end

nameFile = "diccionario" + NumDiccionario.to_s + ".txt"
File.open(nameFile, 'w') do |file|

# ------- Calculation of left characters  ------------  
(min_left..max_left).each do |length_left|
  arraySymbols.repeated_permutation(length_left) do |str_left|
      left = str_left.join
      # ------- Calculation of center characters -------------
      (min_center..max_center).each do |length_center|
          arrayNumSymbols.repeated_permutation(length_center) do |str_center|
             center = str_center.join
             # ------- Calculation of right characters -------------
             (min_right..max_right).each do |length_right|
        max_symbols = [length_right, max_Right_Symbol].min
                 (0..max_symbols).each do |num_symbols|
        if (num_symbols == 0)
                         arrayNumbers.repeated_permutation(length_right) do |str_numeros|  
                              right = str_numeros.join
                              counter = storeWord file,left,center,right,counter
                              if extra_symbol==1
                                arraySymbols.each do |extra_caracter|
                                   right = str_numeros.join + extra_caracter
                                   #---- Store this word in the dictionary  ----------    
                                   counter = storeWord file,left,center,right,counter
                                end  
                              end
                         end
                      else
                         arraySymbols.each do |symbol|
                         str_symbols = symbol * num_symbols
                         max_numeros= length_right-num_symbols
                         arrayNumbers.repeated_permutation(max_numeros) do |str_numeros|
      right = str_numeros.join + str_symbols
                               counter = storeWord file,left,center,right,counter                    
                right = str_symbols + str_numeros.join
                               counter = storeWord file,left,center,right,counter
                               if extra_symbol==1
                                   arraySymbols.each do |extra_caracter|
      right = str_symbols + str_numeros.join + extra_caracter
                                       counter = storeWord file,left,center,right,counter
                                   end        
                               end
                             end
                         end
                      end
                  end
             end
      end
      end  
  end
end
end
print "Words counter: #{counter}. Maximum estimated time for password recovery #{counter/36000} hours. #{counter/864000} days \n"
      
File.open('lastLine.txt', 'w') do |file2|
    file2.puts "0"
end  

Note that by changing the constant "dicctionario" and running this script you can generate all dictionaries you define in the code (following your own rules)
run the scrip by using "ruby -w build.rub"

After you have generated the password files, you can use the following script for searching for the password:

- First of all, run the bitcoind in daemon mode:  bitcoind -daemon

- Then, run this script ruby -w search.rub

Sarch.rub

Code:
#!/usr/bin/ruby -w search.rub

num_line = 0

NumDiccionario = 1

#--------------------------------------------------------------------------------

#-----------------------------------------------------------------
def checkPassword (pass)
  print pass, "\t"
  system("bitcoind", "walletpassphrase", pass, "20")
  case $?.exitstatus
  when 0
    puts "You found it!  #{pass}"
    File.open('password.txt', 'w') do |file|
       file.puts phrase + "\n"
    end
    exit 0
end
#-----------------------------------------------------------------

str_num_line = "0"

File.open('lastLine.txt', 'r') do |file2|
           str_num_line = file2.gets
end  

if (str_num_line.to_i > 0 )
   print "Last searching stopped at line " + str_num_line + "\n"
   STDOUT.flush
   print "Continue from here? y/n:"
   resp = gets.chomp
   if (resp == "y")
       num_line =str_num_line.to_i
   end
end
  

print "Starting at line " + num_line.to_s + "... Good luck!!\n"

fileName = "Dictionary" + NumDiccionario.to_s + ".txt"
File.open(fileName, 'r') do |file|

print "Shifting index..."
(0..num_line).each do |i|
   line = file.gets
end

print "Searching..."

while line = file.gets
    print "Checking line:" + num_line.to_s + ": " + line
    str = line.chomp
    checkPassword  str
    num_line = num_line + 1
    if (num_line % 100)
       File.open('lastLine.txt', 'w') do |file2|
           file2.puts num_line.to_s + "\n"
       end    
    end
end
end


If you prepare the testing system in a virtual machine, you can run several instances, one per dictionary.... I was running up to 6 at the same time with an i7 and 3GB or RAM.
If you need help, and need support, feel free to contact with me.

Good finding!


BTCTC Address for Donations:  12PxVhcqdP2ZJLmeGnR33xfpBKA6nHsE2K
8  Alternate cryptocurrencies / Mining (Altcoins) / UNATTENDED RIG: Automatic overclocking,FANs control,mail sending,HW safe guarded on: January 03, 2013, 03:19:55 PM


DEAR BTCITCOINERS:

I am very glad to share with you my big effort carried out during several months together with my dear mining RIG provided of 3 ATI Radeon HD 5870.
This consists on an unattended and automatic controlled Mining RIG, that has provided a lot of benefits for me (hardware safe guard, automatic settings basing on temperature, Fans control, mail sending, etc), I hope it will be useful for others.
Of course I know that mining with GPUs is not really profitable now, but I am also waiting for an ASIC with 30 GH/s!!  Grin. My idea is to adapt all these scripts asapfor the mining with ASIC, and share it with you in case I see you consider this post valuable for you.

Note that I provide all this effort absolutely free!, however I would really grateful of receiving donations to my BTC address. That would encourage me for publishing other ideas and code with the BTC community.
(You can find my address at the end of the post).

First of all, let me indicate the benefits obtained from using these scripts:
  • All scripts are automatically started when switching on the system
  • All scripts can be  manually started by a single command
  • All scripts can be manually stopped by a single command
  • There is a control script in charge of the following actions:
    • Automatic overclocking of each GPUs basing on the GPU temperature, target temperature, etc
    • Automatic downclocking of each GPUs basing on the GPU temperature, target temperature, etc
    • Automatic starting of mining processes in the case they are abnormally stopped. (5 retries)
    • Sending of mails if the retry limit is reached, in order to inform of the problem to the user
    • Automatic shutting down of the mining processes in the case the temperature is very high. This will prevent a worse hardware failure in the GPUs
    • Automatic starting of the mining processes when the temperature is already safe for starting ythe mining
    • Automatic FAN control for each GPU from 30% to 100% of speed based on the temperature
  • There is a monitor script continuously sensing all system parameters for user supervision:
    • Current GPUs clocks 
    • Current FAN clocks 
    • Current temperature for each GPU
    • Temperatures of CPU, Motherboard, etc
    • Current hashrate for each GPU
    • Last 10 control scripts actions
  • The monitor script can be used thought ssh or telnet connection. In my case, I supervise my RIG though SSH from my mobile by using 'ConnectBot' application (see android or iPhone markets)
 
Before using the scripts, have a look to base system. Your system can be different to this, but I provide you all the code so that you can add any correction for adapting all to your system. The base system for running these scripts are the following:
  • Linux OS (I use Linux debian). All the scripts are coded on Linux shell.
  • ATI graphic cards (I have 3 ATI HD 5870). Note that I use 'aticonfig' software for almost everything
  • ATI drivers already installed, AMD SDK, etc. These guides were very useful for me:
  • lm-sensors package already installed (use apt-get or aptitude). This is for retrieving the CPU and motherboard temperatures
  • Screen package pre-installed (apt-get install screen). This tool will let us to run all scripts from the GUI, but sharing the console output with other sessions. This will let us monitor the system from telnet or SSH, as the console is shared (thanks to screen!!) .
  • I use poclbm.py for GPU mining. Other mining software will be ok, but you will need to change the related piece of code from the scripts
  • My system is fully unattended... so I also have installed VNC software for remote connection to the desktop (I have there my wallet)
  • I also have an automatic login in the system, so that when I switch on the system, the system is logged in, the scripts are automatically started and the wallet application is also started, getting updated with the BTC network transactions. (In my case, the RIG is installed in a cooled place very far from my house)
  • This script uses "reboot" and "halt" command without sudo password. To get it, read this link: http://sleekmason.wordpress.com/fluxbox/using-etcsudoers-to-allow-shutdownrestart-without-password/
    • I use "mail" command for sending mails. mail command must be available for the script (look for it on the internet).



    OK, after this brief introduction, let's go to the scripts. I wish you enjoy them!!


    I have the following little scripts for starting each of my individual mining process on my GPUs:

    gpu0.sh
    Code:
    #!/bin/bash
    export DISPLAY=:0.0
    cd /home/your_path/scripts
    DISPLAY=:0.0 aticonfig --pplib-cmd "set fanspeed 0 75"
    DISPLAY=:0 ./poclbm.py -d0 -v -r 5 -w128 http://your_user@mail.com:your_password@deepbit.net:8332 | tee mining_gpu0.log

    As you can see, I use a pool for mining (deepbit). You should change this line with your specific parameters for poclbm.py or other mining software.
    Note that I pipe the output to the 'tee' command in order to store the output of the process in a log file called "mining_gpu0.log". This will be useful later for monitoring the script output, as we will retrieve from these logs files the hashrate for each GPU.
    Note the parameter -r 5: This will make that the poclbm.py script will update the output (hashrate) one per each 5 seconds. The reason for this will be discussed later...

    You should create additional gpux.sh files, one for each GPU. In my case I have 3 GPUs, so I have these additional scripts:

    gpu1.sh
    Code:
    #!/bin/bash
    export DISPLAY=:0.1
    cd /home/your_path/scripts
    DISPLAY=:0.1 aticonfig --pplib-cmd "set fanspeed 0 75"
    DISPLAY=:0 ./poclbm.py -d0 -v -r 5 -w128 http://your_user@mail.com:your_password@deepbit.net:8332 | tee mining_gpu1.log


    gpu2.sh
    Code:
    #!/bin/bash
    export DISPLAY=:0.2
    cd /home/your_path/scripts
    DISPLAY=:0.2 aticonfig --pplib-cmd "set fanspeed 0 75"
    DISPLAY=:0 ./poclbm.py -d0 -v -r 5 -w128 http://your_user@mail.com:your_password@deepbit.net:8332 | tee mining_gpu2.log

    Is I said, I use the "screen" linux tool for sharing the outputs of the commands running. For example, we can share the script gpu0.sh in a shared console with the following command:
    Code:
    /usr/bin/screen -admS gpu0 ./gpu0.sh

    This will create a shared console called "gpu0", that can be accessible though telnet or ssh with the following command:
    Code:
    screen -x gpu0
    Therefore, we can watch the output of the execution of gpu0.sh. Note that for exiting in a shared console you have to use 'CTRL+A' and 'D' (to get detached of the shared console). Otherwise, you can stop the execution of gpu0.sh in that console.

    Now, we can define the script start.sh that will launch the mining scripts:

    start.sh
    Code:
    #!/bin/bash

    cd /home/your_path/scripts
    echo Starting mining scripts...
    /usr/bin/screen -admS gpu0 ./gpu0.sh
    /usr/bin/screen -admS gpu1 ./gpu1.sh
    /usr/bin/screen -admS gpu2 ./gpu2.sh
    ...

    Now, you can add this script (/home/your_path/start.sh) to your startup programs group. You can easily do it from from the system menu.

    The control script has a lot of features, It is full of comments so I expect you have enough information there.
    control.sh
    Code:
    #!/bin/bash
    #---times constants
    control_time=5       # Time cycle between control loops (5 seconds)
    overclock_delay=180  # waiting time between overclocking commands (It is multiplier of control_time (180*5 = 15 min)
    downclock_delay=60   # waiting time between downclocking commands (60*5 = 5 min)
    downclock_urgent=24  # waiting time between urgent downclocking commands (24*5 = 2 min)
    timeCounter=0        # time counter

    #---GPUs temperatures
    target_temp=75      # Target temp for the GPUs. Automatic Overclocking/downclocking will be performed for reaching this temperature as maximum.
    hightemp_alarm=80   # Alarm temperature: If exceeded, it will be performed an urgent downclocking
    maxtemp_stop=83     # maximum temperature in the GPUs: The mining process will be stopped for security resons.
    temp_recover=65     # recovery temperature: After a mining stop due to high temperature, when this safe temperature is reached, the mining is already started.
    control_gap=3       # Temperature below target_temp that is needed to be exceeded for an overclock command. (If current temperature is very near from the target temp, overclockin is not performed... we maintain the temp. near but below the limit) 

    #---CPU temperaturas
    tempCPU_halt=70     #If this temperature is reached by the CPU or motherboard, a HALT is performed for turning of the RIG.

    #---Clock limits
    corefreq_min=800    # Minimum freq. to be set by the control algorithm
    corefreq_max0=945   # Maximum freq. to be set by the control algorithm in GPU0 (In my case I checked that above 975Mhz this GPU hangs the X session)
    corefreq_max1=955   # Maximum freq. to be set by the control algorithm in GPU1 (In my case I checked that above 995Mhz the mining process got zombie)
    corefreq_max2=1025  # Maximum freq. to be set by the control algorithm in GPU2 (In my case I checked that above 1055Mhz the mining process got zombie)
    mem_freq=300       # Fixed value for memory clock (normally it is 1200MHz in the GPUs, but using 300MHz reduces the temperature without affecting to the performance)

    #--Mail sending
    subject="Important advice from your RIG"
    mail1="your_mail@mail.com"
    mail2="other_mail@mail.com"
    mail3="other_mail@mail.com"

    #--control constants
    retryMiningAfterFailure=1  # Mining scripts are automatically started after a failure
    debug=0       # enable/disable debugging messages
    numRetries=5       # Limit of retries for restarting the mining processes in the GPUs
    reboot=1                   # If zombie mining processes are detected, the control script can perform an automatic system reboot. This will recover mining in all GPUs.

    #--FAN constants
    FANGPU0=75
    FANGPU1=75
    FANGPU2=75

    #--Internal variables
    GPU0=0
    GPU1=1
    GPU2=2
    mining_stopped=0    # Mining process has been stopped by the control algorithm
    init_coreCLK0=900   # initial overclocking value for GPU0
    init_coreCLK1=900   # initial overclocking value for GPU1
    init_coreCLK2=900   # initial overclocking value for GPU2
    counterLastCLK0=0   # Stores the time of the last overclocking/downclocking performed on GPU0
    counterLastCLK1=0   # Stores the time of the last overclocking/downclocking performed on GPU1
    counterLastCLK2=0   # Stores the time of the last overclocking/downclocking performed on GPU2
    simulation=0       # Disables the overclockin, only logs outputs for debuguing .
    retriesGPU0=0
    retriesGPU1=0
    retriesGPU2=0
    alertFailProcessGPU0=0
    alertFailProcessGPU1=0
    alertFailProcessGPU2=0

    # ---------------------------------------------------------------------
    # Function Debug: It outputs messages to the console only in debug mode
    # Parameters: Text Message to be displayed
    # -----------------------------------------------------------------
    function debug(){
    if (test $debug -eq 1)
           then
        echo -e "[Time: $timeCounter | $(date | awk '{print $3 $2 $4}')] $@"
    fi
    }

    # ---------------------------------------------------------------------
    # Function output: This function output messages to the console
    # $1: Message
    # $2: if $2=1 the message is sent by email
    # ---------------------------------------------------------------------
    function output(){
    mensaje="[Time: $timeCounter | $(date | awk '{print $3 $2 $4}')] $1"
    echo -e $mensaje       
    if test $2 -eq 1
    then
    echo -e "$mensaje" | mail -s "$subject" $mail1
    echo -e "$mensaje" | mail -s "$subject" $mail2
    echo -e "$mensaje" | mail -s "$subject" $mail3
    fi
    }

    # ----------------------------------------------------------------
    # Function FANCommand: This function sets the FAN speed of a GPU
    # Params: $1:num_gpu: $GPU0,$GPU1,$GPU2
    #         $2:FAN_SPEED: Value from 0 to 100 %, ej: 100
    # Use:  FANCommand $GPU0 100
    # ----------------------------------------------------------------
    function FANCommand(){
    case $1 in
      0)
    DISPLAY=:0.0 aticonfig --pplib-cmd "set fanspeed 0 $2">>null;;
      1)
    DISPLAY=:0.1 aticonfig --pplib-cmd "set fanspeed 0 $2">>null;;
      2)
    DISPLAY=:0.2 aticonfig --pplib-cmd "set fanspeed 0 $2">>null;;
    esac
    output "  New setting: FAN GPU$1 to $2 %" 0
    }

    # ----------------------------------------------------------------
    # Function overclock: This function sets the clk of a GPU
    # Params: $1:num_gpu : $GPU0,$GPU1,$GPU2
    #         $2:clkfreq : core clk value to be set, ej: 850
    #         $3:memfreq : mem clk to be set, ej: 300 
    # Use:  overclock 0 850 1200
    # ----------------------------------------------------------------
    function overclock(){
    if test $simulation -eq 0
    then
    case $1 in
       0)
    aticonfig --adapter=0 --odsc=$2,$3 >>null;;
       1)
    aticonfig --adapter=1 --odsc=$2,$3 >>null;;
       2)
    aticonfig --adapter=2 --odsc=$2,$3 >>null;;
    esac
    fi
    output "  New setting: Overclock GPU$1 to $2 / $3 Mhz" 0
    }

    # ----------------------------------------------------------------
    # Function controlFAN: Calculates the FAN speed depending on the temperatures and current FAN speed (num_gpu, currentTemp, currentFAN)
    #   It performes the FAN speed control of a GPU
    # Params: $1:num_gpu : $GPU0,$GPU01,$GPU2
    #         $2:currentTemp: Current value reported by the GPU (no decimals), ej: 56
    #    $3:currentFAN:  Current FAN speed for this GPU, ej: 75 %
    #  
    # Use:  controlFAN $GPU0 56 75
    # ----------------------------------------------------------------
    function controlFAN(){

    #hysteresis of 2ºC around temperature threshold 55º
    if test $2 -lt 54
    then
    controlFAN=30
    elif test $2 -lt 56
    then
    if test $3 -ne 45
    then
    controlFAN=30
    fi
    #hysteresis of 2ºC around temperature threshold 60º
    elif test $2 -lt 59
    then
    controlFAN=45
    elif test $2 -lt 61
    then
    if test $3 -ne 60
    then
    controlFAN=45
    fi
    #hysteresis of 2ºC around temperature threshold 65º
    elif test $2 -lt 64
    then
    controlFAN=60
    elif test $2 -lt 66
    then
    if test $3 -ne 75
    then
    controlFAN=60
    fi
    #hysteresis of 2ºC around temperature threshold 70º
    elif test $2 -lt 69
    then
    controlFAN=75
    elif test $2 -lt 71
    then
    if test $3 -ne 90
    then
    controlFAN=75
    fi
    else
    controlFAN=90
      fi

    # It sends the FAN speed command only if the new setting is different to the current one.
    case $1 in
        0)
        debug "FAN control GPU0: Current FAN=$FANGPU0, controlFAN:$controlFAN"
      if test $controlFAN -ne $FANGPU0
                    then
      FANCommand 0 $controlFAN
    FANGPU0=$controlFAN
      fi;;
        1)
        debug "FAN control GPU1: Current FAN=$FANGPU1, controlFAN:$controlFAN"
      if test $controlFAN -ne $FANGPU1
                    then
      FANCommand 1 $controlFAN
    FANGPU1=$controlFAN
      fi;;
        2)
        debug "FAN control GPU2: Current FAN=$FANGPU2, controlFAN:$controlFAN"
      if test $controlFAN -ne $FANGPU2
                    then
      FANCommand 2 $controlFAN
    FANGPU2=$controlFAN
      fi;;
    esac
    }

    # ----------------------------------------------------------------
    # Function controlTemp: Calculates the GPU clock correction to be performed depending on the GPU temperatures (num_gpu, currentTemp, consignaTemp)
    #    It performes the overclocking/downclocking of the GPU
    # Params: $1:num_gpu : $GPU0,$GPU01,$GPU2
    #         $2:currentTemp: Current temperature reported by the GPU (no decimals), ej: 56
    #         $3:TargetTemp: Target temperature desired in this GPU as maximum, ej: 78
    # Outputs:
    #    counterLastCLK0, counterLastCLK1 y counterLastCLK2: Time information of the last CLK correction on each GPU.
    #  
    # Use:    controlTemp $GPU 56 78
    # ----------------------------------------------------------------
    function controlTemp(){
    offsetCLK=$(expr $3 - $2)

    # temperature gap defined in 'control_gap' is guaranteed to avoid causing stress to the GPU when the current temperature is very near to the target temperature
    if (test $offsetCLK -gt 0) && (test $offsetCLK -lt $control_gap)
    then
    debug "The correction ($offsetCLK) does not exceed the control GAP ($control_gap). CLK is maintained."
    return 1
    fi

    # Demanded frequencies are limited to the specific clk ranges of each GPU
    case $1 in
        0)
      demandaCLK=$(expr $coreCLK0 + $offsetCLK)
      if test $demandaCLK -gt $corefreq_max0
                    then
    demandaCLK=$corefreq_max0
               fi;;
        1)
      demandaCLK=$(expr $coreCLK1 + $offsetCLK)
      if test $demandaCLK -gt $corefreq_max1
      then
    demandaCLK=$corefreq_max1
               fi;;

        2)
      demandaCLK=$(expr $coreCLK2 + $offsetCLK)
      if test $demandaCLK -gt $corefreq_max2
                    then
    demandaCLK=$corefreq_max2
      fi;;
    esac

    if test $demandaCLK -lt $corefreq_min
           then
    demandaCLK=$corefreq_min
    fi

    debug "*** GPU$1 --> CurrentTemp:$2 - Consigna:$3 - Control:$demandaCLK ($offsetCLK)"

    # Sending of overclock command, only if there is a change.
    case $1 in
        0)
      if test $demandaCLK -ne $coreCLK0
                    then
      overclock 0 $demandaCLK $mem_freq
    counterLastCLK0=$timeCounter
    debug "Tiempo contCLK0: $counterLastCLK0"
      else
      debug "GPU0: Limit is already reached: $corefreq_max0."
      counterLastCLK0=$timeCounter
      fi;;
        1)
      if test $demandaCLK -ne $coreCLK1
                    then
    overclock 1 $demandaCLK $mem_freq
    counterLastCLK1=$timeCounter
    debug "Tiempo contCLK1: $counterLastCLK1"
      else
      debug "GPU1: Limit is already reached: $corefreq_max1."
      counterLastCLK1=$timeCounter
      fi;;
        2)
      if test $demandaCLK -ne $coreCLK2
                    then
    overclock 2 $demandaCLK $mem_freq
    counterLastCLK2=$timeCounter
    debug "Tiempo contCLK2: $counterLastCLK2"
      else
      debug "GPU2: Limit is already reached: $corefreq_max2."
      counterLastCLK2=$timeCounter
      fi;;
    esac
    }


    # ----------------------------------------------------------------
    # Function checkOverclockTimeGuard: This function ensures a certain period of time between consecutives overclock commands.
    # - Guard Time between overclocks: $overclock_delay*$control_time (180*5 = 15 minutes)
    # - Guard Time between downclocks: $downclock_delay*$control_time (60*5 = 5 minutes)
    # - Guard time between urgent downclocks: $downclock_urgent*$control_time (24*5 = 2 minutes)
    # Params: $1:num_gpu : 0,1,2
    #         $2:timeCounter: Current value of the time counter
    #         $3:up_down: 0:overclock, 1:downclock, 2:urgent downclock
    # Outputs:
    #    $return_correction: 0:Not to perform CLK correction. 1:CLK correction can be performed now.
    # ----------------------------------------------------------------
    function checkOverclockTimeGuard (){
    return_correction=0
    case $1 in
    0)
    if test $3 -eq 0
                         then  ##overclock
    due_time=$(expr $counterLastCLK0 + $overclock_delay)
    if test $2 -ge $due_time
                                then
    return_correction=1
    fi
    elif test $3 -eq 1
                         then  ##normal downclocking
    due_time=$(expr $counterLastCLK0 + $downclock_delay)
    if test $2 -ge $due_time
                                then
    return_correction=1
    fi

    elif test $3 -eq 2
                         then  ##urgent downclocking
    due_time=$(expr $counterLastCLK0 + $downclock_urgent)
    if test $2 -ge $due_time
                                then
    return_correction=1
    fi
    fi;;
           1)
    if test $3 -eq 0
                         then  ##overclocking
    due_time=$(expr $counterLastCLK1 + $overclock_delay)
    if test $2 -ge $due_time
                                then
    return_correction=1
    fi
    elif  test $3 -eq 1
                         then  ##normal downclocking
    due_time=$(expr $counterLastCLK1 + $downclock_delay)
    if test $2 -ge $due_time
                                then
    return_correction=1
    fi
    elif test $3 -eq 2
                         then  ##urgent downclocking
    due_time=$(expr $counterLastCLK1 + $downclock_urgent)
    if test $2 -ge $due_time
                                then
    return_correction=1
    fi
    fi;;
           2)
    if test $3 -eq 0
                         then  ##overclocking
    due_time=$(expr $counterLastCLK2 + $overclock_delay)
    if test $2 -ge $due_time
                                then
    return_correction=1
    fi
    elif test $3 -eq 1
                         then  ##normal downclocking
    due_time=$(expr $counterLastCLK2 + $downclock_delay)
    if test $2 -ge $due_time
                                then
    return_correction=1
    fi
    elif test $3 -eq 2
                         then  ##urgent downclocking
    due_time=$(expr $counterLastCLK2 + $downclock_urgent)
    if test $2 -ge $due_time
                                then
    return_correction=1
    fi
    fi;;
    esac
    debug "-------GPU$1: due_time: $due_time, correction: $return_correction"
    }

    # ---------------------------------------------------------------------------------------------------------
    # MAIN - MAIN - MAIN - MAIN - MAIN - MAIN - MAIN - MAIN - MAIN - MAIN - MAIN - MAIN - MAIN - MAIN - MAIN
    # ---------------------------------------------------------------------------------------------------------
    #Overclockin enabling
    aticonfig --adapter=0 --od-enable   
    aticonfig --adapter=1 --od-enable   
    aticonfig --adapter=2 --od-enable   
    overclock 0 $init_coreCLK0 $mem_freq 
    overclock 1 $init_coreCLK1 $mem_freq 
    overclock 2 $init_coreCLK2 $mem_freq   
    FANCommand 0 30
    FANCommand 1 30
    FANCommand 2 30
    output "Automatic control algorithm has been started" 1  #This is sent by email.
    output "Automatic FAN speed control starts from 30%" 0
    while true; do

    #Fetching of current temperatures
    tempGPU0=$(aticonfig --adapter=0 --od-gettemperature | tail -n1 | awk '{print $5}' | cut -c1-2)
    tempGPU1=$(aticonfig --adapter=1 --od-gettemperature | tail -n1 | awk '{print $5}' | cut -c1-2)
    tempGPU2=$(aticonfig --adapter=2 --od-gettemperature | tail -n1 | awk '{print $5}' | cut -c1-2)
    tempCPU=$(sensors |grep CPU |grep Temperature | awk '{print $3}'|cut -c2-3)
    tempMB=$(sensors |grep NB |grep Temperature | awk '{print $3}'|cut -c2-3)

    #Fetching of current GPU CLK frequencies
    coreCLK0=$(aticonfig --adapter=0 --odgc |grep Clocks | awk '{print $4}')
    memCLK0=$(aticonfig --adapter=0 --odgc |grep Clocks | awk '{print $5}')
    coreCLK1=$(aticonfig --adapter=1 --odgc |grep Clocks | awk '{print $4}')
    memCLK1=$(aticonfig --adapter=1 --odgc |grep Clocks | awk '{print $5}')
    coreCLK2=$(aticonfig --adapter=2 --odgc |grep Clocks | awk '{print $4}')
    memCLK2=$(aticonfig --adapter=2 --odgc |grep Clocks | awk '{print $5}')

      #It detects if there are mining processes already running
      miningIsActive0=$(ls /var/run/screen/S-your_user/ |grep gpu0 |wc -l)   # we look for the 'screen' session lock file
            miningIsActive1=$(ls /var/run/screen/S-your_user/ |grep gpu1 |wc -l)   # we look for the 'screen' session lock file
            miningIsActive2=$(ls /var/run/screen/S-your_user/ |grep gpu2 |wc -l)   # we look for the 'screen' session lock file

    loadGPU0=$(aticonfig --adapter=0 --odgc |grep GPU |awk '{print $4}' | cut -c1-2)  # It is also checked the load of each GPU
    loadGPU1=$(aticonfig --adapter=1 --odgc |grep GPU |awk '{print $4}' | cut -c1-2)
    loadGPU2=$(aticonfig --adapter=2 --odgc |grep GPU |awk '{print $4}' | cut -c1-2)
    debug " --> Temps: $tempGPU0, $tempGPU1, $tempGPU2"
    debug " --> Clks: $coreCLK0, $coreCLK1, $coreCLK2"

    # --------------------------------Temperature of CPU and Motherboard ---------------------------------------
    if (test $tempCPU -gt $tempCPU_halt) || (test $tempMB -gt $tempCPU_halt)
            then
    output "ERR: Temperature of CPU/MB is too high! $tempCPU / $tempMB.... \nSWITCHING OFF THE SYSTEM. \n Check the CPU FAN condition and switch the RIG on manually." 1
    /usr/bin/halt
    fi

    # Checking of zombie mining processes.
    num_defunc=$(ps -Al |grep py|grep defunc| wc -l) 
    if test $num_defunc -gt 0
          then
    if test $reboot -eq 1
    then
        output "### ERR: There are one or more zombie mining processes:
    \nMaybe a mining process is hanged and blocked.
    \nIt is neccesary to restart the system for recovering the mining (sudo reboot).
    \n$(ps -Al |grep py|grep defunc| wc -l)
    \n --> PERFORMING AN AUTOMATIC REBOOT OF THE SYSTEM...." 1    # Sent my email
    /usr/bin/reboot
    else
    output "### ERR: There are one or more zombie mining processes:
    \nMaybe a mining process is hanged and blocked.
    \nIt is neccesary to restart the system for recovering the mining (sudo reboot).
    \n$(ps -Al |grep py|grep defunc| wc -l)" 1                    # Sent my email
    fi
    fi

    # --------------------------------Init checkings -------------------------------
    if (test $miningIsActive0 -eq 0)
            then
    if (test $mining_stopped -eq 0) && (test $retryMiningAfterFailure -eq 1)
                  then
    if test $retriesGPU0 -lt $numRetries
                         then
    output "### ERR the mining process in GPU0 is not started ......" 0
    output "*** Starting mining on GPU0..." 0
    overclock 0 $init_coreCLK0 $mem_freq 
    coreCLK0= $init_coreCLK0
    /usr/bin/screen -admS gpu0 ./gpu0.sh
    retriesGPU0=$(expr $retriesGPU0 + 1)
    elif test $alertFailProcessGPU0 -eq 0
    then
    output "### ERR Mining retries limit has been reached in the process GPU0.sh
    \n*** Check that the process is not zombie and start it manually " 1    # Sent by email
    alertFailProcessGPU0=1
    fi
    fi
    fi

    if (test $miningIsActive1 -eq 0)
            then
    if (test $mining_stopped -eq 0) && (test $retryMiningAfterFailure -eq 1)
                  then
    if test $retriesGPU1 -lt $numRetries
                         then
    output "### ERR the mining process in GPU1 is not started ......" 0
    output "*** Starting mining on GPU1..." 0
    overclock 1 $init_coreCLK1 $mem_freq 
    coreCLK1= $init_coreCLK1
    /usr/bin/screen -admS gpu1 ./gpu1.sh
    retriesGPU1=$(expr $retriesGPU1 + 1)
    elif test $alertFailProcessGPU1 -eq 0       
    then
    output "### ERR Mining retries limit has been reached in the process GPU1.sh
    \n*** Check that the process is not zombie and start it manually " 1    # Sent by email
          alertFailProcessGPU1=1
    fi
    fi
    fi


    if (test $miningIsActive2 -eq 0)
            then
    if (test $mining_stopped -eq 0) && (test $retryMiningAfterFailure -eq 1)
                  then
    if test $retriesGPU2 -lt $numRetries
                         then
    output "### ERR the mining process in GPU2 is not started ......" 0
    output "*** Starting mining on GPU2..." 0
    overclock 2 $init_coreCLK2 $mem_freq 
    coreCLK2= $init_coreCLK2
    /usr/bin/screen -admS gpu2 ./gpu2.sh
    retriesGPU2=$(expr $retriesGPU2 + 1)
    elif test $alertFailProcessGPU2 -eq 0
    then
    output "### ERR Mining retries limit has been reached in the process GPU2.sh
    \n*** Check that the process is not zombie and start it manually " 1    # Sent by email
    alertFailProcessGPU2=1   
    fi
    fi
    fi


    # --------------------------------Automatic switching off control -----------------------------
    if (test $tempGPU0 -gt $maxtemp_stop) || (test $tempGPU1 -gt $maxtemp_stop) || (test $tempGPU2 -gt $maxtemp_stop)
    then
    if (test $mining_stopped -eq 0)
    then

    if test $retryMiningAfterFailure -eq 1
    then
    output "ERR: Extreme temperature in GPUs ($tempGPU0, $tempGPU1, $tempGPU2 ºC) - Switching off the mining...
           \n After some minutes it will be strated again ..." 1   # Sent by email
    else
    output "ERR: Extreme Temperature in GPUs ($tempGPU0, $tempGPU1, $tempGPU2 ºC) - Switching off the mining...
           \n Start the mining process manually ..." 1 # Sent by email
    fi
    ./stop.sh
    mining_stopped=1
    fi

    else  # As soon as the GPUs temperatures are below temp_recover, mining is started again.  
        if (test $mining_stopped -eq 1) && (test $retryMiningAfterFailure -eq 1) 
        then
    if (test $tempGPU0 -lt $temp_recover) || (test $tempGPU1 -lt $temp_recover) || (test $tempGPU2 -lt $temp_recover)
    then
    # It Sets safe GPUs clock values
    output "The temperature of the GPUs has been recovered to $tempGPU0 / $tempGPU1 / $tempGPU2" 0
    output "GPUS clocks are stablished to 850/300 MHz." 0
    overclock 0 $init_coreCLK0 $mem_freq 
    overclock 1 $init_coreCLK1 $mem_freq 
    overclock 2 $init_coreCLK2 $mem_freq 
    coreCLK0= $init_coreCLK0
    coreCLK1= $init_coreCLK1
    coreCLK2= $init_coreCLK2
    retriesGPU0=0
    retriesGPU1=0
    retriesGPU2=0
    output " --> Starting mining." 0
    ./minar.sh
    mining_stopped=0
    fi
        fi
    fi

    #------------------------------  Overclocking control on GPU0 ----------------------------------

    if (test $mining_stopped -eq 0) && (test $miningIsActive0 -eq 1)
    then
    #The temperature is within the control margins, below target temp
    if (test $tempGPU0 -lt $target_temp)
              then   
    checkOverclockTimeGuard $GPU0 $timeCounter 0
    if test $return_correction -eq 1
                  then
    controlTemp $GPU0 $tempGPU0 $target_temp
    fi

    #The temperature is outside the control margins, below the alarm temp
    elif (test $tempGPU0 -lt $hightemp_alarm)
            then
    checkOverclockTimeGuard $GPU0 $timeCounter 1 #downclocking
    if test $return_correction -eq 1
                  then
    controlTemp  $GPU0 $tempGPU0 $target_temp
    fi

    # Overtemp alarm
    elif (test $tempGPU0 -lt $maxtemp_stop)
            then
    output "Alarm! GPU0 very hot, temperature: $tempGPU0. Performing urgent downclocking ...." 1    #Sent by email
    checkOverclockTimeGuard $GPU0 $timeCounter 2 #urgent downclocking
    if test $return -eq 1
                  then
    controlTemp  $GPU0 $tempGPU0 $target_temp
    fi
    fi
    # FAN Speed control
    controlFAN $GPU0 $tempGPU0 $FANGPU0
    fi

    #------------------------------  Overclocking control on GPU1 ----------------------------------

    if (test $mining_stopped -eq 0) && (test $miningIsActive1 -eq 1)
    then
    #The temperature is within the control margins, below target temp
    if (test $tempGPU1 -lt $target_temp) && (test $miningIsActive1 -eq 1) && (test $mining_stopped -eq 0) 
            then   
    checkOverclockTimeGuard $GPU1 $timeCounter 0
    if test $return_correction -eq 1
                  then
    controlTemp  $GPU1 $tempGPU1 $target_temp
    fi

    #The temperature is outside the control margins, below the alarm temp
    elif (test $tempGPU1 -lt $hightemp_alarm) && (test $miningIsActive1 -eq 1) && (test $mining_stopped -eq 0)
            then
    checkOverclockTimeGuard $GPU1 $timeCounter 1 #downclocking
    if test $return_correction -eq 1
                  then
    controlTemp  $GPU1 $tempGPU1 $target_temp
    fi

    # Overtemp alarm
    elif (test $tempGPU1 -lt $maxtemp_stop) && (test $miningIsActive1 -eq 1) && (test $mining_stopped -eq 0)
            then
    output "Alarm! GPU1 very hot, temperature: $tempGPU1. Performing urgent downclocking ...." 1    #Sent by email
    checkOverclockTimeGuard $GPU1 $timeCounter 2 #urgent downclocking
    if test $return_correction -eq 1
                  then
    controlTemp  $GPU1 $tempGPU1 $target_temp
    fi
    fi
    # FAN Speed control
    controlFAN $GPU1 $tempGPU1 $FANGPU1
    fi
    #------------------------------  Overclocking control on GPU2 ----------------------------------
    if (test $mining_stopped -eq 0) && (test $miningIsActive2 -eq 1)
    then
    #The temperature is within the control margins, below target temp
    if (test $tempGPU2 -lt $target_temp) && (test $miningIsActive2 -eq 1) && (test $mining_stopped -eq 0)
            then   
    checkOverclockTimeGuard $GPU2 $timeCounter 0
    if test $return_correction -eq 1
                  then
    controlTemp  $GPU2 $tempGPU2 $target_temp
    fi

    #The temperature is outside the control margins, below the alarm temp
    elif (test $tempGPU2 -lt $hightemp_alarm) && (test $miningIsActive2 -eq 1) && (test $mining_stopped -eq 0)
            then
    checkOverclockTimeGuard $GPU2 $timeCounter 1 #downclocking
    if test $return_correction -eq 1
                  then
    controlTemp  $GPU2 $tempGPU2 $target_temp
    fi

    # Overtemp alarm
    elif (test $tempGPU2 -lt $maxtemp_stop) && (test $miningIsActive2 -eq 1) && (test $mining_stopped -eq 0)
            then
    output "Alarm! GPU2 very hot, temperature: $tempGPU2. Performing urgent downclocking ...." 1    #Sent by email
    checkOverclockTimeGuard $GPU2 $timeCounter 2 #urgent downclocking
    if test $return_correction -eq 1
                  then
    controlTemp  $GPU2 $tempGPU2 $target_temp
    fi
    fi
    # FAN Speed control
    controlFAN $GPU2 $tempGPU2 $FANGPU2
    fi
    timeCounter=$(expr $timeCounter + 1)
    sleep $control_time;
    done

    A brief description of the control script:
    • You can change the minimum/maximum clock settings for each of your GPUs. I manually identified the limits by getting the system hang lot several times.  Roll Eyes
    • I also realized that when playing with the limits, before hanging the system, sometimes a mining process got zombie (by using PS). In this situation, I was not able to recover the process, neither trying to kill the parent process... the only way was to restart the system. This control algorithm is restarting the system when finding zombie processes.
    • You can play with all constants for tuning the script to your own system. Almost everything is configurable (retries number, mails sending, debugging logs, halt/reboot commands, etc.
    • Change the email addresses by yours
    • 1. The algorithm first obtain the GPUs temperatures, CPU temperatures, current clocks settings, checks if the mining processes are active, etc
    • 2. In case the CPU temperature is very high (70ºC), the script switches off the system and report by email (This protects the system hardware from a overtemperature in the CPU)
    • 3. It checks if there are zombie processes (As discussed before). If so, the script can reboot the system and report by email. (depends on if constant reboot=1)
    • 4. It checks if any of the GPUS is not mining... if so it retries the mining by starting the script gpux.sh. There is a retry limit of 5. It reached it is also reported by email
    • 5. In case a GPU has reached a very high temperature (83ºC) it stops all mining processes. After the temperature has been recovered, it restart the mining.
    • 6. For each GPU, the script perform an automatic control of the GPU clock by overclockin, downclocking and urgent downclocking when needed. 
    • 7. For each GPU, the script perform an automatic control of the FAN speed. 

    As I did for the gpux.sh scripts, I like to launck the control from another script tubing the output to the tee command in order to store the logs in a file. Therefore we will easily get them
    from the monitor script:

    start_control.sh
    Code:
    #!/bin/bash
    cd /home/your_user/scripts
    ./control.sh | tee control.log

    Now, let's go to the monitor script:

    monitor.sh
    Code:
    #!/bin/bash
    while true; do
            echo "---------------- GPUs Health ----------------"
            aticonfig --adapter=0 --od-gettemperature | tail -n1 | awk '{print "GPU0 Temperature: " $5}' ;
            aticonfig --adapter=1 --od-gettemperature | tail -n1 | awk '{print "GPU1 Temperature: " $5}' ;
            aticonfig --adapter=2 --od-gettemperature | tail -n1 | awk '{print "GPU2 Temperature: " $5}' ;
            echo $(aticonfig --adapter=0 --odgc | grep GPU);
            echo $(aticonfig --adapter=1 --odgc | grep GPU);
    echo $(aticonfig --adapter=2 --odgc | grep GPU);
            echo "GPU FANS: $(DISPLAY=:0.0 aticonfig --pplib-cmd 'get fanspeed 0'|grep Result |cut -d ' ' -f 4) / $(DISPLAY=:0.1 aticonfig --pplib-cmd 'get fanspeed 0'|grep Result |cut -d ' ' -f 4) / $(DISPLAY=:0.2 aticonfig --pplib-cmd 'get fanspeed 0'|grep Result |cut -d ' ' -f 4)"
            echo "Overclocking...."
            echo "-   Core Clocks: $(aticonfig --adapter=0 --odgc |grep Clocks |cut -d ' ' -f 18) / $(aticonfig --adapter=1 --odgc |grep Clocks |cut -d ' ' -f 18) / $(aticonfig --adapter=2 --odgc |grep Clocks |cut -d ' ' -f 18) Mhz."
            echo "-   Mem Clocks: $(aticonfig --adapter=0 --odgc |grep Clocks |cut -d ' ' -f 29) / $(aticonfig --adapter=1 --odgc |grep Clocks |cut -d ' ' -f 29) / $(aticonfig --adapter=2 --odgc |grep Clocks |cut -d ' ' -f 29) Mhz."
    #echo " "
    echo ----------------  PC health -------------------
            echo $(sensors |grep CPU |grep Temperature) | cut -d ' ' -f 1,2,3
            echo $(sensors |grep NB |grep Temperature) | cut -d ' ' -f 1,2,3
            echo $(sensors |grep SB |grep Temperature) | cut -d ' ' -f 1,2,3
    echo "HDD Avail: $(df -h |grep sda1 |cut -d ' ' -f 20)"
            #echo " "
    echo "---------------- Mining rate ------------------"
            # Check if there are Screen lock files....
            IsMining_gpu0=$(ls /var/run/screen/S-your_user/ |grep gpu0 |wc -l)
            IsMining_gpu1=$(ls /var/run/screen/S-your_user/ |grep gpu1 |wc -l)
            IsMining_gpu2=$(ls /var/run/screen/S-your_user/ |grep gpu2 |wc -l)
            # Last Hashrate report
    if test $IsMining_gpu0 -ge 1
    then
    echo "Mining on GPU0: " $(cat mining_gpu0.log | cut -d '[' -f 2)
    else
    echo "Mining on GPU0:  ERR! Mining Process is stopped!"
    fi

            if test $IsMining_gpu1 -ge 1
            then
    echo "Mining on GPU1: " $(cat mining_gpu1.log | cut  -d '[' -f 2)
            else
                  echo "Mining on GPU1:  ERR! Mining process is stopped!"
            fi
            if test $IsMining_gpu2 -ge 1
            then
    echo "Mining on GPU2: " $(cat mining_gpu2.log | cut -d '[' -f 2)
            else
                  echo "Mining on GPU2:  ERR! Mining process is stopped!"
            fi
    #Erase mining logs... next loop we will find only the hashrate.
    echo "" > mining_gpu0.log
    echo "" > mining_gpu1.log
    echo "" > mining_gpu2.log
            controlIsActive=$(ls /var/run/screen/S-vamach/ |grep control |wc -l)
            #echo " "
    echo "---------- Logs Mining Controller -------------"
    if test $controlIsActive-ge 1
            then
                    tail -5 control.log
            else
                    echo "Control algorithm is OFF"
            fi
      sleep 5;
            clear
    done


    A few notes for the monitor script:
    • Note that the GPUs logs are erased at each loop. The time between loops is 5 seconds, exactly the same as the display rate of the poclbm.py. This way, we ensure that in the logs we will always find a single report of hashrates. In addition, the logs will not be increasing forever. 
    • the monitor script is also displaying the last 5 lines of the control script logs, stored in the file control.log

    As before, I launch the monitor.sh script from start_monitor.sh:

    start_monitor.sh
    Code:
    #!/bin/bash
    cd /home/your_user/scripts
    monitorIsRunning=$(ls /var/run/screen/S-your_user/ |grep monitor |wc -l)
    if test $monitorIsRunning -ge 1
    then
    echo "Monitor script is already running in another Screen. Getting attached..."
    screen -x monitor
    else
    echo "Monitor script is not running. Starting..."
    /usr/bin/screen -admS monitor ./monitor.sh
    fi

    As you can see, this script is valid both for starting the monitor or for attaching to the screen in which the monitor is already running.
    I did a symbolic link  to this file called "m" (see ln command). From then, all I need to do for monitoring my rig is entering "m" in the console. (this is very comfortable when accessing to the RIG from my mobile)  Grin


    This is the output of the monitor script (updated each 5 seconds):


    ---------------- GPUs Health ----------------
    GPU0 Temperature: 57.50
    GPU1 Temperature: 54.50
    GPU2 Temperature: 57.50
    GPU load : 98%
    GPU load : 97%
    GPU load : 98%
    GPU FANS: 45% / 45% / 45%
    Overclocking....
    -   Core Clocks: 945 / 955 / 1020 Mhz.
    -   Mem Clocks: 300 / 300 / 300 Mhz.
    ---------------- PC health -------------------
    CPU Temperature: +31.0°C
    NB Temperature: +43.0°C
    SB Temperature: +31.0°C
    HDD Avail: 2GB
    ---------------- Mining rate ------------------
    Mining on GPU0:  402.743 MH/s (~458 MH/s)]
    Mining on GPU1:  405.513 MH/s (~568 MH/s)]
    Mining on GPU2:  435.513 MH/s (~598 MH/s)]
    ---------- Logs Mining Controller -------------
    [Time: 18616 | 3ene15:50:30] New setting: FAN GPU0 to 30 %
    [Time: 18617 | 3ene15:50:35] New setting: FAN GPU0 to 45 %
    [Time: 18618 | 3ene15:50:40] New setting: FAN GPU1 to 45 %
    [Time: 18783 | 3ene16:05:29] New setting: FAN GPU1 to 30 %
    [Time: 18787 | 3ene16:05:51] New setting: FAN GPU1 to 45 %


    Now, we can complete the start.sh script for adding the control and monitor scripts:


    start.sh
    Code:
    !/bin/bash

    cd /home/your_path/scripts
    echo Starting mining scripts...
    /usr/bin/screen -admS gpu0 ./gpu0.sh
    /usr/bin/screen -admS gpu1 ./gpu1.sh
    /usr/bin/screen -admS gpu2 ./gpu2.sh
    echo Starting monitor script...
    /usr/bin/screen -admS monitor ./monitor.sh
    echo Starting automatic control script...
    /usr/bin/screen -admS control ./start_control.sh
    echo " "
    echo For monitoring the RIG, enter m. 

    And of course, we will need a stop.sh script for stopping all the mining scripts, monitor and control scripts:

    stop.sh
    Code:
    #!/bin/bash
    screen -X -S gpu0 kill
    screen -X -S gpu1 kill
    screen -X -S gpu2 kill
    screen -X -S monitor kill
    screen -X -S control kill
    killall screen

    That's all folks!!

    I hope you liked this post, and will be useful for your mining systems!!



    If you liked this post, and want to send me a donation, I will be very gratefull, and will give me energy for sharing other works.
    BTCTC Address:  1NKJuhGCx7HM2skXdzAkfnxJyfsubh475A


9  Other / Beginners & Help / Re: Bitcoin Linux OS on: September 17, 2012, 05:42:24 AM
I have currently my debian linux in a USB pendrive, but it was not a very good idea... now thinking on migrating it to a fixed hard drive.

I found that due to the continuous updating of the bitcoin information blocks by the Bitcoin-QT application, the USB interface is busy many of the times.... This makes the system to have lags when using common resources (local terminal, SSH, VNC, etc).



10  Other / Beginners & Help / Re: HOWTO: create a 100% secure wallet on: September 17, 2012, 05:33:46 AM
Thanks for the hint.
I will try to find my wallet password, I don't remember where I put it!

 Cheesy
11  Other / Beginners & Help / Re: Butterfly Jalapeno Asic Device on: September 17, 2012, 05:31:02 AM
I have pre-order two jalapenos... At the end, I gave the purchase rights of one of them to one of my miner colleagues.

Many people think it is a risk to pre-order, as soon as the Jalapeno development is not fully finished. But, in order to have any opportunity with these devices I think it is important not to wait too much. The mining difficulty is growing very wast, and the reward is decreasing....  Mining with GPUs is not profitable any more... ASICs is the best opportunity we have now, however no one will become rich with this, But will enjoy. There is many people mining in the network, someones with big Farms!!  Cheesy

I expect the Jalapenos are in their very last testing phase, hopefully in our hands before ending of this new year.
12  Other / Beginners & Help / Re: Introduce yourself :) on: September 17, 2012, 05:20:59 AM
Hi!

My name is Nacho, I have worked hard in an automatic linux control script for providing an unnatended mining RIG.
As soon as I get out of the restricted Newbies area, I would like to share my work with the bitcoin community.

Best Greetings to all people in the forum that have provided lot of information for tuning up my mining system.
13  Other / Beginners & Help / Re: Newbie restrictions on: September 17, 2012, 05:14:12 AM
Thanks for the new restriction... It is more sensible
Anyway a bit annoying. No restrictions would be better :-)
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!