skilleter-thingy 0.1.19__py3-none-any.whl → 0.1.22__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of skilleter-thingy might be problematic. Click here for more details.
- skilleter_thingy/ggrep.py +2 -1
- skilleter_thingy/git_br.py +1 -1
- skilleter_thingy/git_parent.py +2 -1
- skilleter_thingy/git_review.py +2 -2
- skilleter_thingy/git_update.py +2 -2
- skilleter_thingy/gphotosync.py +9 -5
- skilleter_thingy/localphotosync.py +78 -358
- skilleter_thingy/multigit.py +1 -1
- skilleter_thingy/photodupe.py +10 -10
- skilleter_thingy/py_audit.py +4 -2
- skilleter_thingy/readable.py +13 -11
- skilleter_thingy/sysmon.py +2 -2
- skilleter_thingy/thingy/colour.py +1 -1
- skilleter_thingy/thingy/dircolors.py +20 -18
- skilleter_thingy/thingy/git2.py +0 -1
- skilleter_thingy/thingy/popup.py +1 -1
- skilleter_thingy/thingy/tfm_pane.py +3 -3
- skilleter_thingy/thingy/tidy.py +14 -13
- skilleter_thingy/venv_create.py +1 -1
- {skilleter_thingy-0.1.19.dist-info → skilleter_thingy-0.1.22.dist-info}/METADATA +1 -1
- skilleter_thingy-0.1.22.dist-info/PKG-INFO 2 +193 -0
- {skilleter_thingy-0.1.19.dist-info → skilleter_thingy-0.1.22.dist-info}/RECORD +26 -25
- {skilleter_thingy-0.1.19.dist-info → skilleter_thingy-0.1.22.dist-info}/WHEEL +0 -0
- {skilleter_thingy-0.1.19.dist-info → skilleter_thingy-0.1.22.dist-info}/entry_points.txt +0 -0
- {skilleter_thingy-0.1.19.dist-info → skilleter_thingy-0.1.22.dist-info}/licenses/LICENSE +0 -0
- {skilleter_thingy-0.1.19.dist-info → skilleter_thingy-0.1.22.dist-info}/top_level.txt +0 -0
skilleter_thingy/photodupe.py
CHANGED
|
@@ -21,21 +21,21 @@ def read_image_hashes(directories):
|
|
|
21
21
|
hashes = defaultdict(list)
|
|
22
22
|
|
|
23
23
|
# Walk each directory tree
|
|
24
|
-
|
|
24
|
+
|
|
25
25
|
for directory in directories:
|
|
26
26
|
print(f'Scanning directory tree {directory}')
|
|
27
|
-
|
|
27
|
+
|
|
28
28
|
for root, _, files in os.walk(directory):
|
|
29
29
|
print(f'Scanning directory {root}')
|
|
30
|
-
|
|
30
|
+
|
|
31
31
|
for file in files:
|
|
32
32
|
filepath = os.path.join(root, file)
|
|
33
|
-
|
|
33
|
+
|
|
34
34
|
fileext = os.path.splitext(file)[1]
|
|
35
35
|
|
|
36
36
|
if fileext.lower() not in ('.jbf', '.ini', '.xml', '.ffs_db'):
|
|
37
37
|
# Calculate the hash and store path, dimensions and file size under the hash entry in the hashes table
|
|
38
|
-
|
|
38
|
+
|
|
39
39
|
try:
|
|
40
40
|
with Image.open(filepath) as image:
|
|
41
41
|
hash_value = imagehash.average_hash(image, hash_size=12)
|
|
@@ -48,9 +48,9 @@ def read_image_hashes(directories):
|
|
|
48
48
|
|
|
49
49
|
except OSError:
|
|
50
50
|
sys.stderr.write(f'ERROR: Unable to read {filepath} (size={size})\n')
|
|
51
|
-
|
|
51
|
+
|
|
52
52
|
# Return the hash table
|
|
53
|
-
|
|
53
|
+
|
|
54
54
|
return hashes
|
|
55
55
|
|
|
56
56
|
################################################################################
|
|
@@ -62,11 +62,11 @@ def main():
|
|
|
62
62
|
parser.add_argument('directories', nargs='*', action='store', help='Directories to search')
|
|
63
63
|
|
|
64
64
|
args = parser.parse_args()
|
|
65
|
-
|
|
65
|
+
|
|
66
66
|
if not args.directories:
|
|
67
67
|
print('You must be specify at least one directory')
|
|
68
68
|
sys.exit(1)
|
|
69
|
-
|
|
69
|
+
|
|
70
70
|
try:
|
|
71
71
|
print('Loading cached data')
|
|
72
72
|
|
|
@@ -78,7 +78,7 @@ def main():
|
|
|
78
78
|
hashes = read_image_hashes(args.directories)
|
|
79
79
|
|
|
80
80
|
# Sort the list of hashes so that we can easily find close matches
|
|
81
|
-
|
|
81
|
+
|
|
82
82
|
print('Sorting hashes')
|
|
83
83
|
|
|
84
84
|
hash_values = sorted([str(hashval) for hashval in hashes])
|
skilleter_thingy/py_audit.py
CHANGED
|
@@ -70,8 +70,10 @@ def audit(package, version):
|
|
|
70
70
|
def main():
|
|
71
71
|
""" Entry point """
|
|
72
72
|
|
|
73
|
-
parser = argparse.ArgumentParser(
|
|
74
|
-
|
|
73
|
+
parser = argparse.ArgumentParser(
|
|
74
|
+
description='Query api.osv.dev to determine whether Python packagers in a requirments.txt file are subject to known security vulnerabilities')
|
|
75
|
+
parser.add_argument('requirements', nargs='*', type=str, action='store',
|
|
76
|
+
help='The requirements file (if not specified, then the script searches for a requirements.txt file)')
|
|
75
77
|
args = parser.parse_args()
|
|
76
78
|
|
|
77
79
|
requirements = args.requirements or glob.glob('**/requirements.txt', recursive=True)
|
skilleter_thingy/readable.py
CHANGED
|
@@ -47,13 +47,13 @@ TF_TAG_ENTRY_IGNORE = re.compile(r'^ +".*" += +".*"')
|
|
|
47
47
|
TF_TAG_CHANGE_BLOCK_END = re.compile(r'^ +}$')
|
|
48
48
|
|
|
49
49
|
TF_MISC_REGEX = \
|
|
50
|
-
[
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
]
|
|
50
|
+
[
|
|
51
|
+
{'regex': re.compile(r'(Read complete after) (\d+s|\d+m\d+s)'), 'replace': r'\1 {ELAPSED}'},
|
|
52
|
+
{'regex': re.compile(r'"(.*:.*)"( = ".*")'), 'replace': r'\1\2'},
|
|
53
|
+
{'regex': re.compile(r'"(.*:.*)"( = \[$)'), 'replace': r'\1\2'},
|
|
54
|
+
{'regex': re.compile(r'^last "terraform apply":$'), 'replace': r'last "terraform apply" which may have affected this plan:'},
|
|
55
|
+
{'find': ' ~ ', 'replace': ' * '},
|
|
56
|
+
]
|
|
57
57
|
|
|
58
58
|
TF_IGNORE_LIST = [
|
|
59
59
|
{'start': TF_HAS_CHANGED, 'end': TF_HAS_CHANGED_END},
|
|
@@ -91,8 +91,10 @@ def parse_command_line():
|
|
|
91
91
|
parser.add_argument('--terraform', '-T', action='store_true', help='Clean Terraform plan/apply log files')
|
|
92
92
|
parser.add_argument('--replace', '-R', action='append', default=None, help='Additional regex replacements in the form "REGEX=REPLACEMENT"')
|
|
93
93
|
parser.add_argument('--verbose', '-v', action='store_true', help='Output verbose status')
|
|
94
|
-
parser.add_argument('--minimal', '-m', action='store_true',
|
|
95
|
-
|
|
94
|
+
parser.add_argument('--minimal', '-m', action='store_true',
|
|
95
|
+
help='Remove unnecessary data from the file (e.g. Terraform progress updates (Refreshing..., Reading..., etc.))')
|
|
96
|
+
parser.add_argument('--non-minimal', '-M', action='store_true',
|
|
97
|
+
help='Do not remove unnecessary data from the file (e.g. Terraform progress updates (Refreshing..., Reading..., etc.))')
|
|
96
98
|
parser.add_argument('files', nargs='*', default=None, help='The files to convert (use stdin/stout if no input files are specified)')
|
|
97
99
|
|
|
98
100
|
args = parser.parse_args()
|
|
@@ -144,7 +146,7 @@ def parse_command_line():
|
|
|
144
146
|
for entry in args.replace:
|
|
145
147
|
regex, replace = entry.split('=')
|
|
146
148
|
try:
|
|
147
|
-
args.regex_replace.append({'regex': re.compile(regex), 'replace':replace})
|
|
149
|
+
args.regex_replace.append({'regex': re.compile(regex), 'replace': replace})
|
|
148
150
|
except re.error as exc:
|
|
149
151
|
print(f'ERROR in regular expression {regex}: {exc}')
|
|
150
152
|
sys.exit(1)
|
|
@@ -291,7 +293,7 @@ def cleanfile(args, infile, outfile):
|
|
|
291
293
|
# Write normal output, skipping >1 blank lines and skipping ignore blocks when the pre-ignore
|
|
292
294
|
# count has hit zero.
|
|
293
295
|
|
|
294
|
-
if clean is not None and not (ignore_until and pre_ignore_count==0):
|
|
296
|
+
if clean is not None and not (ignore_until and pre_ignore_count == 0):
|
|
295
297
|
if clean != '' or prev_line != '':
|
|
296
298
|
outfile.write(clean)
|
|
297
299
|
outfile.write('\n')
|
skilleter_thingy/sysmon.py
CHANGED
|
@@ -57,7 +57,7 @@ def show_cpu_times(scr, first, w, h, x, y):
|
|
|
57
57
|
scr.addstr(y+2, x, 'IRQ:')
|
|
58
58
|
scr.addstr(y+3, x, 'Soft IRQ:')
|
|
59
59
|
|
|
60
|
-
x+= w//3
|
|
60
|
+
x += w//3
|
|
61
61
|
|
|
62
62
|
scr.addstr(y+1, x, 'Guest:')
|
|
63
63
|
scr.addstr(y+2, x, 'Guest Nice:')
|
|
@@ -320,7 +320,7 @@ def show_temperatures(scr, first, w, h, x, y):
|
|
|
320
320
|
|
|
321
321
|
# Panel title and the functions used to update them
|
|
322
322
|
|
|
323
|
-
BOXES= {
|
|
323
|
+
BOXES = {
|
|
324
324
|
'System Load': show_system_load,
|
|
325
325
|
'Disk Access': show_disk_access,
|
|
326
326
|
'Processes': show_processes,
|
|
@@ -186,7 +186,7 @@ def write(txt=None, newline=True, stream=sys.stdout, indent=0, strip=False, clea
|
|
|
186
186
|
|
|
187
187
|
def error(txt, newline=True, stream=sys.stderr, status=1, prefix=False):
|
|
188
188
|
""" Write an error message to the specified stream (defaulting to
|
|
189
|
-
stderr) and exit with the specified status code (defaulting to 1)
|
|
189
|
+
stderr) and exit with the specified status code (defaulting to 1)
|
|
190
190
|
Prefix the output with 'ERROR:' in red if prefix==True """
|
|
191
191
|
|
|
192
192
|
if prefix:
|
|
@@ -20,6 +20,7 @@ import thingy.dc_util as dc_util
|
|
|
20
20
|
__all__ = ['Dircolors']
|
|
21
21
|
|
|
22
22
|
_CODE_MAP = OrderedDict()
|
|
23
|
+
|
|
23
24
|
def _init_code_map():
|
|
24
25
|
""" mapping between the key name in the .dircolors file and the two letter
|
|
25
26
|
code found in the LS_COLORS environment variable.
|
|
@@ -53,6 +54,7 @@ class Dircolors:
|
|
|
53
54
|
""" Main dircolors class. Contains a database of formats corresponding to file types,
|
|
54
55
|
modes, and extensions. Use the format() method to check a file and color it appropriately.
|
|
55
56
|
"""
|
|
57
|
+
|
|
56
58
|
def __init__(self, load=True):
|
|
57
59
|
""" Initialize a Dircolors object. If load=True (the default), then try
|
|
58
60
|
to load dircolors info from the LS_COLORS environment variable.
|
|
@@ -98,7 +100,7 @@ class Dircolors:
|
|
|
98
100
|
try:
|
|
99
101
|
code, color = item.split('=', 1)
|
|
100
102
|
except ValueError:
|
|
101
|
-
continue
|
|
103
|
+
continue # no key=value, just ignore
|
|
102
104
|
if code.startswith('*.'):
|
|
103
105
|
self._extensions[code[1:]] = color
|
|
104
106
|
else:
|
|
@@ -134,7 +136,7 @@ class Dircolors:
|
|
|
134
136
|
elif isinstance(database, TextIOBase):
|
|
135
137
|
file = database
|
|
136
138
|
else:
|
|
137
|
-
raise ValueError('database must be str or io.TextIOBase, not %s'%type(database))
|
|
139
|
+
raise ValueError('database must be str or io.TextIOBase, not %s' % type(database))
|
|
138
140
|
|
|
139
141
|
try:
|
|
140
142
|
for line in file:
|
|
@@ -147,18 +149,18 @@ class Dircolors:
|
|
|
147
149
|
split = line.split()
|
|
148
150
|
if len(split) != 2:
|
|
149
151
|
if strict:
|
|
150
|
-
raise ValueError('Warning: unable to parse dircolors line "%s"'%line)
|
|
152
|
+
raise ValueError('Warning: unable to parse dircolors line "%s"' % line)
|
|
151
153
|
continue
|
|
152
154
|
|
|
153
155
|
key, val = split
|
|
154
156
|
if key == 'TERM':
|
|
155
|
-
continue
|
|
157
|
+
continue # ignore TERM directives
|
|
156
158
|
elif key in _CODE_MAP:
|
|
157
159
|
self._codes[_CODE_MAP[key]] = val
|
|
158
160
|
elif key.startswith('.'):
|
|
159
161
|
self._extensions[key] = val
|
|
160
162
|
elif strict:
|
|
161
|
-
raise ValueError('Warning: unable to parse dircolors line "%s"'%line)
|
|
163
|
+
raise ValueError('Warning: unable to parse dircolors line "%s"' % line)
|
|
162
164
|
# elif not strict, skip
|
|
163
165
|
|
|
164
166
|
if self._codes or self._extensions:
|
|
@@ -184,14 +186,14 @@ class Dircolors:
|
|
|
184
186
|
# change .xyz to *.xyz
|
|
185
187
|
yield '*' + pair[0], pair[1]
|
|
186
188
|
|
|
187
|
-
return ':'.join('%s=%s'%pair for pair in gen_pairs())
|
|
189
|
+
return ':'.join('%s=%s' % pair for pair in gen_pairs())
|
|
188
190
|
|
|
189
191
|
def _format_code(self, text, code):
|
|
190
192
|
""" format text with an lscolors code. Return text unmodified if code
|
|
191
193
|
isn't found in the database """
|
|
192
194
|
val = self._codes.get(code, None)
|
|
193
195
|
if val:
|
|
194
|
-
return '\033[%sm%s\033[%sm'%(val, text, self._codes.get('rs', '0'))
|
|
196
|
+
return '\033[%sm%s\033[%sm' % (val, text, self._codes.get('rs', '0'))
|
|
195
197
|
return text
|
|
196
198
|
|
|
197
199
|
def _format_ext(self, text, ext):
|
|
@@ -200,7 +202,7 @@ class Dircolors:
|
|
|
200
202
|
text need not actually end in '.ext' """
|
|
201
203
|
val = self._extensions.get(ext, '0')
|
|
202
204
|
if val:
|
|
203
|
-
return '\033[%sm%s\033[%sm'%(val, text, self._codes.get('rs', '0'))
|
|
205
|
+
return '\033[%sm%s\033[%sm' % (val, text, self._codes.get('rs', '0'))
|
|
204
206
|
return text
|
|
205
207
|
|
|
206
208
|
def format_mode(self, text, mode):
|
|
@@ -225,7 +227,7 @@ class Dircolors:
|
|
|
225
227
|
elif isinstance(mode, os.stat_result):
|
|
226
228
|
mode = mode.st_mode
|
|
227
229
|
else:
|
|
228
|
-
raise ValueError('mode must be int or os.stat_result, not %s'%type(mode))
|
|
230
|
+
raise ValueError('mode must be int or os.stat_result, not %s' % type(mode))
|
|
229
231
|
|
|
230
232
|
if mode:
|
|
231
233
|
if stat.S_ISDIR(mode):
|
|
@@ -244,13 +246,13 @@ class Dircolors:
|
|
|
244
246
|
# special file?
|
|
245
247
|
# pylint: disable=bad-whitespace
|
|
246
248
|
special_types = (
|
|
247
|
-
(stat.S_IFLNK, 'ln'),
|
|
248
|
-
(stat.S_IFIFO, 'pi'),
|
|
249
|
-
(stat.S_IFSOCK, 'so'),
|
|
250
|
-
(stat.S_IFBLK, 'bd'),
|
|
251
|
-
(stat.S_IFCHR, 'cd'),
|
|
252
|
-
(stat.S_ISUID, 'su'),
|
|
253
|
-
(stat.S_ISGID, 'sg'),
|
|
249
|
+
(stat.S_IFLNK, 'ln'), # symlink
|
|
250
|
+
(stat.S_IFIFO, 'pi'), # pipe (FIFO)
|
|
251
|
+
(stat.S_IFSOCK, 'so'), # socket
|
|
252
|
+
(stat.S_IFBLK, 'bd'), # block device
|
|
253
|
+
(stat.S_IFCHR, 'cd'), # character device
|
|
254
|
+
(stat.S_ISUID, 'su'), # setuid
|
|
255
|
+
(stat.S_ISGID, 'sg'), # setgid
|
|
254
256
|
)
|
|
255
257
|
|
|
256
258
|
for mask, code in special_types:
|
|
@@ -290,13 +292,13 @@ class Dircolors:
|
|
|
290
292
|
try:
|
|
291
293
|
statbuf = dc_util.stat_at(file, cwd, follow_symlinks)
|
|
292
294
|
except OSError as e:
|
|
293
|
-
return '%s [Error stat-ing: %s]'%(file, e.strerror)
|
|
295
|
+
return '%s [Error stat-ing: %s]' % (file, e.strerror)
|
|
294
296
|
|
|
295
297
|
mode = statbuf.st_mode
|
|
296
298
|
if (not follow_symlinks) and show_target and stat.S_ISLNK(mode):
|
|
297
299
|
target_path = dc_util.readlink_at(file, cwd)
|
|
298
300
|
try:
|
|
299
|
-
dc_util.stat_at(target_path, cwd)
|
|
301
|
+
dc_util.stat_at(target_path, cwd) # check for broken link
|
|
300
302
|
target = self.format(target_path, cwd, False, False)
|
|
301
303
|
except OSError:
|
|
302
304
|
# format as "orphan"
|
skilleter_thingy/thingy/git2.py
CHANGED
skilleter_thingy/thingy/popup.py
CHANGED
|
@@ -148,7 +148,7 @@ class Pane():
|
|
|
148
148
|
|
|
149
149
|
filestat = os.stat(filename, follow_symlinks=False)
|
|
150
150
|
|
|
151
|
-
info = {'name':filename,
|
|
151
|
+
info = {'name': filename,
|
|
152
152
|
'mode': filestat.st_mode,
|
|
153
153
|
'uid': filestat.st_uid,
|
|
154
154
|
'gid': filestat.st_gid,
|
|
@@ -310,7 +310,7 @@ class Pane():
|
|
|
310
310
|
else:
|
|
311
311
|
self.screen.clrtoeol()
|
|
312
312
|
|
|
313
|
-
#if len(filename) < self.width:
|
|
313
|
+
# if len(filename) < self.width:
|
|
314
314
|
# self.screen.addstr(self.file_list_y + ypos, len(filename), ' ' * (self.width - len(filename)), normal_colour)
|
|
315
315
|
|
|
316
316
|
current_dir = path.trimpath(self.current_dir, self.width)
|
|
@@ -541,7 +541,7 @@ class Pane():
|
|
|
541
541
|
|
|
542
542
|
self.height = height
|
|
543
543
|
self.file_list_h = height-1
|
|
544
|
-
self.width = pane_width-1
|
|
544
|
+
self.width = pane_width-1 # TODO: Why '-1'?
|
|
545
545
|
self.screen.resize(height, pane_width)
|
|
546
546
|
self.screen.mvwin(y, x + pane_width*self.index)
|
|
547
547
|
|
skilleter_thingy/thingy/tidy.py
CHANGED
|
@@ -76,23 +76,24 @@ RE_SHA1 = [
|
|
|
76
76
|
# AWS ids
|
|
77
77
|
|
|
78
78
|
RE_AWS = \
|
|
79
|
-
[
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
79
|
+
[
|
|
80
|
+
{'regex': re.compile(r'eni-0[0-9a-f]{16}'), 'replace': '{ENI-ID}'},
|
|
81
|
+
{'regex': re.compile(r'ami-0[0-9a-f]{16}'), 'replace': '{AMI-ID}'},
|
|
82
|
+
{'regex': re.compile(r'snap-0[0-9a-f]{16}'), 'replace': '{AMI-SNAP}'},
|
|
83
|
+
{'regex': re.compile(r'vol-0[0-9a-f]{16}'), 'replace': '{AMI-VOL}'},
|
|
84
|
+
{'regex': re.compile(r'sir-[0-9a-z]{8}'), 'replace': '{SPOT-INSTANCE}'},
|
|
85
|
+
{'regex': re.compile(r'i-0[0-9a-f]{16}'), 'replace': '{EC2-ID}'},
|
|
86
|
+
{'regex': re.compile(r'request id: [0-0a-f]{8}-[0-0a-f]{4}-[0-0a-f]{4}-[0-0a-f]{4}-[0-0a-f]{12}'),
|
|
87
|
+
'replace': 'request id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'},
|
|
88
|
+
]
|
|
88
89
|
|
|
89
90
|
# Data transfer speeds
|
|
90
91
|
|
|
91
92
|
RE_SPEED = \
|
|
92
|
-
[
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
]
|
|
93
|
+
[
|
|
94
|
+
{'regex': re.compile(r'[0-9.]+ *MB/s'), 'replace': '{SPEED}'},
|
|
95
|
+
{'regex': re.compile(r'[0-9.]+ *MiB/s'), 'replace': '{SPEED}'},
|
|
96
|
+
]
|
|
96
97
|
|
|
97
98
|
################################################################################
|
|
98
99
|
|
skilleter_thingy/venv_create.py
CHANGED
|
@@ -24,7 +24,7 @@ def main():
|
|
|
24
24
|
|
|
25
25
|
statinfo = os.stat(script)
|
|
26
26
|
|
|
27
|
-
os.chmod(script, statinfo.st_mode|stat.S_IXUSR|stat.S_IXGRP|stat.S_IXOTH)
|
|
27
|
+
os.chmod(script, statinfo.st_mode | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)
|
|
28
28
|
|
|
29
29
|
print(f'Created virtual environment: {script}')
|
|
30
30
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: skilleter_thingy
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.22
|
|
4
4
|
Summary: A collection of useful utilities, mainly aimed at making Git more friendly
|
|
5
5
|
Author-email: John Skilleter <john@skilleter.org.uk>
|
|
6
6
|
Project-URL: Home, https://skilleter.org.uk
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: skilleter_thingy
|
|
3
|
+
Version: 0.0.49
|
|
4
|
+
Summary: A collection of useful utilities, mainly aimed at making Git more friendly
|
|
5
|
+
Author-email: John Skilleter <john@skilleter.org.uk>
|
|
6
|
+
Project-URL: Home, https://skilleter.org.uk
|
|
7
|
+
Classifier: Programming Language :: Python :: 3
|
|
8
|
+
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
|
|
9
|
+
Classifier: Operating System :: OS Independent
|
|
10
|
+
Requires-Python: >=3.6
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Requires-Dist: imagehash
|
|
14
|
+
Requires-Dist: inotify
|
|
15
|
+
Requires-Dist: pillow
|
|
16
|
+
Requires-Dist: psutil
|
|
17
|
+
Requires-Dist: pyaml
|
|
18
|
+
Requires-Dist: pygit2
|
|
19
|
+
Requires-Dist: python-dateutil
|
|
20
|
+
Requires-Dist: requests
|
|
21
|
+
|
|
22
|
+
# Thingy
|
|
23
|
+
|
|
24
|
+
Licence: GPL v3
|
|
25
|
+
|
|
26
|
+
Author: John Skilleter v0.99
|
|
27
|
+
|
|
28
|
+
Collection of shell utilities and configuration stuff for Linux and MacOS. Untested on other operating systems.
|
|
29
|
+
|
|
30
|
+
Permanently (for the forseeable future!) in a beta stage - usable, with a few rough edges, and probably with bugs when used in way I'm not expecting!
|
|
31
|
+
|
|
32
|
+
The following commands are documented in detail in the help output that can be displayed by running the command with the '--help' option.
|
|
33
|
+
|
|
34
|
+
This README just contains a summary of the functionality of each command.
|
|
35
|
+
|
|
36
|
+
# General Commands
|
|
37
|
+
|
|
38
|
+
## addpath
|
|
39
|
+
|
|
40
|
+
Update a $PATH-type variable by adding or removing entries.
|
|
41
|
+
|
|
42
|
+
## borger
|
|
43
|
+
|
|
44
|
+
Wrapper for the borg backup utility to make it easier to use with a fixed set of options.
|
|
45
|
+
|
|
46
|
+
## console-colours
|
|
47
|
+
|
|
48
|
+
Display all available colours in the console.
|
|
49
|
+
|
|
50
|
+
## diskspacecheck
|
|
51
|
+
|
|
52
|
+
Check how much free space is available on all filesystems, ignoring read-only filesystems, /dev and tmpfs.
|
|
53
|
+
|
|
54
|
+
Issue a warning if any are above 90% used.
|
|
55
|
+
|
|
56
|
+
## docker-purge
|
|
57
|
+
|
|
58
|
+
Stop or kill docker instances and/or remove docker images.
|
|
59
|
+
|
|
60
|
+
## ffind
|
|
61
|
+
|
|
62
|
+
Simple file find utility
|
|
63
|
+
|
|
64
|
+
Implements the functionality of the find command that is regularly used in a simpler fashion and ignores all the options that nobody ever uses.
|
|
65
|
+
|
|
66
|
+
## gl
|
|
67
|
+
|
|
68
|
+
### gphotosync
|
|
69
|
+
|
|
70
|
+
Utility for syncing photos from Google Photos to local storage
|
|
71
|
+
|
|
72
|
+
## linecount
|
|
73
|
+
|
|
74
|
+
Count lines of code in a directory tree organised by file type.
|
|
75
|
+
|
|
76
|
+
## moviemover
|
|
77
|
+
|
|
78
|
+
Search for files matching a wildcard in a directory tree and move them to an equivalent location in a different tree
|
|
79
|
+
|
|
80
|
+
## phototidier
|
|
81
|
+
|
|
82
|
+
Perform various tidying operations on a directory full of photos:
|
|
83
|
+
|
|
84
|
+
* Remove leading '$' and '_' from filenames
|
|
85
|
+
* Move files in hidden directories up 1 level
|
|
86
|
+
* If the EXIF data in a photo indicates that it was taken on date that doesn't match the name of the directory it is stored in (in YYYY-MM-DD format) then it is moved to the correct directory, creating it if necessary.
|
|
87
|
+
|
|
88
|
+
All move/rename operations are carried out safely with the file being moved having
|
|
89
|
+
a numeric suffix added to the name if it conflicts with an existing file.
|
|
90
|
+
|
|
91
|
+
## photodupe
|
|
92
|
+
|
|
93
|
+
## py-audit
|
|
94
|
+
|
|
95
|
+
Query api.osv.dev to determine whether a specified version of a particular Python package is subject to known security vulnerabilities
|
|
96
|
+
|
|
97
|
+
## readable
|
|
98
|
+
|
|
99
|
+
Pipe for converting colour combinations to make them readable on a light background
|
|
100
|
+
|
|
101
|
+
## remdir
|
|
102
|
+
|
|
103
|
+
Recursively delete empty directories
|
|
104
|
+
|
|
105
|
+
## rmdupe
|
|
106
|
+
|
|
107
|
+
Search for duplicate files
|
|
108
|
+
|
|
109
|
+
## rpylint
|
|
110
|
+
|
|
111
|
+
Run pylint on all the Python source files in the current tree
|
|
112
|
+
|
|
113
|
+
## s3-sync
|
|
114
|
+
|
|
115
|
+
Synchronise files from S3 to local storage.
|
|
116
|
+
|
|
117
|
+
## splitpics
|
|
118
|
+
|
|
119
|
+
Copy a directory full of pictures to a destination, creating subdiretories with a fixed number of pictures in each in the destination directory for use with FAT filesystems and digital photo frames.
|
|
120
|
+
|
|
121
|
+
## strreplace
|
|
122
|
+
|
|
123
|
+
Simple search and replace utility for those times when trying to escape characters in a regexp to use sed is more hassle than it is worth.
|
|
124
|
+
|
|
125
|
+
## sysmon
|
|
126
|
+
|
|
127
|
+
## tfm
|
|
128
|
+
|
|
129
|
+
Console-based file-manager, similar to Midnight Commander but better.
|
|
130
|
+
|
|
131
|
+
## tfparse
|
|
132
|
+
|
|
133
|
+
Read JSON Terraform output and convert back to human-readable text
|
|
134
|
+
This allows multiple errors and warnings to be reported as there's
|
|
135
|
+
no way of doing this directly from Terraform
|
|
136
|
+
|
|
137
|
+
## trimpath
|
|
138
|
+
|
|
139
|
+
Intelligently trim a path to fit a given width (used by gitprompt)
|
|
140
|
+
|
|
141
|
+
## window-rename
|
|
142
|
+
|
|
143
|
+
## xchmod
|
|
144
|
+
|
|
145
|
+
WIP: Command to run chmod only on files that need it (only modifies files that don't have the required permissions already).
|
|
146
|
+
|
|
147
|
+
Currently implements a *very* restricted set of functionality.
|
|
148
|
+
|
|
149
|
+
## yamlcheck
|
|
150
|
+
|
|
151
|
+
YAML validator - checks that a file is valid YAML (use yamllint to verify that it is nicely-formatted YAML).
|
|
152
|
+
|
|
153
|
+
# Git Utilities
|
|
154
|
+
|
|
155
|
+
## ggit
|
|
156
|
+
|
|
157
|
+
Run a git command in all repos under the current directory
|
|
158
|
+
|
|
159
|
+
## ggrep
|
|
160
|
+
|
|
161
|
+
Run 'git grep' in all repos under the current directory
|
|
162
|
+
|
|
163
|
+
## gitprompt
|
|
164
|
+
|
|
165
|
+
Output a string containing colour-coded shell nesting level, current directory and git working tree status (used in the shell prompt).
|
|
166
|
+
|
|
167
|
+
## git ca
|
|
168
|
+
|
|
169
|
+
Improved version of 'git commit --amend'. Updates files that are already in the commit and, optionally, adds and commits additional files.
|
|
170
|
+
|
|
171
|
+
## git cleanup
|
|
172
|
+
|
|
173
|
+
List or delete branches that have already been merged and delete tracking branches that are no longer on ther remote.
|
|
174
|
+
|
|
175
|
+
## git co
|
|
176
|
+
|
|
177
|
+
## git mr
|
|
178
|
+
|
|
179
|
+
## git parent
|
|
180
|
+
|
|
181
|
+
## git update
|
|
182
|
+
|
|
183
|
+
Update the repo from the remote, rebase branches against their parents, optionally run git cleanup
|
|
184
|
+
|
|
185
|
+
## git wt
|
|
186
|
+
|
|
187
|
+
Output the top level directory of the git working tree or return an error if we are not in a git working tree.
|
|
188
|
+
|
|
189
|
+
## git review
|
|
190
|
+
|
|
191
|
+
## venv-create
|
|
192
|
+
|
|
193
|
+
Create a script to create/update a virtual environment and run a python script in it.
|