This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
"""Replace line breaks, from one format to another.""" | |
from __future__ import print_function | |
import argparse | |
import glob | |
import os | |
import sys |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# cat $HOME/my_file.txt | |
# Hi there | |
# This is a second line | |
# And third with text_to_replace string | |
import fileinput | |
from pathlib import Path | |
filepath = Path.home() / my_file.txt | |
with fileinput.FileInput(str(filepath.resolve()), inplace=True) as f: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
transfer() { | |
if [ $# -eq 0 ]; then | |
echo -e "No arguments specified. Usage:\necho transfer /tmp/test.md\ncat /tmp/test.md | transfer test.md" | |
return 1 | |
fi | |
tmpfile=$( mktemp -t transferXXX ) | |
if tty -s; then | |
basefile=$(basename "$1" | sed -e 's/[^a-zA-Z0-9._-]/-/g') | |
curl --progress-bar --upload-file "$1" "https://transfer.sh/$basefile" >> $tmpfile | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Change IP to CIDR (ignore second IP) and export to CSV | |
Usage: | |
python3 main.py <source_file> | |
Example data: | |
<source_file>: | |
1.0.174.0,1.0.174.255,AS,TH,"Nakhon Si Thammarat","Phra Phrom",8.33911,99.9009 | |
1.0.78.0,1.0.78.255,AS,JP,Hiroshima,Hiroshima,34.4002,132.475 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2024-03-10 16:28:03.8|Trace|DiskProviderBase|Deleting file: /config/logs/prowlarr.debug.txt | |
2024-03-10 16:28:03.8|Trace|CommandQueueManager|Updating command status | |
2024-03-10 16:28:03.9|Trace|EventAggregator|Publishing CommandUpdatedEvent | |
2024-03-10 16:28:03.9|Trace|EventAggregator|CommandUpdatedEvent -> CommandController | |
2024-03-10 16:28:03.9|Trace|EventAggregator|CommandUpdatedEvent <- CommandController | |
2024-03-10 16:28:03.9|Trace|EventAggregator|Publishing CommandExecutedEvent | |
2024-03-10 16:28:03.9|Trace|EventAggregator|CommandExecutedEvent -> TaskManager | |
2024-03-10 16:28:03.9|Trace|EventAggregator|CommandExecutedEvent <- TaskManager | |
2024-03-10 16:28:03.9|Trace|EventAggregator|CommandExecutedEvent -> TaskController | |
2024-03-10 16:28:03.9|Trace|EventAggregator|CommandExecutedEvent <- TaskController |