OCI Free Tier keeping the AMD Compute

Oracle Cloud

Some scripts that were written to keep the CPU and Network busy. OCI free tier for AMD demands a 20% CPU load 90% of the time, and 20% network load. No idea what 20% network load entails, but gave it a stab anyway.

Some things to note about the scripts

  • Trying not to generate a consistent load, since it might be too obvious. So broke the loading to 10% for 10 minutes, 20% for 40 minutes, and 30% for 10 minutes.
  • Some random load within the hour
  • Download “War and Peace” three times locally
  • Runs speedtest every hour

Script: taperish

#!/bin/bash
#

cd /home/user/tapper
#resp=`ps -ef | grep taperish | grep -v grep`
#echo $resp >> log.txt
resp=`ps -ef | grep taperish | grep -v grep | grep null | wc -l`
#echo $resp >> log.txt
if [ $resp -gt 1 ]; then
        exit
fi

mint=`date +%M`

while [ 1==1 ]; do
    if [ -f "pause" ]; then
            sleep 1
    else
        mint=`date +%M`
        if [ $mint -le 10 ]; then
            sleep 1.5
            timeout 0.25 nice -n 18 md5sum /dev/zero
        fi
        if [[ $mint -gt 10 && $mint -lt 50 ]]; then
            sleep 0.75
            timeout 0.5 nice -n 18 md5sum /dev/zero
        fi
        if [ $mint -ge 50 ]; then
            sleep 0.50
            timeout 1.25 nice -n 18 md5sum /dev/zero
        fi
    fi
done

Script: Calibratish

#!/bin/bash
#

cd /home/user/tapper
#resp=`ps -ef | grep calibratish | grep -v grep`
#echo $resp >> log-calib.txt
resp=`ps -ef | grep calibratish | grep -v grep | grep null | wc -l`
#echo $resp >> log-calib.txt
if [ $resp -gt 1 ]; then
        exit
fi

currentCpuLoad=$[100-$(vmstat 1 2|tail -1|awk '{print $15}')]

while :
do
#  echo $currentCpuLoad
  if [ $currentCpuLoad -gt 60 ]
  then
    touch pause
    echo `date +%Y%m%d-%H%M%S`  >> log-calib.txt
    sleep 10
    rm -f pause
  fi
  currentCpuLoad=$[100-$(vmstat 1 2|tail -1|awk '{print $15}')]
done

Script: loftyPeak It is assumed that you have an apache server running locally

#!/bin/bash
#

cd /home/user/tapper

waitFor=$(($RANDOM%(1800)))
#echo sleeping for $waitFor seconds
sleep $waitFor

currentCpuLoad=$[100-$(vmstat 1 2|tail -1|awk '{print $15}')]

if [ $currentCpuLoad -lt 65 ]; then
        timeout 90 nice -n 18 md5sum /dev/random
fi
curl -s http://10.0.0.89/.well-known/wap.txt > /dev/null
curl -s http://10.0.0.89/.well-known/wap.txt > /dev/null
curl -s http://10.0.0.89/.well-known/wap.txt > /dev/null

Supporting Crontab entries:

@reboot /home/user/tapper/taperish > /dev/null 2>&1
*/10 * * * * /home/user/tapper/taperish > /dev/null 2>&1
*/10 * * * * /home/user/tapper/calibratish > /dev/null 2>&1
10 * * * * /home/user/tapper/loftyPeak > /dev/null 2>&1
7 * * * * /usr/bin/speedtest --secure > /dev/null 2>&1
Written on July 23, 2025