How to set up Mastodon using Docker Compose

Prerequisites#

  • Docker and Docker Compose installed
  • Domain name pointing to your server

1. Create Project Directory#

mkdir mastodon
cd mastodon

2. Create Docker Compose File#

Create a docker-compose.yml file:

version: '3'
services:
  db:
    restart: always
    image: postgres:14-alpine
    shm_size: 256mb
    networks:
      - internal_network
    healthcheck:
      test: ['CMD', 'pg_isready', '-U', 'postgres']
    volumes:
      - postgres_data:/var/lib/postgresql/data
    environment:
      - POSTGRES_HOST_AUTH_METHOD=trust

  redis:
    restart: always
    image: redis:7-alpine
    networks:
      - internal_network
    healthcheck:
      test: ['CMD', 'redis-cli', 'ping']
    volumes:
      - redis_data:/data

  web:
    restart: always
    image: tootsuite/mastodon:latest
    networks:
      - external_network
      - internal_network
    healthcheck:
      test: ['CMD-SHELL', 'wget -q --spider http://localhost:3000/health || exit 1']
      timeout: 10s
    depends_on:
      - db
      - redis
    environment:
      - DB_HOST=db
      - DB_USER=postgres
      - DB_NAME=postgres
      - DB_PASS=
      - REDIS_HOST=redis
      - LOCAL_DOMAIN=your-domain.com
      - SINGLE_USER_MODE=false
      - SMTP_SERVER=smtp.mailgun.org
      - SMTP_PORT=587
      - SMTP_LOGIN=your-smtp-login
      - SMTP_PASSWORD=your-smtp-password
      - SMTP_FROM_ADDRESS=notifications@your-domain.com
    volumes:
      - ./public/system:/mastodon/public/system
    ports:
      - "3000:3000"
    command: bash -c "rm -f /mastodon/tmp/pids/server.pid && bundle exec rails s -p 3000"

  streaming:
    restart: always
    image: tootsuite/mastodon:latest
    networks:
      - external_network
      - internal_network
    depends_on:
      - db
      - redis
    environment:
      - DB_HOST=db
      - DB_USER=postgres
      - DB_NAME=postgres
      - DB_PASS=
      - REDIS_HOST=redis
      - LOCAL_DOMAIN=your-domain.com
    volumes:
      - ./public/system:/mastodon/public/system
    ports:
      - "4000:4000"
    command: node ./streaming

  sidekiq:
    restart: always
    image: tootsuite/mastodon:latest
    networks:
      - internal_network
    depends_on:
      - db
      - redis
    environment:
      - DB_HOST=db
      - DB_USER=postgres
      - DB_NAME=postgres
      - DB_PASS=
      - REDIS_HOST=redis
      - LOCAL_DOMAIN=your-domain.com
    volumes:
      - ./public/system:/mastodon/public/system
    command: bundle exec sidekiq

networks:
  external_network:
  internal_network:
    internal: true

volumes:
  postgres_data:
  redis_data:

3. Create Environment File#

Create a .env.production file with your configuration:

How to test AA and AAA batteries using a multimeter

  1. Turn the dial to a higher voltage setting - Try the “200” setting in the DC voltage (V⎓) section. This will handle voltages up to 200V.

  2. Check your connections - Make sure:

    • The black probe is firmly in the “COM” port
    • The red probe is firmly in the “VΩmA” port
    • You’re making good contact with the battery terminals
  3. Verify the battery orientation - Make sure you’re touching:

    • Black probe to the negative (-) end of the battery
    • Red probe to the positive (+) end of the battery

Iceraven and Ironfox browser comparison

Iceraven and IronFox are both open-source browsers for Android, each offering privacy and customization features but with different emphases and user audiences.

Core Features#

FeatureIceravenIronFox
Privacy & TelemetryReduced telemetry, customisable123Strongly privacy-hardened, all telemetry removed456
Add-ons/ExtensionsExtensive support, larger list than stock Firefox178Supports Firefox Android extensions6
CustomizationAbout:config, more desktop-like options127Advanced privacy defaults, stripped-down interface456
Speed & PerformanceComparable to Brave/Chrome; resource-optimised89Lightweight, slightly faster than stock Firefox6
Main FocusCustomization, extension and power-user features12Privacy, de-bloated and anti-tracking465
UpdatesCommunity-driven, slower but steady210Active, responsive to user issues54
Official ChannelsGithub APK releases, not on Play Store128F-Droid/Accrescent, Github, not on Play Store46

Iceraven Browser#

  • Built on stable Firefox for Android, with a focus on more add-on availability and configuration options like about:config1112.
  • Appeals to users who want to replicate desktop Firefox’s customization and plugin experience on mobile111.
  • Releases and updates are maintained via Github and aren’t distributed via the Play Store128.
  • Some comments note the lack of warranties or guarantees for security; best used by power users familiar with browser internals12.

IronFox Browser#

  • Derived from Mull (itself a privacy-focused Firefox fork), with aggressive tracking and telemetry removal456.
  • Prioritizes user privacy, blocks telemetry by default, and comes with strict tracking-protection settings46.
  • Keeps features like Firefox Sync; disables or restricts features leaking data (such as WebGL, unless manually enabled)46.
  • Distributed via alternative app stores like F-Droid, Accrescent, and Github; not available on Play Store46.
  • Some advanced privacy features may result in compatibility issues with certain websites, especially those relying on features IronFox disables by default4.

Summary#

Iceraven is ideal for those wanting a “power-user” browser with deep customization and a broad add-on library, making it similar to desktop Firefox in spirit1117. IronFox is best for users who place privacy first, seeking a Firefox-based browser that automatically strips out telemetry and unnecessary features for a lightweight, secure experience54612. Both offer more control and privacy than standard Firefox for Android, but Iceraven focuses on flexibility while IronFox focuses on privacy hardening. 1314151617181920

List of some self hosted services you can setup on your homelab

Communication & Collaboration#

  1. Matrix.org - A decentralized messaging platform.
  2. Zulip - An open source group chat application.
  3. Nextcloud - A cloud storage and collaboration suite.
  4. ownCloud - A self-hosted file sync and share server.
  5. Mattermost - An open-source team collaboration hub.
  6. Freenode - Internet Relay Chat (IRC) network for open source projects.
  7. GitLab - Web-based Git repository manager with CI/CD pipeline features.
  8. GitPod - A code ide that spins up dev environments with one click.

Social Media & Forums#

  1. Mastodon - A decentralized social network based on the GNU social/G+/Twitter microblogging platform software.
  2. Friendica - An open-source distributed communication and social networking platform.
  3. Flarum - A forum software that focuses on simplicity, speed, elegance, and usability.
  4. Discourse - A modern, open, and versatile discussion platform.
  5. phpBB - A popular open-source forum package.
  6. Fluentd - A data collection tool for collecting events from various data sources to a variety of destinations.
  7. Logstash - An open-source data processing pipeline that can collect data from diverse sources and channel it into a unified format.
  8. Kibana - An open source data visualization and exploration tool built on top of Elasticsearch.

Developer Tools#

  1. Docker - A platform for developing, shipping, and running applications.
  2. Jenkins - An extensible continuous integration server.
  3. GitLab CI/CD - Continuous Integration/Continuous Deployment.
  4. Travis CI - A cloud-based continuous integration service for GitHub and Bitbucket projects.
  5. JIRA - Project management software that includes scrum, sprint planning, backlog prioritization, release tracking features.
  6. Redmine - A free project management web application.
  7. Tuleap - An integrated project management tool combining the best practices in IT project management with modern and open-source tools.

Email & Calendaring#

  1. Roundcube - A web-based mail client.
  2. Horde Groupware Web Application Framework - A groupware suite.
  3. Zimbra - An email, calendar, and collaboration system.
  4. Sogo - A combination of a webserver component for iCalendar, vCard, and SMTP access and client libraries for various IMAP and CalDAV clients.
  5. DuckDuckGo Privacy Browser - A privacy-oriented browser based on Firefox.

Data Management#

  1. Elasticsearch - A distributed, RESTful search and analytics engine.
  2. Kibana - For visualizing Elasticsearch data in real time.
  3. PostgreSQL - A powerful, open-source object-relational database system.
  4. MongoDB - An open-source document-oriented database.
  5. Redis - An in-memory key-value store used as a database, cache and message broker.
  6. Memcached - A general-purpose distributed memory caching system.
  7. Neo4j - A graph database that allows for flexible queries using Cypher query language.
  8. InfluxDB - An open-source time series database.

Office & Productivity#

  1. LibreOffice - An open-source office suite.
  2. OnlyOffice - A platform that combines online text editors, document and project management, file storage in a single solution.
  3. Apache OpenOffice - Another free and open-source office suite.
  4. Zimbra Collaboration Suite - An email and calendar server with an optional desktop client.

Infrastructure & Monitoring#

  1. Nagios - A monitoring system for systems, networks, and infrastructure.
  2. Zabbix - An enterprise-class open source distributed monitoring solution.
  3. Prometheus - A monitoring system and time series database.
  4. InfluxDB - For storing and analysing metrics.
  5. Kubernetes - An open-source container-orchestration system for automating computer containers.
  6. OpenVPN - A robust and highly configurable VPN solution.
  7. NGINX - A high performance web server and reverse proxy server.
  8. Traefik - A modern HTTP reverse proxy and load balancer.
  9. HAProxy - A reliable, efficient, and flexible load balancing solution.

Multimedia & Entertainment#

  1. Plex - A client-server media management and streaming platform.
  2. Emby - An extensible media server and player with rich metadata capabilities.
  3. Radarr - A companion application to Sonarr for downloading new episodes of TV shows.
  4. Sonarr - An index based, TV show downloader that uses NZB files.
  5. Jackett - An indexing engine that searches many different websites.
  6. Deluge - A lightweight and feature-rich BitTorrent client.
  7. Rutorrent - An easy-to-use bittorrent client with a lot of features.
  8. Lidarr - An automated music indexer that can automatically download your favourite albums.

E-commerce#

  1. Magento Open Source - A flexible e-commerce platform for businesses of all sizes.
  2. PrestaShop - An open-source e-commerce solution.
  3. OpenCart - A free, open-source shopping cart system.
  4. WooCommerce - A WordPress plugin that turns your site into a fully-fledged online store.

Security#

  1. fail2ban - A network security tool that analyses log files for failed login attempts and then bans the IP addresses of those who succeed in multiple unsuccessful login attempts.
  2. Cryptography - Tools and libraries for encryption and decryption.
  3. OSSEC - A powerful open-source host-based intrusion detection system.
  4. Pulse Secure Virtual Desktop - A secure access service edge (SASE) platform that enables organizations to deliver integrated, cloud-first application and network access security.
  5. ClamAV - An open-source antivirus engine for detecting Trojans, viruses, malware, and other malicious threats.

Cloud & Storage#

  1. OpenStack - A cloud operating system for delivering various cloud services.
  2. Cloudflare - An internet performance and security company that provides a network of distributed servers to protect websites from cyber attacks.
  3. Nextcloud - Already listed earlier, but worth mentioning again as it’s also a full-fledged cloud service.
  4. OpenVPN - For creating secure remote access to your home lab.

Web Servers#

  1. Apache HTTP Server - The world’s most widely used web server.
  2. NGINX - A high performance HTTP and reverse proxy server.
  3. Caddy - An automated web server with automatic HTTPS.

Developer Tools & IDEs#

  1. Visual Studio Code - A code editor redefined and optimised for building and debugging modern web and cloud applications.
  2. Eclipse - An open-source integrated development environment (IDE).
  3. IntelliJ IDEA - A powerful IDE for JVM-based languages like Java, Kotlin, Scala and Android.

Learning & Educational Resources#

  1. Khan Academy - Provides free online education for a variety of subjects.
  2. Moodle - An open-source course management system that can be used to create an online learning environment.
  3. Canvas - A cloud-based learning management system (LMS).
  4. edX - An online learning platform founded by Harvard University and the Massachusetts Institute of Technology.

Game Servers#

  1. Minecraft Server - To run your own Minecraft server.
  2. SteamCMD - Steam’s content delivery tool to help manage game updates on dedicated servers.
  3. ARK: Survival Evolved Server - To host a survival multiplayer game server for ARK.

File Storage & Backup#

  1. BorgBackup - A deduplicating backup program that supports file and block storage.
  2. Bacula - An open-source enterprise-level data protection, restore, and recovery system.
  3. Rclone - A tool to sync directories between cloud storage providers.

Media Streaming & DVR#

  1. Emby - For centralized media streaming within your network.
  2. MediaPortal - A free open source media centre software for Microsoft Windows.
  3. DVR-PC - A complete TV recording, streaming and live TV viewing solution that runs on Linux (and Windows) PCs.

Other Tools#

  1. Mattermost - Team communication tool, which also has a collaboration suite component.
  2. GitPod - A web-based code server with pre-configured tools for full-stack development environments.
  3. GitBucket - An easily installable GitHub compatible Git server written in Scala.
  4. Zabbix - For monitoring your infrastructure and applications.

How to reduce the file size of a pdf file in linux cli

  1. Install Ghostscript: If it’s not already installed, you can install Ghostscript using your distribution’s package manager. For Debian-based systems like Ubuntu, use:

    sudo apt-get update
    sudo apt-get install ghostscript

    For Red Hat-based systems like Fedora, use:

    sudo dnf install ghostscript
  2. Compress the PDF: Once Ghostscript is installed, you can compress your PDF file using the following command:

    gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf

    In this command:

    • input.pdf is the name of your original PDF file.
    • output.pdf is the name of the compressed PDF file that will be created.
    • -dPDFSETTINGS=/screen sets the quality of the PDF. This setting is for the lowest quality and smallest file size, which is suitable for viewing on a screen. Other options include /ebook for medium quality, /printer for high quality, and /prepress for high quality with large file size.

To reduce the compression level in Ghostscript when converting or processing a PDF file, you can adjust the -dPDFSETTINGS option. The command you provided is set to use the /screen setting, which applies high compression and low-resolution output, suitable for viewing on a screen but not ideal for printing or archiving.

Shutdown Proxmox VM using CLI

If you’re looking to shut down a virtual machine running on a Proxmox Virtual Environment (PVE), you can use the Proxmox command-line interface (CLI) to accomplish this task quite effectively. The command for shutting down a VM in Proxmox is qm shutdown, followed by the ID of the virtual machine you’d like to shut down. Here’s how to do it:

  1. Access the Server: First, log in to your Proxmox server via SSH.

Mastering Ansible: A Step-by-Step Tutorial

We’ll be diving straight into the core concepts and components that will help you become proficient in Ansible. This tutorial assumes that you have already installed Ansible on your system and have a basic understanding of what Ansible is.

Setting Up the Environment#

SSH Key Generation#

If you haven’t already, generate an SSH key pair on your Ansible control node.

ssh-keygen -t rsa

SSH Key Distribution#

Copy the SSH public key to all your target nodes.

How to count number of words in a pdf file from Linux cli

Using pdftotext:#

  1. Installation:

    • If it’s not installed, you’ll need to install the poppler-utils package which includes pdftotext.
    sudo apt install poppler-utils

    or

    yum install poppler-utils

    depending on your distribution.

  2. Usage:

    • Once installed, you can convert a PDF to text and then count the words as follows:
    pdftotext input.pdf - | wc -w

    Here, input.pdf is your source PDF file, and wc -w counts the number of words. The - in pdftotext specifies that the output should be sent to stdout, which is then piped into wc.

How to install Postgresql Client using Homebrew

Psql is a command-line interface for interacting with PostgreSQL, a powerful and open source relational database system. Brew is a package manager for macOS that makes it easy to install and manage software. Here are the steps to install psql with brew:

  • First, install the brew package manager if you don’t have it already. You can do this by running the following command in your terminal:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  • Second, update brew by running the following commands:
brew doctor
brew update
  • Third, install libpq by running the command:
brew install libpq

Libpq is a library that contains psql and other PostgreSQL client utilities.

How to avoid other pods from being scheduled on your node in Kubernetes

Kubernetes is a powerful platform for managing containerized applications across a cluster of nodes. However, sometimes you may want to have more control over which pods are scheduled on which nodes, for various reasons such as performance, security, or cost.

What are taints and tolerations?#

Taints and tolerations are a feature of Kubernetes that allow you to mark nodes with certain attributes or conditions, and then specify which pods can or cannot be scheduled on those nodes based on those attributes or conditions. Taints are applied to nodes, and tolerations are applied to pods.