Skip to content

A productivity tool to beat procrastination by involving your support group

Notifications You must be signed in to change notification settings

johnhuichen/snitch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Snitch

Snitch is a productivity tool to snitch on yourself when you procrastinate instead of work hard.

It will send someone you care about an email when you watch Youtube videos or play a game when you are supposed to study, for example.

Quick start

Create a configuration file at ~/.config/snitch/default-config.toml that looks like below.

[smtp_info]
smtp_user = '[email protected]'
smtp_password = 'password'
smtp_server = 'smtp-relay.brevo.com'
recipient = '[email protected]'
email_subject = 'Create your own email subject'

[tcp_targets]
"www.youtube.com" = "{Insert your email message}"

[proc_targets]
"foobar" = "{Insert your email message}"

Update SMTP Info

In order to snitch on yourself and send someone an email, you have to find a SMTP server. Brevo(https://app.brevo.com/settings/keys/smtp) is an excellent choice.

Use the registered SMTP service to fill the information in default-config.toml

Add tcp_targets

Use tcp_targets to spy on esablished tcp connections. tcp_targets is maps dns hostname to a message that will be sent if a tcp connection to the hostname is found.

To add more tcp_targets, simply follow the example and add more entries under [tcp_targets].

[tcp_targets]
"www.youtube.com" = "{Insert your email message}"

Add proc_targets

Use tcp_targets to spy on system processes. proc_targets is maps process name to a message that will be sent if this process is found

To add more proc_targets, simply follow the example and add more entries under [proc_targets].

[proc_targets]
"process_name" = "{Insert your email message}"

Run snitch on startup (Linux)

You can use crontab to schedule the process. First build a release version

cargo build --release

Edit crontab configuration

crontab -e

Insert a line at the bottom

@reboot cd /path/to/snitch;./target/release/snitch

About

A productivity tool to beat procrastination by involving your support group

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages