Skip to content

Instantly share code, notes, and snippets.

View deviantony's full-sized avatar
🤖
https://bit.ly/IqT6zt

Anthony Lapenna deviantony

🤖
https://bit.ly/IqT6zt
View GitHub Profile
@deviantony
deviantony / install-latest-compose.sh
Last active September 6, 2024 10:31
Install latest version of Docker Compose
#!/bin/bash
## THIS IS THE OLD WAY
## Nowadays, simply follow the Compose installation instructions in the official documentation:
## https://docs.docker.com/compose/install/
# get latest docker compose released tag
COMPOSE_VERSION=$(curl -s https://api.github.com/repos/docker/compose/releases/latest | grep 'tag_name' | cut -d\" -f4)
@deviantony
deviantony / README.md
Last active September 4, 2024 02:41
Portainer HTTP API by example

DEPRECATION NOTICE

This gist is now deprecated in favor of our official documentation: https://documentation.portainer.io/api/api-examples/ which contains up to date examples!

THE FOLLOWING DOCUMENTATION IS DEPRECATED

Please refer to the link above to get access to our updated API documentation and examples.

@deviantony
deviantony / README.md
Created March 8, 2018 01:24
Portainer admin password in a docker-compose environment

Portainer compose deployment with admin password preset

This file aims to explain how to deploy Portainer inside a compose file with the admin password already set.

Generate the admin password

For this example, we'll use the password superpassword.

Use the following command to generate a hash for the password:

@deviantony
deviantony / local-persist-install-nosudo.sh
Last active January 6, 2024 18:04
Installation of the local-persist volume driver for docker without sudo
#!/usr/bin/env bash
set -e
VERSION="v1.2.1"
# uname -s, uname -m
# Deb 32: Linux i686
# Ubuntu 64: Linux x86_64
# FreeBSD: FreeBSD amd64
@deviantony
deviantony / gist:ddb93425dc6f011c4d8b
Created September 13, 2015 15:20
SH entrypoint for docker-compose to manage dependency startup.
#!/usr/bin/env sh
# Wait for a HTTP service to be OK (return code 200) before trying to start another service.
echo "Stalling for SERVICE"
while true; do
status=$(curl --write-out %{http_code} --silent --output /dev/null http://service.domain/endpoint)
echo "Status: ${status}"
if [ "${status}" == "200" ]; then
break
else
@deviantony
deviantony / docker-compose.yml
Created September 5, 2017 13:19
Docker Swarm cluster setup with Docker in Docker
version: "2"
services:
portainer:
image: portainer/portainer:latest
container_name: "portainer-app"
command: -H unix:///var/run/docker.sock
networks:
- portainer
volumes:
- /tmp/manager_run/docker.sock:/var/run/docker.sock
@deviantony
deviantony / vsphere_info.py
Last active March 5, 2023 14:51
VMWare Vsphere info in Python using pyvmomi
#!/usr/bin/env python
import pyVmomi
import argparse
import atexit
import itertools
from pyVmomi import vim, vmodl
from pyVim.connect import SmartConnect, Disconnect
import humanize
@deviantony
deviantony / AGENT_CLUSTER.md
Last active May 4, 2022 18:14
Swarm aggregation feature discussion

Cluster of agents

This implementation rely on the fact that the agent is able to auto-discover other agents. Deployed as a global service inside a Swarm cluster, each agent automatically discover the other agents in the cluster and register them.

Portainer can then be plugged on any of these agents (either by using DNS-SRV records ensure high-availability or using the URL to a specific agent). To do so, a user would just need to create a new endpoint and add the IP:PORT to one of the agents in the cluster (or use the Swarm service name to be able to use DNS-SRV records).

The agent would be responsible for the following:

  • Aggregate the data of multiple nodes (list the containers available in the cluster for example)
  • Redirect requests to specific nodes in the cluster (inspect a container on a specific node or create a new secret via a cluster manager for example)
@deviantony
deviantony / README.md
Last active March 17, 2022 00:04
Portainer create image from HTTP API

This document aims to help you use the Portainer HTTP API to build a Docker image on a specific environment.

Requirements

  • A Portainer instance
  • A Portainer user account
  • The environment where you want to build the image created as an endpoint inside the Portainer instance

Instructions

@deviantony
deviantony / phantomjs
Last active January 4, 2018 17:18 — forked from wbotelhos/phantomjs_intaller.sh
Installer script to setup phantomjs 1.9.7, it will remove any previous setup. Contains also the init script to manage phantomjs as a system service and the default configuration file. Tested on Ubuntu 12.04.
#! /bin/sh
# Init. script for phantomjs, based on Ubuntu 12.04 skeleton.
# Author: Anthony Lapenna <lapenna.anthony@gmail.com>
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="Phantomjs service"
NAME=phantomjs
DAEMON=/usr/bin/$NAME
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME