Showing posts with label schedule. Show all posts
Showing posts with label schedule. Show all posts

Sunday, November 7, 2010

How to run an application on resume from standby

or sleep mode...

Should work for Vista or Windows 7:
click the Start menu
type in Task Scheduler and run it
On the right, Create Task
Give it a name
(Run only when user is logged in is good and important)
click Triggers
Begin the task On an event
Log: System
Source: Power-Troubleshooter
Event ID: 1

if it's network related, you may want to
[x] Delay Task for 30 seconds

click Actions
add the parameters that will run your application on resume

click Conditions
If you're on a laptop/notebook, you may wish to uncheck
[x] Start the task only if the computer is on AC power

If it's network related, you'll want to check
[x] Start only if the following network connection is available

click Settings
if it's network related, you may want to check the "if task fails", restart every 1 minute up to 3 times.

click ok.
Test it

What would you want to use this for?

I'd use it to reconnect my ssh link if my laptop went to sleep, especially if I'm using it for tunneling.

Tuesday, September 14, 2010

Do something with the calendar in the task bar Linux

So, you have this Date/Time thing in the taskbar of Gnome and you'd like to see it do ... something more than simply display a calendar. Have you double-clicked on a date yet? Evolution pops up. You probably don't need it to be your mail client, but by default, it's the interface to show calendar information (whether a Date is bold or not) in that applet.

Certainly, you can use the built-in calendar, but Evolution allows you to use web calendars (such as Google Calendar) as well.

How simple is it?

If you're in Evolution, make sure you're in "Calendars" mode.
Right-click on the white box above the calendar and choose "New Calendar". Sure, you can use the Google link to do it, and it'll be easy to choose your calendars. But if you have the direct URL to a .ics file, change the "Type" to "On The Web". Give it a name, color, and paste the link in the URL box, but change http to webcal.

The following is the public .ics for the USA holiday calendar. Copy/paste it into the URL box.
webcal://www.google.com/calendar/ical/usa__en%40holiday.calendar.google.com/public/basic.ics

This is the phases of the moon:
webcal://www.google.com/calendar/ical/ht3jlfaac5lfd6263ulfh4tql8%40group.calendar.google.com/public/basic.ics

Wednesday, March 25, 2009

Dansguardian schedule an exception during the day.

So, you're using dansguardian and would like to schedule an exception...

I created two scripts:
_start_.sh

cp /etc/dansguardian/exceptionsitenoon.noon /etc/dansguardian/exceptionsitenoon
/usr/sbin/dansguardian -g


_stop_.sh

cp /etc/dansguardian/exceptionsitenoon.normal /etc/dansguardian/exceptionsitenoon
/usr/sbin/dansguardian -g


And added this line in /etc/dansguardian/exceptionsitelist:

.Include </etc/dansguardian/exceptionsitenoon>


Then, crontab -e

min hr * * * /path/to/_start_.sh
min hr * * * /path/to/_stop_.sh


And, of course, made a file /etc/dansguardian/exceptionsitenoon.noon that had a list of the domains I wanted to allow (for my case, at noon) and another /etc/dansguardian/exceptionsitenoon.normal that was empty. The reason I used the .Include option was that I wanted to keep the permanent exceptions separate and manageable from the temporary exceptions -- If not, I'd have to make updates to both "noon" and "normal" lists every time I needed to make a permanent exclusion.

Blog Archive