-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Automation scripts * CPU freq scritps
- Loading branch information
Showing
16 changed files
with
673 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#!/bin/bash -e | ||
|
||
# Uses the Monero blockchain itself to extract the raw data. | ||
# Warning! It needs a lot of disk space to do this. Expect even ~100 GB. | ||
|
||
NPROC=2 | ||
REPO=monero | ||
DIR=build | ||
TARGETS="daemon" | ||
AUTO_INSTALL_DEPS=false | ||
|
||
DEPS="build-essential cmake pkg-config libssl-dev libzmq3-dev libunbound-dev libsodium-dev libunwind8-dev liblzma-dev libreadline6-dev libexpat1-dev libpgm-dev libhidapi-dev libusb-1.0-0-dev libprotobuf-dev protobuf-compiler libudev-dev libboost-chrono-dev libboost-date-time-dev libboost-filesystem-dev libboost-locale-dev libboost-program-options-dev libboost-regex-dev libboost-serialization-dev libboost-system-dev libboost-thread-dev python3 ccache" | ||
|
||
if [ ! -z $1 ]; then | ||
NPROC=$1 | ||
fi | ||
|
||
if [ ! -z $2 ]; then | ||
AUTO_INSTALL_DEPS=true | ||
fi | ||
|
||
echo "The '$REPO' dependencies are the following:" | ||
echo "$DEPS" | ||
echo "" | ||
if [ $AUTO_INSTALL_DEPS == true ]; then | ||
q='Y' | ||
else | ||
echo "Would you like to install them automatically? (Y/n)" | ||
read q | ||
fi | ||
if [ $q == 'n' ]; then | ||
echo "Skipping the installation of the dependencies." | ||
else | ||
echo "installing dependencies of '$REPO'." | ||
sudo apt update | ||
sudo apt install $DEPS | ||
fi | ||
mkdir -p $DIR && cd $DIR | ||
if [ ! -d $REPO ]; then | ||
git clone --recursive https://github.com/monero-project/$REPO.git | ||
fi | ||
cd $REPO | ||
git checkout $(git describe --tags $(git rev-list --tags --max-count=1)) # Checkout the latest tag (master is risky) | ||
git submodule init && git submodule update --remote; git submodule sync && git submodule update | ||
mkdir -p $DIR && cd $DIR | ||
# Mix some ghetto tricks to minimize the build size: | ||
cmake ../ -DCMAKE_BUILD_TYPE=Release -DSTRIP_TARGETS=ON -DBUILD_SHARED_LIBS=ON -DBUILD_TESTS=OFF -DARCH="default" | ||
make -j$NPROC $TARGETS | ||
|
||
echo "Now synchronize the blockchain with ./util/run-monero.sh" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash -e | ||
|
||
VER=2.5 | ||
# https://github.com/SChernykh/p2pool/releases | ||
REPO=p2pool | ||
DIR=build | ||
|
||
mkdir -p $DIR && cd $DIR | ||
if [ ! -d $REPO ]; then | ||
git clone --recursive https://github.com/SChernykh/$REPO.git | ||
fi | ||
cd $REPO | ||
git checkout v${VER} | ||
mkdir -p $DIR && cd $DIR | ||
cmake .. | ||
make -j`nproc` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash -e | ||
|
||
|
||
DEPS="ethtool wakeonlan git ccache cmake msr-tools libuv1-dev libzmq3-dev libsodium-dev libpgm-dev libnorm-dev libgss-dev libcurl4-gnutls-dev libhwloc-dev libuv1-dev libssl-dev libreadline-dev" | ||
|
||
echo "Installing the following dependencies:" | ||
echo "$DEPS" | ||
sudo apt install $DEPS | ||
|
||
|
||
./util/build-p2pool.sh | ||
./util/build-xmrig.sh | ||
./util/build-monero.sh 2 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash -e | ||
|
||
VER=6.18.1 | ||
#https://github.com/xmrig/xmrig/releases | ||
REPO=xmrig | ||
DIR=build | ||
|
||
|
||
DIR_THIS="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" | ||
|
||
mkdir -p $DIR && cd $DIR | ||
if [ -d $REPO ]; then | ||
ls | ||
rm $REPO -fr | ||
fi | ||
|
||
git clone --recursive https://github.com/$REPO/$REPO.git | ||
cd $REPO | ||
git checkout v${VER} | ||
git apply "$DIR_THIS/patches/xmrig-${VER}.patch" # Here be dragons! | ||
mkdir -p $DIR && cd $DIR | ||
cmake .. -G "CodeBlocks - Unix Makefiles" | ||
make -j$(nproc) | ||
#make | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/bash | ||
|
||
# sudo apt install cpufrequtils | ||
# Read min/max freq: | ||
# cpufreq-info | ||
# Example /etc/rc.local: | ||
# /root/bin/cpu-freq.sh 0.8 | ||
# | ||
# exit 0 | ||
|
||
FILE_OUT_USR=/dev/shm/cpu-freq-user.txt | ||
FILE_OUT_MIN=/dev/shm/cpu-freq-min.txt | ||
|
||
LIMITS=$(cpufreq-info | grep limits | head -1) | ||
MIN=$(echo $LIMITS | awk '{print $3}') | ||
MAX=$(echo $LIMITS | awk '{print $6}') | ||
|
||
MIN_UNIT=$(echo $LIMITS | awk '{print $4}') | ||
MAX_UNIT=$(echo $LIMITS | awk '{print $7}') | ||
|
||
echo "Min = $MIN $MIN_UNIT" | ||
echo "Max = $MAX $MAX_UNIT" | ||
|
||
|
||
FREQ_NOW_TXT=$(cpufreq-info | grep "frequency should be within" | head -1) | ||
FREQ_NOW=$(echo $FREQ_NOW_TXT | awk '{print $(NF-1)}') | ||
FREQ_NOW_UNIT=$(echo $FREQ_NOW_TXT | awk '{print $(NF-0)}' | cut -c -3 ) # Cut the dot | ||
|
||
echo "Curr = $FREQ_NOW $FREQ_NOW_UNIT" | ||
|
||
echo "${MIN} ${MIN_UNIT}" > $FILE_OUT_MIN | ||
echo "${FREQ_NOW} ${FREQ_NOW_UNIT}" > $FILE_OUT_USR | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/bash -e | ||
|
||
# sudo apt install cpufrequtils | ||
# Read min/max freq: | ||
# cpufreq-info | ||
# Example /etc/rc.local: | ||
# /root/bin/cpu-freq.sh 0.8 | ||
# | ||
# exit 0 | ||
FREQ=$1 | ||
FREQ_UNITS=$2 | ||
|
||
if [ -z $1 ]; then | ||
echo "Provide frequency in GHz" | ||
exit | ||
fi | ||
|
||
if [ -z $2 ]; then | ||
FREQ_UNITS=Ghz | ||
fi | ||
|
||
echo "Setting ${FREQ}${FREQ_UNITS}" | ||
|
||
END=$(nproc) | ||
for cpuID in $(seq 1 $END); do | ||
echo "Setting core $((cpuID-1)) to ${FREQ}${FREQ_UNITS}" | ||
cpufreq-set -c $((cpuID-1)) --related --max ${FREQ}${FREQ_UNITS} | ||
done | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
placeholder |
Oops, something went wrong.