Skip to content

Instantly share code, notes, and snippets.

View AlexJDevil's full-sized avatar

Alex. J. Devil AlexJDevil

  • https://github.com/bmcsoftware
  • London
View GitHub Profile

Docker Swarm Cheat Sheet

Initialize the local Docker service as a swarm manager. As a guideline, in production you should have 3 to 5 managers. Swarm is managed through port 2377, which should be blocked from external access.

$ docker swarm init

Join an existing swarm as a worker node. Replace $SWARM_MANAGER with the IP address or domain name of a swarm manager node.

@AlexJDevil
AlexJDevil / docker-compose cheat sheet
Created November 22, 2024 21:07 — forked from githubfoam/docker-compose cheat sheet
docker-compose cheat sheet
#=====================================================================
docker-compose -f docker-compose.json up #use JSON instead of YAML compose file
#=====================================================================
docker-compose -f ~/hello_world/docker-compose.yml build
docker-compose -f ~/hello_world/docker-compose.yml up -d
docker-compose ps # Lists containers.
docker-compose stop
docker-compose start # Starts existing containers for a service.
docker-compose stop # Stops running containers without removing them.
docker-compose pause # Pauses running containers of a service.
@AlexJDevil
AlexJDevil / Print_ServerJobLogs.ps1
Created April 23, 2024 13:01 — forked from theagreeablecow/Print_ServerJobLogs.ps1
Print Server Job Logs from Event Viewer to CSV using Get-WinEvent and XML queries
<#
.SYNOPSIS
Print server job logs from Event Viewer to csv file
.DESCRIPTION
This script uses Get-WinEvent and XML queries to retrieve EventID 307 job logs from print servers.
Specifically querying the Microsoft-Windows-PrintService/Operational log.
Log is extracted to a CSV file and optionally emailed.
.PARAMETER FileName

Increasing the amount of inotify watchers

If you are not interested in the technical details and only want to get Listen to work:

  • If you are running Debian, RedHat, or another similar Linux distribution, run the following in a terminal:
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
@AlexJDevil
AlexJDevil / install_golang.sh
Created February 8, 2024 10:42 — forked from eggbean/install_golang.sh
Script for automated installation or updating Go. For Linux and macOS, x86_64, arm64 and arm.
#!/bin/bash -e
# This script installs or updates to the latest version of Go.
# Multi-platform (Linux and macOS)
# Multi-architecture (amd64, arm64, arm) support
#
# Add to your .profile, .bash_profile or .zshenv:
# export PATH=$PATH:/usr/local/go/bin
error_string=("Error: This command has to be run with superuser"