Skip to content

Instantly share code, notes, and snippets.

@BretFisher
BretFisher / docker-swarm-ports.md
Last active February 16, 2024 08:24
Docker Swarm Port Requirements, both Swarm Mode 1.12+ and Swarm Classic, plus AWS Security Group Style Tables

Docker Swarm Mode Ports

Starting with 1.12 in July 2016, Docker Swarm Mode is a built-in solution with built-in key/value store. Easier to get started, and fewer ports to configure.

Inbound Traffic for Swarm Management

  • TCP port 2377 for cluster management & raft sync communications
  • TCP and UDP port 7946 for "control plane" gossip discovery communication between all nodes
  • UDP port 4789 for "data plane" VXLAN overlay network traffic
  • IP Protocol 50 (ESP) if you plan on using overlay network with the encryption option

AWS Security Group Example

@denysvitali
denysvitali / stream-pulseaudio-vlc-sonos.md
Last active November 27, 2023 16:19
Quick tutorial on how to play sound from your computer to a Sonos device

Quick tutorial on how to play sound from your computer to a Sonos device

Introduction

Assumptions

192.168.1.111 IP of your Sonos Device
192.168.1.128 IP of your computer

Configuration

PulseAudio

@chaitunya
chaitunya / start_spotify.sh
Last active May 16, 2023 00:18
Simple script to automatically go to a Spotify window if it's already open or create a new instance if it's not
#!/usr/bin/bash
pgrep -f /app/extra/share/spotify/spotify
if [ $? = 1 ]; then
/usr/bin/flatpak run --branch=stable --arch=x86_64 --command=spotify --file-forwarding com.spotify.Client $*
# Non-flatpak version of spotify:
# spotify $*
else
wmctrl -x -a spotify
fi
#!/bin/bash
# get-docker-socket-from-remote <name> <user>@<host>
# Create a unix socket at /tmp/<name>-docker.sock which, when
# used will ssh to <user>@<host> and connect to the docker
# socket at <host>:///var/run/docker.sock
# Note:
# 1. This forks a subjob that manages the local socket.
# Rmember to kill that when your finished
@joelmoss
joelmoss / gist:2470666
Created April 23, 2012 12:37
Capistrano recipe for Puma start/stop/restarts
set :shared_children, shared_children << 'tmp/sockets'
namespace :deploy do
desc "Start the application"
task :start, :roles => :app, :except => { :no_release => true } do
run "cd #{current_path} && RAILS_ENV=#{stage} bundle exec puma -b 'unix://#{shared_path}/sockets/puma.sock' -S #{shared_path}/sockets/puma.state --control 'unix://#{shared_path}/sockets/pumactl.sock' >> #{shared_path}/log/puma-#{stage}.log 2>&1 &", :pty => false
end
desc "Stop the application"
task :stop, :roles => :app, :except => { :no_release => true } do
@zer4tul
zer4tul / weechat.md
Last active August 21, 2021 21:12
A Simple, Base16 Friendly, Weechat Setup

A Simple, Base16 Friendly, Weechat Setup

Scripts

  • Some must-have scripts
  /script install buffers.pl buffer_autoclose.py iset.pl go.py colorize_nicks.py
@tach
tach / Synology_NAS_Tips.md
Last active May 10, 2021 21:06
My tips using Synology NAS (DS215j)

Synology NAS Tips

Shell operation tips

Password of root is same as administrator account as you created on setup.

How to change shell prompt

PS1="\u@\h:\w$ "
@vgoma
vgoma / webpack-dev-server-watch-docker-container-osx.md
Last active March 28, 2021 11:27
Configuring webpack dev server watch inside docker container on OSX 10.12.5 (Sierra)

Configuring webpack dev server watch inside docker container on OSX 10.12.5 (Sierra)

The problem

When running webpack dev server from inside of docker container dev server says that it watching files, but don't react on changes in hosts filesystem. It also can actually react and recompile bundle but stream not updated files to the browser.

Solution

Some of this steps might not needed, but it was long run googling for complete solution

If you're using Webstorm or Phpstorm etc. Try disable "safe write" option in settings:

@ryanray
ryanray / deploy.rb
Created November 21, 2013 11:15
I couldn't find a quick example of how to deploy a node.js app using Capistrano 3. This gist assumes you are using Capistrano 3, Upstart, Forever, ssh/forward agent, and an unprivileged user named 'deploy'. Hopefully this simple setup will help to get you started.
# config/deploy.rb
# probably a lot of ways to improve this...
set :application, 'my_app'
set :repo_url, 'git@github.com:USERNAME/my_app.git'
# should set up a deploy user
set :user, 'deploy'
set :deploy_to, '/var/www/my_app'
set :scm, :git
@f-f
f-f / spacemacs-cheshe.md
Last active July 31, 2019 16:09 — forked from robphoenix/spacemacs-cheshe.md
Spacemacs Cheat Sheet

Useful Spacemacs commands

  • SPC q q - quit
  • SPC w / - split window vertically
  • SPC w - - split window horizontally
  • SPC 1 - switch to window 1
  • SPC 2 - switch to window 2
  • SPC w c - delete current window
  • SPC TAB - switch to previous buffer
  • SPC b b - switch buffers