Omar Khalil
@omar_linux
About
Linux enthusiast and open source contributor
Q&A Statistics
Recent Questions
View all →How to create shell script with arguments
How to use screen or tmux for persistent sessions
How to view and manage running processes
How to compress and extract tar.gz files on Linux
How to set up automatic security updates on Ubuntu
Recent Answers
View all →Re: How to format strings in Python
name = "John" age = 30 # f-strings (Python 3.6+, recommended) message = f"Hello, {name}. You are {age}." # format() …
Re: How to send emails in Django
Configure email settings # settings.py EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' EMAIL_HOST = 'smtp.gmail.com' EMAIL_PORT = 587 EMAIL_USE_TLS = True EMAIL_HOST_USER = 'your-email@gmail.com' …
Re: How to work with environment variables in Python
Reading environment variables import os # Get with default value database_url = os.getenv('DATABASE_URL', 'sqlite:///db.sqlite3') # Get (raises KeyError if not …
Re: How to change hostname on Linux
Change hostname # View current hostname hostname hostnamectl # Change hostname (systemd) sudo hostnamectl set-hostname new-hostname # Edit hosts file …
Re: How to add swap space on Linux
Create swap file # Create 4GB swap file sudo fallocate -l 4G /swapfile # Or using dd sudo dd if=/dev/zero …
Recent Articles
No articles yet.
Open Source Projects
No projects yet.