Skip to content

Instantly share code, notes, and snippets.

View marcosricardoss's full-sized avatar
:octocat:
committing...

Marcos Ricardo marcosricardoss

:octocat:
committing...
View GitHub Profile
# install_certifi.py
#
# sample script to install or update a set of default Root Certificates
# for the ssl module. Uses the certificates provided by the certifi package:
# https://pypi.python.org/pypi/certifi
import os
import os.path
import ssl
import stat
@marcosricardoss
marcosricardoss / README.md
Created March 3, 2023 15:44 — forked from magnetikonline/README.md
Install VirtualBox 6.1/6.0/5.2/5.1 guest additions on Ubuntu server guest.
@marcosricardoss
marcosricardoss / dump.py
Last active December 29, 2021 17:17
Django dump data for a single model
from django.core import serializers
from myproject.myapp import models
data = serializers.serialize("json", models.MyModel.objects.all())
out = open("dump.json", "w")
out.write(data)
out.close()
@marcosricardoss
marcosricardoss / build.sh
Last active March 12, 2021 13:11
Publishing a docker image according git tags
#!/usr/bin/env bash
# docker hub username
USERNAME=marcosricardoss
# image name
IMAGE=helloworld
docker build -t $USERNAME/$IMAGE:latest .
# make it executable with chmod a+x ./build.sh
@marcosricardoss
marcosricardoss / .gitignore
Last active March 11, 2021 13:47
Fixing untrack files already added to git repository based on .gitignore
# MY DEFAULT .GITIGNORE FILE
# Project files and directories
/static/
/tmp/
/media/
/mysql/
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
@marcosricardoss
marcosricardoss / docker-compose.yml
Last active March 11, 2021 23:18
The Swagger Editor is an open source editor to design, define and document RESTful APIs in the Swagger Specification
version: '3.2'
services:
swagger-editor:
container_name: swagger-editor
restart: always
image: swaggerapi/swagger-editor
ports:
- "8080:8080"
environment:
SWAGGER_FILE: /tmp/openapi/openapi.yaml
@marcosricardoss
marcosricardoss / docker-compose.yml
Last active March 11, 2021 23:14
Running Portainer - Oopen source container management tool for Kubernetes, Docker, Docker Swarm and Azure ACI.
version: '3.2'
services:
portainer.io:
container_name: portainer.io
restart: always
image: portainer/portainer
ports:
- "9000:9000"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
@marcosricardoss
marcosricardoss / get-latest-tag-on-git.sh
Created March 4, 2021 15:06 — forked from rponte/get-latest-tag-on-git.sh
Getting latest tag on git repository
# The command finds the most recent tag that is reachable from a commit.
# If the tag points to the commit, then only the tag is shown.
# Otherwise, it suffixes the tag name with the number of additional commits on top of the tagged object
# and the abbreviated object name of the most recent commit.
git describe
# With --abbrev set to 0, the command can be used to find the closest tagname without any suffix:
git describe --abbrev=0
# other examples
@marcosricardoss
marcosricardoss / semantic-commit-messages.txt
Created March 3, 2021 16:56
Semantic Commit Messages
feat: add hat wobble
^--^ ^------------^
| |
| +-> Summary in present tense.
|
+-------> Type: chore, docs, feat, fix, refactor, style, or test.
chore: add Oyster build script
docs: explain hat wobble
@marcosricardoss
marcosricardoss / git-clone.sh
Created March 3, 2021 16:55
How to clone a single branch in Git
git clone --single-branch --branch features/name https://github.com/username/reponame