Skip to content

Instantly share code, notes, and snippets.

@nu12
nu12 / nginx.yaml
Created June 9, 2023 15:39
Basic NGINX deployment, service and ingress for traefik with TLS
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx
labels:
app: nginx
spec:
replicas: 1
selector:
@nu12
nu12 / installer_tool.sh
Last active January 4, 2024 01:05
Installer tool
# installer_tool.sh: automated setup for ubuntu machines.
# Copyright (C) 2020 nu12
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@nu12
nu12 / Install-Ruby-and-Rails-using-RVM.md
Created November 24, 2020 14:10
Install Ruby and Rails using RVM

RVM

$ gpg2 --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
$ curl -sSL https://get.rvm.io | bash -s stable
$ curl -sSL https://get.rvm.io | bash -s stable --rails
$ source ~/.rvm/scripts/rvm

Ruby

@nu12
nu12 / dockerapi-demo.md
Last active December 22, 2020 19:26
Gem dockerapi demo tool

Using ruby gem to access Docker API

In this article we will explore the functionalities of dockerapi gem, a Ruby gem to interact directly with Docker API through HTTP. Differently from other gems, this gem uses HTTP requests to create a true API-like implementation behaviour. If you want to interact with Docker in an object-oriented approach, the traditional docker-api would be a better fit. If you want to manipulate the Docker client in the host machine, see docker gem.

Why another gem?

Most gems seem to be abandoned for years, even the most famous ones. This alone wouldn't be a great deal, but they also lack functionality: not only Containers and Images are important, but Networks, Volumes, Swarms, Nodes, Secrets and so on. This gem aims to implement as most of the Docker API functionalities as possible.

Gem usage

@nu12
nu12 / CRUD-with-Django.md
Last active May 14, 2020 17:58
CRUD with Django

CRUD Django

Source: EN | PT

Packages and env

Install packages

$ sudo apt-get update -y 
$ sudo apt-get upgrade -y 
$ sudo apt-get install -y python3-pip python3-virtualenv