H

Hassan Ali

@hassan_ops

Bronze
565 Reputation Points

About

Site reliability engineer

Joined Jan 2026

Q&A Statistics

Questions 5
Answers 9
Articles 4
Total Votes 287

All Answers

Re: How to create and use Python decorators

import functools import time # Basic decorator def my_decorator(func): @functools.wraps(func) def wrapper(*args, **kwargs): print("Before function") result = func(*args, **kwargs) print("After …

25 4 weeks, 1 day ago

Re: How to search text in files using grep

# Basic search grep "pattern" file.txt # Recursive search in directory grep -r "pattern" /path/ # Case insensitive grep -i …

9 4 weeks, 1 day ago

Re: How to manage services with systemd

# Start/stop service sudo systemctl start nginx sudo systemctl stop nginx sudo systemctl restart nginx sudo systemctl reload nginx # …

10 4 weeks, 1 day ago

Re: How to create a class in Python

class User: # Class variable user_count = 0 def __init__(self, name, email): self.name = name self.email = email User.user_count += …

8 4 weeks, 1 day ago

Re: How to create custom Django management commands

Create command file structure myapp/ management/ __init__.py commands/ __init__.py mycommand.py Write the command # myapp/management/commands/mycommand.py from django.core.management.base import BaseCommand class …

10 4 weeks, 1 day ago

Re: How to set up UFW firewall on Ubuntu

Enable UFW # Check status sudo ufw status # Set default policies sudo ufw default deny incoming sudo ufw default …

25 4 weeks, 1 day ago