Skip to content

Instantly share code, notes, and snippets.

View officialmofabs's full-sized avatar
💭
building safe spaces

Moses Fabiyi officialmofabs

💭
building safe spaces
View GitHub Profile
@officialmofabs
officialmofabs / Git_Behind_Proxy.md
Created August 23, 2025 04:37 — forked from ozbillwang/Git_Behind_Proxy.md
Configure Git to use a proxy (https or SSH+GIT)
@officialmofabs
officialmofabs / git_server.md
Created August 20, 2025 12:37 — forked from Kreijstal/git_server.md
How to set up git with nginx

Setting Up Git with Nginx for Anonymous HTTP Access

This guide explains how to configure a Git repository to be served anonymously over HTTP using Nginx and git-http-backend. This setup allows users to clone and fetch repositories without authentication, and optionally push if configured. It’s ideal for public repositories or simple internal use cases.

Prerequisites

  • A Linux server with:
    • Git installed (sudo apt install git)
    • Nginx installed (sudo apt install nginx)
    • fcgiwrap installed (sudo apt install fcgiwrap) to bridge Nginx and git-http-backend
@officialmofabs
officialmofabs / Dockerfile
Created August 20, 2025 08:36 — forked from noinarisak/Dockerfile
VsCode devcontainer development setup for Java 8
#-------------------------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
#-------------------------------------------------------------------------------------------------------------
FROM openjdk:8-jdk
# This Dockerfile adds a non-root user with sudo access. Use the "remoteUser"
# property in devcontainer.json to use it. On Linux, the container user's GID/UIDs
# will be updated to match your local UID/GID (when using the dockerFile property).
@officialmofabs
officialmofabs / 01-server-config-in-git.md
Created August 20, 2025 06:47 — forked from juzna/01-server-config-in-git.md
Server Configuration in git

Server Configuration in git

With git you can have anything versioned. You're used to version your code, which is a bunch of files. Your server configuration (on Linux) is also just a bunch of files, so it can be versioned as well.

The idea is simple: create a git repository in /etc/ and commit everytime you change any configuration of your server. Written in code:

cd /etc
git init
git add .

I don't expect moby/moby#24170 to be solved by Docker team on near future so this gist is about looking for least ugly workarounds which are available today and on near future.

What is possible on Docker 19.03

Network

It is possible to create overlay network with use user specified subnet. On this example I create network which is size is two C -class networks ( IP range 10.0.0.0 - 10.0.1.255 ) and force Docker to use IPs from second part of it ( 10.0.1.0 - 10.0.1.255 ).

That way I can make sure that IPs 10.0.0.2 - 10.0.0.254 can be specified to containers and they do not collide with IPs which Docker engine assign for service(s)/container(s).

@officialmofabs
officialmofabs / local-registry.md
Created August 18, 2025 14:56 — forked from trisberg/local-registry.md
Using a Local Registry with Minikube

Using a Local Registry with Minikube

Install a local Registry

These instructions include running a local registry accessible from Kubernetes as well as from the host development machine at registry.dev.svc.cluster.local:5000.

  1. Use the docker CLI to run the registry:2 container from Docker, listening on port 5000, and persisting images in the ~/.registry/storage directory.
@officialmofabs
officialmofabs / docs.md
Created August 16, 2025 23:55 — forked from kaigouthro/docs.md
Install Docker to Mounted Drive

A Bash script for Debian/Ubuntu-based systems that will install Docker (if not already installed) and configure it to use a specified directory (presumably on your mounted external drive) for storing containers, images, volumes, etc.

Important Considerations BEFORE Running:

  1. External Drive MUST be Mounted: This script assumes your external drive is already mounted before you run the script. It does not handle mounting the drive itself.
  2. Persistent Mount: For Docker to start correctly after a reboot, the external drive must be mounted persistently (e.g., via an entry in /etc/fstab) at the same path every time.
  3. Backup: If you have existing Docker data in /var/lib/docker and it's important, BACK IT UP before running this script. The script attempts to move existing data, but failures can happen.
  4. Root Privileges: You need to run this script with sudo.
  5. Distribution: This script is tailored for Debian/Ubuntu. The package manager (apt), repository s

Start a dev server

Serve a local directory of static assets - using one-line solutions and no scripts

The first solution uses an IDE extension, while the rest involve using the command-line (intended for macOS and Linux, but they will hopefully work on Windows too).

Table of contents

@officialmofabs
officialmofabs / server.conf
Created August 11, 2025 05:06 — forked from timcheadle/server.conf
SSL nginx config example
server {
listen 80;
server_name www.example.com example.com;
# Redirect all traffic to SSL
rewrite ^ https://$host$request_uri? permanent;
}
server {
listen 443 ssl default_server;