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
@marcosricardoss
marcosricardoss / dummy-web-server.py
Created March 22, 2018 19:10 — forked from bradmontgomery/dummy-web-server.py
a minimal http server in python. Responds to GET, HEAD, POST requests, but will fail on anything else.
#!/usr/bin/env python
"""
Very simple HTTP server in python.
Usage::
./dummy-web-server.py [<port>]
Send a GET request::
curl http://localhost
@marcosricardoss
marcosricardoss / fix-wordpress-permissions.sh
Last active February 17, 2021 12:49
How to Fix File and Folder Permissions Error in WordPress
#!/usr/bin/env bash
chown www-data:www-data -R * # Let Apache be owner
find . -type d -exec chmod 755 {} \; # Change directory permissions rwxr-xr-x
find . -type f -exec chmod 644 {} \; # Change file permissions rw-r--r--
@marcosricardoss
marcosricardoss / docker-installer.sh
Last active August 30, 2023 18:43
Docker Installer
#!/usr/bin/env bash
# update the apt package index and install packages to allow apt to use a repository over HTTPS:
sudo apt-get update -y
sudo apt-get install ca-certificates curl gnupg -y
sudo apt-get install python3-pip
# add Docker’s official GPG key:
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
@marcosricardoss
marcosricardoss / abnt.sh
Last active February 17, 2021 12:32
Configure accents for English keyboards in linux (brazilian keyboard maps)
#!/usr/bin/env bash
setxkbmap -model abnt -layout us -variant intl
@marcosricardoss
marcosricardoss / remove-git-tags.sh
Last active March 4, 2021 14:35
How to remove all git remote and local tags
# Delete All local tags. (Optional Recommended)
git tag -d $(git tag -l)
# Fetch remote All tags. (Optional Recommended)
git fetch
# Delete All remote tags.
git push origin --delete $(git tag -l)
# Delete All local tags
git tag -d $(git tag -l)
@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
@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 / 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 / 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 / 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