These are old scripts that I no longer use, but kept here for reference of one day, I might need to look up something.
These are scripts that makes my life easier
A script that creates an ssh key if a one is not there, then scp that key to the server.
a script that I use to convert rm files to mp3 or ogg, actually it can be used to convert any format readable by mplayer, it uses lame for mp3, and vorbis-tools for ogg.
a script that I use to convert rmvb files to avi.
A script to make sure that my IPv6 Tunnel is always on. more
A script to change my default gateway, when the current one fails.
A script to check if someone logged into the machine and removed his entry from
/var/run/utmp
A Python script to append a message from a file to an IMAP mailbox.
- Python 3
imaplib(standard library)
appendMessage -u username -s server -f file [-p password] [-m mailbox] [-n]-u username- Mail username (required)-s server- Mail server to connect to (required)-f file- File containing the message to append (required)-p password- Mail password (optional, will prompt securely if not provided)-m mailbox- Mailbox to append message to (default: INBOX)-n- Disable SSL/TLS (default: SSL/TLS enabled)
- Secure password prompting if not provided via command line
- Uses SSL/TLS connection by default (IMAP4_SSL)
- Optional non-SSL connection with
-nflag - Proper error handling and resource cleanup
- Decodes binary IMAP responses to UTF-8
- Uses UTF-8 encoding for message content
# Prompt for password securely
appendMessage -u user@example.com -s imap.example.com -f message.txt
# Append to a specific mailbox
appendMessage -u user@example.com -s imap.example.com -f draft.eml -m Drafts
# Use non-SSL connection
appendMessage -u user@example.com -s imap.example.com -f message.txt -nA Python script to count the number of messages in an IMAP mailbox.
- Python 3
imaplib(standard library)
countInbox -u username -s server [-p password] [-m mailbox] [-n]-u username- Mail username (required)-s server- Mail server to connect to (required)-p password- Mail password (optional, will prompt securely if not provided)-m mailbox- Mailbox to read the count of messages (default: INBOX)-n- Disable SSL/TLS (default: SSL/TLS enabled)
- Secure password prompting if not provided via command line
- Uses SSL/TLS connection by default (IMAP4_SSL)
- Optional non-SSL connection with
-nflag - Proper error handling and resource cleanup
- Decodes binary IMAP responses to UTF-8
# Prompt for password securely
countInbox -u user@example.com -s imap.example.com
# Specify password on command line (less secure)
countInbox -u user@example.com -s imap.example.com -p mypassword
# Check a specific mailbox
countInbox -u user@example.com -s imap.example.com -m "Sent Items"