<commit_before>#!/usr/bin/env bash

# Usage:
# sudo bash <(wget -O- https://raw.githubusercontent.com/jkeylu/dotfiles/master/scripts/install-hdparam.service.sh) install
# sudo ./.dotfiles/scripts/install-hdparam.service.sh install

install() {
  cat > /etc/systemd/system/hdparm.service << EOF
[Unit]
Description=hdparm service

[Service]
Type=oneshot
ExecStart=$(which hdparm) -S 241 -y /dev/sda
RemainAfterExit=true

[Install]
WantedBy=multi-user.target
EOF

  if command -v vim &> /dev/null; then
    vim /etc/systemd/system/hdparm.service
  else
    vi /etc/systemd/system/hdparm.service
  fi

  systemctl enable hdparm
}

uninstall() {
  systemctl disable hdparm
  rm -f /etc/systemd/system/hdparm.service
}

case "$1" in
  install)
    install
    ;;
  uninstall)
    uninstall
    ;;
esac<commit_msg>update install-hdparam.service.sh<commit_after>#!/usr/bin/env bash

# Usage:
# wget -O- https://raw.githubusercontent.com/jkeylu/dotfiles/master/scripts/install-hdparam.service.sh | sudo bash

cat > /etc/systemd/system/hdparm.service << EOF
[Unit]
Description=hdparm service

[Service]
Type=oneshot
ExecStart=$(which hdparm) -S 241 -y /dev/sdx
RemainAfterExit=true

[Install]
WantedBy=multi-user.target
EOF

if command -v vim &> /dev/null; then
  vim /etc/systemd/system/hdparm.service
else
  vi /etc/systemd/system/hdparm.service
fi

systemctl enable hdparm
{'fraction_non_alphanumeric': 0.13113553113553114, 'fraction_numerical': 0.005128205128205128, 'mean_word_length': 3.8960573476702507, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4492235', 'n_tokens_mistral': 542, 'n_tokens_neox': 520, 'n_words': 102}