]> us-delaporte.pagekite.me Git - dotfiles.git/blob - files/ts/tasks.py
Add virtual way to unplug and re-plug mouse
[dotfiles.git] / files / ts / tasks.py
1 # This file is meant to sit in ~ for use from all shells.
2 # ln -s ~/dotfiles/files/ts/tasks.py ~/tasks.py
3
4 from invoke import task
5
6 from datetime import datetime as dt
7 import os
8
9 HOME = os.path.expanduser('~')
10
11 TODAY = dt.now().strftime('%Y.%m.%d')
12 MONTH = dt.now().strftime('%m')
13 YEAR = dt.now().strftime('%Y')
14 JOURNAL = f"{HOME}/Journal/{YEAR}"
15
16 SECDEV_LIMITED=os.environ.get('SECDEV_LIMITED')
17 SECDEV_MESSAGE_TEMPLATES=os.environ.get('SECDEV_MESSAGE_TEMPLATES')
18 BOX_EPICS=os.environ.get('BOX_EPICS')
19
20 # Helper functions for a consistent experience
21
22 @task
23 def journal(c):
24 code(c, f'{HOME}/Journal')
25
26
27 def browse(c, url):
28 c.run(f"firefox {url}", asynchronous=True)
29
30
31 def code(c, path):
32 c.run(f"codium {path}", asynchronous=True)
33
34
35 def folder(c, path):
36 c.run(f"nemo {path}")
37
38
39
40 @task
41 def debug(c):
42 result = c.run('which minetest')
43 print(result.ok)
44
45
46 @task()
47 def dash(c):
48 c.run('wtfutil')
49
50 @task
51 def calendar_week(c):
52 browse(c, "https://outlook.office.com/calendar/view/week")
53
54
55 @task
56 def vasl(c):
57 '''Submit time off'''
58 browse(c, "https://my.techservices.illinois.edu/vacation/submitdays.asp")
59 browse(c, "https://outlook.office.com/calendar/view/week")
60
61
62 @task(vasl)
63 def timesheets(c):
64 '''Reconcile time off between reporting systems'''
65 browse(c, "https://outlook.office.com/calendar/view/month")
66 code(c, f"{HOME}/src/Learn_RobotFramework_IllinoisPTR")
67
68 @task(journal)
69 def daily(c):
70 '''Open daily reminders file for this month'''
71 code(c, f'{JOURNAL}/{MONTH}-daily.md')
72
73
74
75 @task()
76 def in_progress(c):
77 '''Show in progress items on the Kan-Ban board'''
78 browse(c, 'https://github.com/orgs/techservicesillinois/projects/10/views/11')
79
80
81 @task(daily, in_progress)
82 def status(c):
83 '''Check on status of priorities'''
84 browse(c, BOX_EPICS)
85 dash(c)
86 pass
87
88
89
90 @task
91 def backlog(c):
92 '''Prep for backlog grooming'''
93 browse(c, 'https://github.com/orgs/techservicesillinois/projects/10/views/7')
94
95
96 @task(journal)
97 def retro(c):
98 '''Prep for team retrospective meeting'''
99
100 # Create and open retro notes file
101 retro_file = f'{JOURNAL}/{TODAY}.Retro.md'
102 if(not os.path.exists(retro_file)):
103 c.run(f'{HOME}/envs/jinja/bin/jinja2 -D DATE={TODAY} {JOURNAL}/Retro.Template.md > {retro_file}')
104 code(c, retro_file)
105
106 # Close issues this sprint
107 browse(c, 'https://github.com/orgs/techservicesillinois/projects/10/views/5')
108
109 # Shared folder for archiving Retro notes
110 browse(c, SECDEV_LIMITED)
111
112
113 @task(journal)
114 def engagements_ods(c):
115 '''For recording engagements'''
116 c.run(f'soffice {JOURNAL}/Data/engagements.ods', asynchronous=True)
117 # TODO: Launch Jupyter container on this folder as well
118
119 @task
120 def gather_data(c):
121 raise NotImplementedError()
122 # TODO: Add GH command to gather latest data files.
123
124
125 @task(engagements_ods)
126 def wins(c):
127 '''For recording team wins'''
128 code(c, f'{JOURNAL}/{YEAR}-Wins.md')
129
130 @task
131 def co_authors(c):
132 browse(c, 'https://github.com/orgs/techservicesillinois/projects/10?pane=info')
133
134 @task
135 def limited(c):
136 browse(c, SECDEV_LIMITED)
137
138 @task(engagements_ods, calendar_week)
139 def engage(c):
140 # Cybersecrity Development Message Templates
141 browse(c, SECDEV_MESSAGE_TEMPLATES)
142
143
144 @task
145 def juice_shop(c):
146 '''Run a copy of intentionally vulnerable OWASP Juice Shop web app, for demonstrations'''
147 c.run('podman run -d -p 3000:3000 bkimminich/juice-shop', asynchronous=True)
148 print('Visit localhost:3000 for juice shop.')
149
150
151 @task
152 def bookmarks(c):
153 code(c, f'{JOURNAL}/bookmarks.md')
154
155
156