Skip to content

Instantly share code, notes, and snippets.

View hrpatel's full-sized avatar

hrpatel hrpatel

  • Canada
  • 06:00 (UTC -04:00)
View GitHub Profile
@hrpatel
hrpatel / disable_apt_daily.sh
Created December 17, 2018 19:47
Disable service that updates apt packages daily
systemctl disable apt-daily.service
systemctl mask apt-daily.service
systemctl disable apt-daily-upgrade.service
systemctl mask apt-daily-upgrade.service
@hrpatel
hrpatel / disable_apt_periodic.sh
Created December 17, 2018 19:46
Disable periodic activities of apt
#!/bin/bash
cat <<EOF >/etc/apt/apt.conf.d/10disable-periodic
APT::Periodic::Enable "0";
EOF
# Do some stuff with apt/dpkg at boot
@hrpatel
hrpatel / wait_for_apt_deb.sh
Created December 17, 2018 19:42
Wait for apt/dpkg to finish
timeout=10
function wait_for_apt_deb {
while sudo fuser /var/{lib/{dpkg,apt/lists},cache/apt/archives}/lock &>/dev/null 2>&1; do
echo "Waiting for apt/dpkg lock to release, sleeping ${timeout}s"
sleep "${timeout}"
done
}
wait_for_deb && apt-get install vim