Bitcoin Forum
December 08, 2016, 02:15:33 AM *
News: To be able to use the next phase of the beta forum software, please ensure that your email address is correct/functional.
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Silly linux scripts and tricks  (Read 3116 times)
supa
Jr. Member
*
Offline Offline

Activity: 42


View Profile
June 13, 2011, 06:46:06 AM
 #1

Code:
#!/bin/bash
while [ 1 ]; do
        echo "<html><head><meta http-equiv=\"refresh\" content=\"5\"/><body>$(aticonfig --adapter=all --odgt | sed ':a;N;$!ba;s/\n/<br\/>/g')<body></html>" | nc -l 9001
done

I realized we have a lot of new Linux users out there, so here's a simple script to keep you away from the GUI.

Put the above in a file, chmod u+x it, run it.  That's it.  Connect with a browser to whatever the host is, port 9001.

Requires netcat (nc).

Feel free to replace "aticonfig --adapter=all --odgt" with whatever you like - use tee to redirect your miner output or whatever you want to a file, then push that through netcat.

Let's say you've got a script called startminer.sh that starts poclbm (or whatever).  You can use the following to start it:

startminer.sh | tee -a minerlog.log

Then use -
Code:
#!/bin/bash
while [ 1 ]; do
        echo "<html><head><meta http-equiv=\"refresh\" content=\"5\"/><body>$(sed ':a;N;$!ba;s/\n/<br\/>/g' < minerlog.log)<body></html>" | nc -l 9001
done

For ssh sessions, don't forget that happy watch command -
watch -n 1 aticonfig --adapter=all --odgt

Will continuously print to the screen the output from aticonfig every 1 second.

And finally, if you're using eligius, don't forget there are both EU and US servers.

I haven't been able to test the following script... eligius servers haven't gone down.  But the idea is if you had a line in your /etc/hosts like:

173.242.112.67 eligius.mining

And pointed a miner at http://eligius.mining:8337 while the script below ran..... if the hashrate for that server hit 0 or was otherwise unreachable it should "failover" to the other server.

Code:
#!/bin/bash

EUHTTP="http://eligius.st/~luke-jr/raw/eu/hashrate.txt"
USHTTP="http://eligius.st/~luke-jr/raw/us/hashrate.txt"

EUIP="85.25.78.8"
USIP="173.242.112.67"

export EUIP
export USIP

CURRENT=$USHTTP

echo $EUIP
echo $USIP

while [ 1 == 1 ]; do
echo "Checking..."

HR=$(wget -q -O - $CURRENT)

if [ -z "$HR" ]
then
HR="0"
fi

echo "Hashrate $HR"

if [ $CURRENT == $USHTTP ]
then
if [ $HR == 0 ]
then
cp /etc/hosts /tmp/hosts
sed s/$USIP/$EUIP/ < /tmp/hosts > /etc/hosts
echo "Switched to Europe."
CURRENT=$EUHTTP
fi
elif [ $CURRENT == $EUHTTP ]
then
if [ $HR == 0 ]
then
cp /etc/hosts /tmp/hosts
sed s/$EUIP/$USIP/ < /tmp/hosts > /etc/hosts
echo "Switched to US."
CURRENT=$USHTTP
fi
fi
sleep 5m
done

1481163333
Hero Member
*
Offline Offline

Posts: 1481163333

View Profile Personal Message (Offline)

Ignore
1481163333
Reply with quote  #2

1481163333
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1481163333
Hero Member
*
Offline Offline

Posts: 1481163333

View Profile Personal Message (Offline)

Ignore
1481163333
Reply with quote  #2

1481163333
Report to moderator
1481163333
Hero Member
*
Offline Offline

Posts: 1481163333

View Profile Personal Message (Offline)

Ignore
1481163333
Reply with quote  #2

1481163333
Report to moderator
1481163333
Hero Member
*
Offline Offline

Posts: 1481163333

View Profile Personal Message (Offline)

Ignore
1481163333
Reply with quote  #2

1481163333
Report to moderator
hugolp
Hero Member
*****
Offline Offline

Activity: 742



View Profile
June 13, 2011, 07:24:19 AM
 #2

I know I am getting repetitive but it would be great if we could get someway to get the consumption and the rest of the temperature sensors in Linux.

With AMDOverdriveCtrl you can see the voltage, but it does not tell you the current. You need both to know the consumption. The cards measure it because windows applications allow you to know.

There is this application called radeonvolt but it only works with a few selected cards.

Anyone has a solution?
supa
Jr. Member
*
Offline Offline

Activity: 42


View Profile
June 13, 2011, 07:40:43 AM
 #3

There's this -


aticonfig --pplib-cmd "get activity"
Current Activity is Core Clock: 1005MHZ
Memory Clock: 225MHZ
VDDC: 1088
Activity: 99 percent
Performance Level: 2
Bus Speed: 2500
Bus Lanes: 16
Maximum Bus Lanes: 16


But there's no current amp or wattage.  What Windows thing gives you a power consumption listing?

hugolp
Hero Member
*****
Offline Offline

Activity: 742



View Profile
June 13, 2011, 07:51:13 AM
 #4

There's this -


aticonfig --pplib-cmd "get activity"
Current Activity is Core Clock: 1005MHZ
Memory Clock: 225MHZ
VDDC: 1088
Activity: 99 percent
Performance Level: 2
Bus Speed: 2500
Bus Lanes: 16
Maximum Bus Lanes: 16


But there's no current amp or wattage.  What Windows thing gives you a power consumption listing?

I know of gpu-z but there are others. There is also the issue of the rest of sensors.

I guess I could look into the code of radeonvolt to see how it does it and try to adapt it to my card... :snooze: Now seriously, there are ways to get the info, its kind of sad that no linux frontend (GUI or comand line) to get that info exists.
supa
Jr. Member
*
Offline Offline

Activity: 42


View Profile
June 13, 2011, 08:07:27 AM
 #5


Sounds like a great opportunity for you to provide one! Smiley

I didn't ignore your original request - I've been digging around in aticonfig and pplib stuff but haven't found anything that gives me an amperage or estimated power use - only voltages.

hugolp
Hero Member
*****
Offline Offline

Activity: 742



View Profile
June 13, 2011, 09:00:55 AM
 #6


Sounds like a great opportunity for you to provide one! Smiley

I didn't ignore your original request - I've been digging around in aticonfig and pplib stuff but haven't found anything that gives me an amperage or estimated power use - only voltages.

Ive been looking at the code of radeonvolt, its not complicated, but to get the info you need to know the graphic card protocol, which I dont, it takes time and its boring as hell. And for someone who already knows it, it would be quite easy to provide it, or even hack radeonvolt to accept more types of cards...

I would actually pay some bitcoins to someone willing to actualize radeonvolt or AMDOverdriveCtrl (or a new one) to provide that info. Maybe we can start a bounty.

EDIT: I have checked the AMD ADL Library (the one used by AMDOverdriveCtrl) and it does not allow to access current or other temprearture sensors. It actually allows to access what AMDOverdriveCtrl is already showing. To get the rest of the info you need to access the card (via i2c I believe) and its probably different for every model.

If anyone is willing to upgrade radeonvolt (or AMDOverdriveCtrl or a new one) to read 5870 cards I am willing to give 5btc bounty.
inh
Full Member
***
Offline Offline

Activity: 157


View Profile
June 13, 2011, 12:33:30 PM
 #7

OP, there's already a thread like this, why not contribute there? Smiley

http://forum.bitcoin.org/index.php?topic=9999.0
supa
Jr. Member
*
Offline Offline

Activity: 42


View Profile
June 13, 2011, 02:36:55 PM
 #8

Good point.

Did not find that thread when I searched for "linux scripts" before. Smiley

jondecker76
Full Member
***
Offline Offline

Activity: 238


View Profile
June 13, 2011, 11:41:00 PM
 #9

Sort of related....  I just posted about an automated linux mining management and load balancing system that uses all kinds of silly tricks to monitor and report on the status of many miners:)

http://forum.bitcoin.org/index.php?topic=16548.0

RollerBot Advanced Trading Platform
https://bitcointalk.org/index.php?topic=447727.0
BTC Donations for development: 1H36oTJsi3adFh68wwzz95tPP2xoAoTmhC
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!