print (platform.a rchitecture()[0])
import platform
print (platform.architecture()[0])
This file contains hidden or 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
#!/bin/bash | |
# Over provisioning lazy setting tools | |
# 1. Auto detect all of SATA disk and then input the percentage as you want. | |
# 2. Manualy input the disk path and then input the over provisioning percentage as you want. | |
# Plase mark or remark the feature as you want to need | |
# This script only supported SATA disk for only. | |
# Tool needs: hdparm | |
### Feature 1: Auto detect | |
#read -p "Input your disk path (e.g: sdb): " -e newdrvname | |
#read -p "Input your OP percentage (e.g: 0.11): " -e oppercentage | |
## Feature 2: Manually input one or more disks path | |
newdrvname=$(dmesg | grep -i "Starting disk" | head -n1 | awk '{print substr($3,2,3)}') | |
newdrvname=$(dmesg | grep -i "Attached SCSI disk" | tail -n1 | awk '{print substr($3,2,3)}') | |
echo -e "The Attached SCSI disk [$newdrvname] [Over Provisioning] size: (current/ Total size)" | |
read -p "Press any key to continue ..." -n1 -s | |
hdparm -N /dev/$newdrvname | tail -n1 | |
totalsector=`hdparm -N /dev/$newdrvname | grep -i max | awk '{print $4}' | awk -F '/' '{print $2}' | grep -o '[0-9]\+'` | |
# Manual [Over Provisioning] = total [Over Provisioning] * [Over Provisioning's percentage] | |
cursector=$(echo $totalsector*$oppercentage|bc) | |
currectOP=${cursector%.*} | |
echo -e "Enter to Sleep" | |
rtcwake -m mem -s 5 | |
echo -e "Adjust [Over Provisioning] setting in the disk" | |
hdparm -Np$currectOP --yes-i-know-what-i-am-doing /dev/$newdrvname | |
echo -e "security erase the disk" | |
hdparm --security-set-pass t /dev/$newdrvname | |
hdparm --security-erase t /dev/$newdrvname | |
echo -e "sector list" | |
hdparm -N /dev/$newdrvname |