Skip to content

Instantly share code, notes, and snippets.

View projectoperations's full-sized avatar

projectoperations projectoperations

View GitHub Profile
@projectoperations
projectoperations / README.md
Created May 17, 2024 13:05 — forked from gamma/README.md
How to connect a docker container to the docker daemon on a Synology NAS

Note: This originates from: https://forum.synology.com/enu/viewtopic.php?f=258&t=107508&sid=78d911737c5ecea1f9087bdab13612bf&start=15#p478281

Here are steps that I have modified to work for me. This assumes you have a shared folder named "docker" in volume1.

We need to Symlink /var/run/docker.sock to /volume1/docker/docker.sock, because Synology Docker GUI will not be able to run it when it's pointed directly to /var/run/docker.sock. Also the symlink needs to persist after reboot. To make it do so, you will need to create an automated task in your Synology DSM via "Task Scheduler".

  • Go to "Control Panel" > "Task Scheduler".
  • Click "Create" > "Scheduled Task" > "User-defined Script".
  • On the "Create Task: Window, make sure "User:" is selected as "root" and rename the "Task:" to whatever you like.
  • Click "Schedule" tab. Under "Date - Run on the following days", select "Daily". Under "Time - Frequency", select "Every 1 hour(s)" (just to be on the safe side).
@projectoperations
projectoperations / git-deployment.md
Created May 16, 2024 20:41 — forked from noelboss/git-deployment.md
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.

@projectoperations
projectoperations / executeOnTerminal.md
Created May 15, 2024 11:33 — forked from programmerShinobi/executeOnTerminal.md
Create Foreign Table From MySQL Server To PostgreSQL Server Using Docker On Linux Operating System

~ Command List :

  1. Install chumaky/postgres_mysql_fdw
$ sudo docker pull chumaky/postgres_mysql_fdw
  1. Install toleg/postgres_mysql_fdw
$ sudo docker pull toleg/postgres_mysql_fdw
@projectoperations
projectoperations / 01 - Setup Nextjs site on Ubuntu Server - Terminal commands Setup NextJS app on Digital Ocean Ubuntu server Full Terminal Commands Step by Step
#Setup NextJS on Ubuntu server (Digital Ocean, EC2,...) Terminal Commands
#based on my YouTube video
#Recommended: An ubuntu server with at least 2 GB memory to handle npm run build
#login to server
ssh root@ip_address
#Upgrade Server - may take a few minutes
sudo apt update
sudo apt upgrade
import subprocess
def get_docker_containers():
try:
# Run the docker ps command with the specified format
result = subprocess.run(['docker', 'ps', '--no-trunc', '--format', '{{.ID}}|{{.Image}}|{{.Command}}|{{.RunningFor}}|{{.Status}}|{{.Ports}}|{{.Names}}'],
stdout=subprocess.PIPE, text=True, check=True)
output = result.stdout
except subprocess.CalledProcessError as e:
print(f"Error executing command: {e}")
@projectoperations
projectoperations / docker-volumes.md
Created May 14, 2024 01:06 — forked from onlyphantom/docker-volumes.md
Demystifying Docker Volumes for Mac and PC Users

Demystifying Docker Volumes for Mac and PC Users

  1. Docker runs on a Linux kernel

Docker can be confusing to PC and Windows users because many tutorials on that topic assume you're using a Linux machine.

As a Linux user, you learn that Volumes are stored in a part of the host filesystem managed by Docker, and that is /var/lib/docker/volumes. When you're running Docker on a Windows or Mac OS machine, you will read the same documentation and instructions but feel frustrated as that path don't exist on your system. This simple note is my answer to that.

When you use Docker on a Windows PC, you're typically doing one of these two things:

  • Run Linux containers in a full Linux VM (what Docker typically does today)
@projectoperations
projectoperations / logstash-guide.md
Created May 11, 2024 00:37 — forked from bwbaugh/logstash-guide.md
Installing logstash server and client

Installing logstash

Server install

Install

Install the Java prerequisite:

@projectoperations
projectoperations / Docker-compose.yml
Created May 7, 2024 00:15 — forked from 2tony2/Docker-compose.yml
Example Docker Compose for DBT devcontainer
version: '3'
volumes:
local-dbt-env-shell-history: # This basically let's docker auto-manage this volume.
services:
local-dbt-env:
profiles:
- development
platform: linux/amd64 # We force the platform for consistency.
@projectoperations
projectoperations / Vagrantfile
Created May 4, 2024 20:30 — forked from mike-hearn/Vagrantfile
Multi-machine Vagrant config with private networking
# -*- mode: ruby -*-
# vi: set ft=ruby :
boxes = [
{
:name => "server1",
:eth1 => "192.168.205.10",
:mem => "1024",
:cpu => "1"
@projectoperations
projectoperations / docker-api-port.md
Created May 4, 2024 20:17 — forked from styblope/docker-api-port.md
Enable TCP port 2375 for external connection to Docker

Enable TCP port 2375 for external connection to Docker

See this issue.
Docker best practise to Control and configure Docker with systemd.

  1. Create daemon.json file in /etc/docker:

     {"hosts": ["tcp://0.0.0.0:2375", "unix:///var/run/docker.sock"]}