Skip to content

Instantly share code, notes, and snippets.

@PROPHESSOR
Created April 24, 2019 14:14
Show Gist options
  • Save PROPHESSOR/525c3676f484fb2468ac2c337888dab4 to your computer and use it in GitHub Desktop.
Save PROPHESSOR/525c3676f484fb2468ac2c337888dab4 to your computer and use it in GitHub Desktop.
PROPHESSOR's powersave script
#/usr/bin/python
# coding: utf-8
from os import system
print "Перевожу систему в режим энергосбережения..."
print "Останавливаю сервисы:"
print " - Останавливаю MySQL"
system("sudo service mysql stop")
print " - Останавливаю MongoDB"
system("sudo service mongodb stop")
print " - Останавливаю Apache"
system("sudo service apache2 stop")
print " - Останавливаю TeamViewer Daemon"
system("sudo service teamviewerd stop")
print " - Останавливаю Avahi Daemon" # Для определения в локальной сети
system("sudo service avahi-daemon stop")
print " - Останавливаю CG Manager" # Для LXC контейнеров (Виртуализация)
system("sudo service cgmanager stop")
print " - Останавливаю Cups Browsed" # Для работы с принтерами
system("sudo service cups-browsed stop")
print " - Останавливаю Modem Manager" # 3G и т.п.
system("sudo service ModemManager stop")
print " - Останавливаю Speech Dispatcher" # Порядок наложения звуков
system("sudo service speech-dispatcher stop")
print " - Останавливаю SSH сервер"
system("sudo service ssh stop")
print " - Останавливаю UFW" # Брандмауэр
system("sudo service ufw stop")
print " - Останавливаю Open VPN"
system("sudo service openvpn stop")
# Processes
print "Останавливаю процессы:"
print " - Останавливаю csd-housekeeping"
system("killall -s SIGKILL csd-housekeeping")
system("killall -s SIGKILL csd-housekeeping")
system("killall -s SIGKILL csd-housekeeping")
print " - Останавливаю goa-daemon"
system("killall -s SIGKILL goa-daemon")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment