Tim's Blog

How to zip & unzip in Linux

Install zip and unzip sudo apt-get install zip unzip Zip a folder zip -r file_name.zip /path/to/folder Unzip at current working directory unzip file_name.zip Unzip at specified folder unzip file_name.zip -d /path/to/folder

Testing NGINX config

To test Nginx config: nginx -t To test a specific config file: nginx -t -c /etc/nginx/sites-enabled/example.com

How to create persistent PostgreSQL database with docker-compose

To spin up Postgres on Docker, create docker-compose.yml like so: version: '3.3' services: db: image: postgres:14-alpine # alpine images are lighweight restart: always container_name: db ports: - 5432:5432 # expose default Postgres port for connections environment: # initialize database connection parameters with environment variables. # more info:

How to set up One2many relationships in Flask SQLAlchemy

class Class(db.Model): id = db.Column(db.Integer, primary_key=True) students = db.relationship('Students', backref='class') def as_dict(self): result = {col.name: getattr(self, col.name) for col in self.__table__.columns} # add students data to result dict result['students'] = [student.

Installing Plex server on headless Raspberry Pi

# update and upgrade sudo apt-get update sudo apt-get upgrade # add plex repo sudo apt-get install apt-transport-https curl <https://downloads.plex.tv/plex-keys/PlexSign.key> | sudo apt-key add - echo deb <https://downloads.plex.tv/repo/deb> public main | sudo tee /etc/apt/sources.list.d/plexmediaserver.

Tim's Blog © 2026