Skip to content

Instantly share code, notes, and snippets.

View projectoperations's full-sized avatar
💭
building learning and connections

projectoperations projectoperations

💭
building learning and connections
View GitHub Profile
@projectoperations
projectoperations / instructions.txt
Created June 12, 2024 23:00 — forked from jitheshkt/instructions.txt
Installing SSL on WSL2 Apache
# The idea is, we don't install certificates on WSL, instead we install them on
# Windows and point the path at WSL Apache/Ngnix configuration file.
# We use mkcert to generate certificates.
# https://github.com/FiloSottile/mkcert
# Install mkcert on Linux. Even though we don't generate certificate here,
# I am installing this only to check the constant is properly set or not.
# If you're Linux Ninja like my friend Bombay, you could do it without
# This package for sure.
@projectoperations
projectoperations / git-config
Last active May 20, 2024 07:41 — forked from dev-SR/git-config
Sample of git config file (Example .gitconfig) (Place them in $XDG_CONFIG_HOME/git)
# set VScode as editor:
git config --global core.editor "code --wait"
# open in VScode:
git config --global -e
# alias `!git`
# If the alias expansion is prefixed with an exclamation point(`!`), it will be treated as a shell command.
[user]
email = support@igedevteam.onmicrosoft.com
name = Project Operations
username = projectoperations
@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 / 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-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"]}
    
@projectoperations
projectoperations / .gitconfig
Last active September 6, 2024 21:02 — forked from dwcullop/.gitconfig
Sample of git config file (Example .gitconfig)
[user]
name = project operations
email = support@igedevteam.onmicrosoft.com
[core]
editor = \"C:\\Program Files\\Microsoft VS Code\\Code.exe\" \"-n\"
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol,space-before-tab
tabwidth=4
excludesfile = ~/.gitignore-global
symlinks = false