David Brown
@sysadmin
About
System administrator managing enterprise servers
Q&A Statistics
All Answers
Re: How to add search functionality to Django
# views.py from django.db.models import Q def search(request): query = request.GET.get('q', '') results = [] if query: results = Article.objects.filter( …
Re: How to check system uptime and reboot history
# Check uptime uptime # Output: 12:45:01 up 45 days, 3:21, 2 users # Detailed uptime uptime -p # Output: …
Re: How to find files by name on Linux
# Using find find / -name "filename.txt" # Case insensitive find / -iname "*.log" # Find by type find /var …
Re: How to schedule tasks with cron on Linux
Edit crontab # Edit user crontab crontab -e # Cron format: minute hour day month weekday command # Run at …
Re: How to fix "Permission denied" when running sudo commands
This issue occurs when your user account is not in the sudoers group. Here are the solutions: Solution 1: Add …