pip install python-dateutil python-crontab
from crontab import CronTab
user_cron = CronTab('myuser')
command = "/usr/bin/ls -la"
comment = "Run"
job = user_cron.new(command=command, comment=comment)
job.minute.every(5)
job.is_valid()
user_cron.write("outfile.tab")
Tuesday, July 16, 2013
Redhat/Debian Update Support
Preventing Kernel Updates in Linux
Ubuntu/Debian
http://www.howtogeek.com/howto/10606/how-to-hide-kernel-updates-in-ubuntu/
RedHat
http://www.howtogeek.com/50898/how-to-prevent-yum-from-updating-the-kernel/
List Available updates in Linux
Debian
aptitude search '?upgradable'
Redhat
sudo yum list updates
http://yum.baseurl.org/wiki/YumCommands
Automatic Security Updates
Ubuntu
https://help.ubuntu.com/community/AutomaticSecurityUpdates
Download only packages without installing
Redhat
yum install -y yum-downloadonly
yum install httpd -y --downloadonly --downloaddir=/my/download/dir/
http://www.cyberciti.biz/faq/yum-downloadonly-plugin/
Ubuntu
apt-get -d, --download-only ...
Ubuntu/Debian
http://www.howtogeek.com/howto/10606/how-to-hide-kernel-updates-in-ubuntu/
RedHat
http://www.howtogeek.com/50898/how-to-prevent-yum-from-updating-the-kernel/
List Available updates in Linux
Debian
aptitude search '?upgradable'
Redhat
sudo yum list updates
http://yum.baseurl.org/wiki/YumCommands
Automatic Security Updates
Ubuntu
https://help.ubuntu.com/community/AutomaticSecurityUpdates
Download only packages without installing
Redhat
yum install -y yum-downloadonly
yum install httpd -y --downloadonly --downloaddir=/my/download/dir/
http://www.cyberciti.biz/faq/yum-downloadonly-plugin/
Ubuntu
apt-get -d, --download-only ...
Screenshots from Python and Phantomjs
Copied from Pykler's Stackoverflow answer:
http://stackoverflow.com/questions/13287490/is-there-a-way-to-use-phantomjs-in-python
driver = webdriver.PhantomJS()
driver.set_window_size(1024, 768) # optional
driver.get('https://google.com/')
driver.save_screenshot('screen.png') # save a screenshot to disk
sbtn = driver.find_element_by_css_selector('button.gbqfba')
sbtn.click()
http://stackoverflow.com/questions/13287490/is-there-a-way-to-use-phantomjs-in-python
- Install NodeJS
- npm -g install phantomjs
- pip install selenium
driver = webdriver.PhantomJS()
driver.set_window_size(1024, 768) # optional
driver.get('https://google.com/')
driver.save_screenshot('screen.png') # save a screenshot to disk
sbtn = driver.find_element_by_css_selector('button.gbqfba')
sbtn.click()
Subscribe to:
Posts (Atom)