Skip to content

Commit 534aa9e

Browse files
committed
Updated readme references to new GH alias
1 parent c04fd3f commit 534aa9e

File tree

2 files changed

+59
-31
lines changed

2 files changed

+59
-31
lines changed

README.md

Lines changed: 49 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
A collection of small scripts written in Python and implemented as command line utility programs.
44

5-
#### [Batch Resizer](https://github.com/herokunt/python-scripts/blob/main/batch-resizer.py)
5+
#### [Batch Resizer](https://github.com/D10f/python-scripts/tree/main/batch_resizer)
6+
67
Process images by converting them to different formats, resizing them and store them as compressed archives for easy upload to your cloud. You may provide one or more images and they'll be processed in parallel for extra speed. File metadata like GPS location, camera model, etc., is completely removed.
78

89
```
@@ -20,7 +21,9 @@ $ resizer.py ~/Pictures/* -o ~/Desktop -t backup
2021
```
2122

2223
---
23-
#### [Password Checker](https://github.com/herokunt/python-scripts/blob/main/password_checker.py)
24+
25+
#### [Password Checker](https://github.com/D10f/python-scripts/blob/main/password_checker.py)
26+
2427
Check your passwords against the popular "Have I Been Pwned?" website and find out if they've been leaked in any of the increasingly common data breaches. Your passwords provided to the script will remain secured as only a hash is used, as per the Have I Been Pwned API requires.
2528

2629
You can provide passwords inline or through a CSV file, ideal if your password manager (such as KeePassXC) supports exporting data in CSV format. For security you can instruct the script to securely delete that file from your hard drive by overwriting the original contents with random bytes before deleting it.
@@ -34,7 +37,9 @@ DEBUG:root:Securely deleting file (3 rounds...)
3437
```
3538

3639
---
37-
#### [File Organizer](https://github.com/herokunt/python-scripts/blob/main/file_organizer.py)
40+
41+
#### [File Organizer](https://github.com/D10f/python-scripts/blob/main/file_organizer.py)
42+
3843
Automate the boring task of organizing your files into a neat folder structure. This script will look at your files inside the Downloads folder and move them to where they belong based on the file extension. If you have hundreds of files in there this will clear things up in the blink of an eye!.
3944

4045
Provide additional options to customize which files you want to move around and where to send them. Run it in test-mode to see first what changes would be make to avoid any mistakes. For best results, run this automatically using a scheduler like `cron` and combine it with the following script in the list.
@@ -62,16 +67,18 @@ Examples:
6267
```
6368

6469
Todo:
70+
6571
- [ ] Allow using -f to force overwrite existing files, or create copies
66-
- [ ] Create missing directories when specified as destination source
67-
for moved files.
68-
- [X] Improve dry-run output for clarity
69-
- [X] Improve logging verbosity, add colors and clear format.
72+
- [ ] Create missing directories when specified as destination source
73+
for moved files.
74+
- [x] Improve dry-run output for clarity
75+
- [x] Improve logging verbosity, add colors and clear format.
7076
- [ ] Support for multiple sources e.g, Desktop and Downloads
7177

72-
7378
---
74-
#### [Nama Nama](https://github.com/herokunt/python-scripts/blob/main/nama_nama.py)
79+
80+
#### [Nama Nama](https://github.com/D10f/python-scripts/blob/main/nama_nama.py)
81+
7582
"Nama" means name in some languages such as Malay or Indonesian. This small utility script will help organize any collection of files by renaming them uniformly, adding prefixes and sufixes, custom separators, etc. Ideal for music, images, books and other types of documents that have uneven format (mixed of uppercase and lowercase, underscores with spaces, etc). Before, and after:
7683

7784
```
@@ -95,7 +102,9 @@ Learn_Linux_In_5_Days.pdf
95102
```
96103

97104
---
98-
#### [Oh, Node!](https://github.com/herokunt/python-scripts/blob/main/oh_node.py)
105+
106+
#### [Oh, Node!](https://github.com/D10f/python-scripts/blob/main/oh_node.py)
107+
99108
Curious about how many files does that node_modules folder has in it? How many lines of code? What kind of files are in there? This small utility script will find out for you exactly that!
100109

101110
```
@@ -119,24 +128,33 @@ Total lines of code.......................14504117
119128
```
120129

121130
---
122-
#### [Scanner](https://github.com/herokunt/python-scripts/blob/main/scanner.py)
131+
132+
#### [Scanner](https://github.com/D10f/python-scripts/blob/main/scanner.py)
133+
123134
A simple but functional port scanner to find out which ports are open in your local network. Specify the host by IP or name, and optionally the range of ports to scan in the host.
124135

125136
---
126-
#### [Zombie Dice](https://github.com/herokunt/python-scripts/blob/main/zombiedice.py)
137+
138+
#### [Zombie Dice](https://github.com/D10f/python-scripts/blob/main/zombiedice.py)
139+
127140
Zombie Dice is a "press your luck" party dice game created by Steve Jackson Games. Following along the "Automating the Boring Stuff With Python" book by Al Sweigart I wrote this script that plays this game using bots.
128141

129142
---
130-
#### [Conway's Game of Life](https://github.com/herokunt/python-scripts/blob/main/conway.py)
131-
The classic Game of Life has three simple rules, but can be complex enough to build entire computational systems with it; I highly recommend to watch the first few minutes of this [great talk about The Art of Code](https://www.youtube.com/watch?v=gdSlcxxYAA8). Following along the "Automating the Boring Stuff With Python" book by Al Sweigart this is an attempt to write the game in a (hopefully) cleaner and more pythonic way.
132143

144+
#### [Conway's Game of Life](https://github.com/D10f/python-scripts/blob/main/conway.py)
145+
146+
The classic Game of Life has three simple rules, but can be complex enough to build entire computational systems with it; I highly recommend to watch the first few minutes of this [great talk about The Art of Code](https://www.youtube.com/watch?v=gdSlcxxYAA8). Following along the "Automating the Boring Stuff With Python" book by Al Sweigart this is an attempt to write the game in a (hopefully) cleaner and more pythonic way.
133147

134148
---
135-
#### [Collatz Sequence](https://github.com/herokunt/python-scripts/blob/main/collatz.py)
136-
Following along the "Automating the Boring Stuff With Python" book by Al Sweigart this is a script that runs from the terminal, taking one number and following the "Collatz Conjecture" rules where any positive number will eventually and invariable be reduced down to 1.
149+
150+
#### [Collatz Sequence](https://github.com/D10f/python-scripts/blob/main/collatz.py)
151+
152+
Following along the "Automating the Boring Stuff With Python" book by Al Sweigart this is a script that runs from the terminal, taking one number and following the "Collatz Conjecture" rules where any positive number will eventually and invariable be reduced down to 1.
137153

138154
---
139-
#### [Caesar's cipher](https://github.com/herokunt/python-scripts/blob/main/ciphers/caesar-chiper.py)
155+
156+
#### [Caesar's cipher](https://github.com/D10f/python-scripts/blob/main/ciphers/caesar-chiper.py)
157+
140158
One of the most popular ciphers used over 2000 years ago. Following along the "Cracking Codes With Python" book by Al Sweigart, this is an attempt to create an improved and flexible implementation of the cipher that works from the command line. It supports the expected operations of encryption, decryption as well as key derivation and brute forcing.
141159

142160
```
@@ -148,9 +166,11 @@ t^$$^% )v%)v z) %^_ _yr_ t^$$^%
148166
$ caesar-cipher.py -k 'common sense is not that common' 't^$$^% )v%)v z) %^_ _yr_ t^$$^%'
149167
The key used to encrypt this message was 17
150168
```
169+
151170
---
152171

153-
#### [Transposition cipher](https://github.com/herokunt/python-scripts/blob/main/ciphers/transposition-cipher.py)
172+
#### [Transposition cipher](https://github.com/D10f/python-scripts/blob/main/ciphers/transposition-cipher.py)
173+
154174
A cipher that works by laying the letters of a message in a grid of varying size and encrypting the message from it. Following along the "Cracking Codes With Python" book by Al Sweigart, this is an attempt to create an improved and flexible implementation of the cipher that works from the command line. It supports the expected operations of encryption, decryption as well as key derivation and brute forcing.
155175

156176
```
@@ -164,7 +184,9 @@ Batch resizer is a small utility script that looks at a directory and processes
164184
```
165185

166186
---
167-
#### [Affine Cipher](https://github.com/herokunt/python-scripts/blob/main/ciphers/affine_cipher.py)
187+
188+
#### [Affine Cipher](https://github.com/D10f/python-scripts/blob/main/ciphers/affine_cipher.py)
189+
168190
A combination of the Caesar cipher and Multiplicative cipher to create stronger encryption. Following along the "Cracking Codes With Python" book by Al Sweigart, this script is very simple to use from the command line to encrypt, decrypt or brute force any ciphertext encrypted using this cipher.
169191

170192
```
@@ -174,10 +196,13 @@ The encryption key is: 4351
174196
```
175197

176198
---
177-
#### [Simple Substitution Cipher](https://github.com/herokunt/python-scripts/blob/main/ciphers/simple_sub_cipher.py)
199+
200+
#### [Simple Substitution Cipher](https://github.com/D10f/python-scripts/blob/main/ciphers/simple_sub_cipher.py)
201+
178202
A substitution cipher uses a re-arranged alphabet (in this case English alphabet) as the key to encrypt a message. This results in too many possible combinations to brute force through each of them in a reasonable amount of time, but can be hacked through cross-referencing each letter from the message. Because of this, it's also most effective the longer the encrypted message. Following along the "Cracking Codes With Python" book by Al Sweigart, this is an implementation that can be used from the command line.
179203

180204
Encryption:
205+
181206
```
182207
$ simple_sub_cipher.py -e "The Ministry of Truth contained, it was said, three thousand rooms above ground level... Scattered about London there were just three other buildings of similar appearance and size... They were the homes of the four Ministries between which the entire apparatus of government was divided. The Ministry of Truth, which concerned itself with news, entertainment, education, and the fine arts. The Ministry of Peace, which concerned itself with war. The Ministry of Love, which maintained law and order. And the Ministry of Plenty, which was responsible for economic affairs."
183208
@@ -186,12 +211,15 @@ Wvu Tqnqjwdl zp Wdrwv xznwoqnua, qw eoj joqa, wvduu wvzrjona dzztj okzmu cdzrna
186211
```
187212

188213
Cross-reference attack:
214+
189215
```
190216
$ simple_sub_cipher.py -f "Wvu Tqnqjwdl zp Wdrwv xznwoqnua, qw eoj joqa, wvduu wvzrjona dzztj okzmu cdzrna sumus... Jxowwudua okzrw Sznazn wvudu eudu brjw wvduu zwvud krqsaqncj zp jqtqsod ohhuodonxu ona jqfu... Wvul eudu wvu vztuj zp wvu pzrd Tqnqjwdquj kuweuun evqxv wvu unwqdu ohhodowrj zp czmudntunw eoj aqmqaua. Wvu Tqnqjwdl zp Wdrwv, evqxv xznxudnua qwjusp eqwv nuej, unwudwoqntunw, uarxowqzn, ona wvu pqnu odwj. Wvu Tqnqjwdl zp Huoxu, evqxv xznxudnua qwjusp eqwv eod. Wvu Tqnqjwdl zp Szmu, evqxv toqnwoqnua soe ona zdaud. Ona wvu Tqnqjwdl zp Hsunwl, evqxv eoj dujhznjqksu pzd uxznztqx oppoqdj."
191217
192218
Tve Ministrl of Trutv contained, it eas said, tvree tvousand rooms above ground level... Scattered about London tvere eere bust tvree otver buildings of similar appearance and sife... Tvel eere tve vomes of tve four Ministries beteeen evicv tve entire apparatus of government eas divided. Tve Ministrl of Trutv, evicv concerned itself eitv nees, entertainment, education, and tve fine arts. Tve Ministrl of Peace, evicv concerned itself eitv ear. Tve Ministrl of Love, evicv maintained lae and order. And tve Ministrl of Plentl, evicv eas responsible for economic affairs.
193219
```
194220

195221
---
196-
#### [Vigenere Cipher](https://github.com/herokunt/python-scripts/blob/main/ciphers/vigenere_cipher.py)
222+
223+
#### [Vigenere Cipher](https://github.com/D10f/python-scripts/blob/main/ciphers/vigenere_cipher.py)
224+
197225
Following along the "Cracking Codes With Python" book by Al Sweigart, this is an implementation of the Vigenere cipher that can be used from the command line.

file_organizer.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ def main():
162162

163163
if args.map:
164164
update_file_associations(args.map)
165-
165+
166166
target_files = select_files(
167167
args.src,
168168
ignore_extensions = args.ignore,
@@ -192,7 +192,7 @@ def move_files(files, force = False, dry = False):
192192
shutil.move(str(file), str(directory))
193193

194194
logger.info(f'Moving {file} to {directory}')
195-
195+
196196
if file_already_exists:
197197
logger.warning(f'-f flag provided! Overwriting {Path.joinpath(directory, file.name)}')
198198

@@ -211,7 +211,7 @@ def select_files(src_dir, ignore_extensions = None, only_extensions = None, patt
211211
# ignore files without extension (includes directories)
212212
src_dir_files = [x for x in Path.iterdir(src_dir) if x.suffix]
213213

214-
# Pre-prend extension list with a dot if it was not provided
214+
# Prepend extension list with a dot if it was not provided
215215
if only_extensions:
216216
ext_filters = [f'.{ext}' if not ext.startswith('.') else ext for ext in only_extensions]
217217
src_dir_files = [x for x in src_dir_files if x.suffix in ext_filters]
@@ -233,7 +233,7 @@ def update_file_associations(custom_map):
233233

234234
for mapping in custom_map:
235235
[custom_dir_input, file_extension_input] = mapping.split('=')
236-
236+
237237
custom_dir_path = Path(custom_dir_input).resolve()
238238

239239
# Prefix them with a dot if it was not provided as arguments
@@ -242,7 +242,7 @@ def update_file_associations(custom_map):
242242
# Remove extensions from existing sets
243243
for directory in FILE_EXT_ASSOCIATIONS:
244244
FILE_EXT_ASSOCIATIONS[directory].difference_update(file_extensions)
245-
245+
246246
# Create or update set with the extensions as specified
247247
if custom_dir_path in FILE_EXT_ASSOCIATIONS:
248248
FILE_EXT_ASSOCIATIONS[custom_dir_path].update(file_extensions)
@@ -273,13 +273,13 @@ def print_arguments(args):
273273
logger.debug(f'Running as user: {os.getenv("USER")}')
274274
logger.debug(f'Running with arguments: {args}')
275275
logger.info(f'Reading from: {args.src}')
276-
276+
277277
if args.ignore:
278278
logger.info(f'Ignoring extensions: {args.ignore}')
279279

280280
if args.only:
281281
logger.info(f'Running only for extensions: {args.only}')
282-
282+
283283
if args.pattern:
284284
logger.info(f'Looking files matching pattern: {args.pattern}')
285285

@@ -289,7 +289,7 @@ def print_arguments(args):
289289

290290
if args.force:
291291
logger.info(f'Running with force option enabled.')
292-
292+
293293
if args.dry:
294294
logger.warning(f"Running in test mode. Changes won't be saved to disk.")
295295

@@ -325,7 +325,7 @@ def parse_arguments():
325325
help='Overwrites existing files in target directory',
326326
action='store_true'
327327
)
328-
328+
329329
parser.add_argument('-e', '--regexp',
330330
help='Uses regular expression matching to filter down results.',
331331
dest='pattern',
@@ -386,4 +386,4 @@ def format(self, record):
386386

387387

388388
if __name__ == '__main__':
389-
main()
389+
main()

0 commit comments

Comments
 (0)