Skip to content

Instantly share code, notes, and snippets.

View diegovarussa's full-sized avatar
:octocat:
Do what is right, not what is easy

Diego Varussa diegovarussa

:octocat:
Do what is right, not what is easy
View GitHub Profile
@diegovarussa
diegovarussa / azure-acr-copy.sh
Created February 14, 2020 07:25
Azure Container Registry (ACR) Copy: This script pull all images from you source registry, re-tag it and push to destination registry
#!/bin/bash
SOURCE_SUBSCRIPTION_ID='REPLACE_HERE'
SOURCE_REGISTRY_NAME='REPLACE_HERE'
DESTINATION_REGISTRY_NAME='REPLACE_HERE'
# Get a json array with repository list of you source registry
SOURCE_REPOSITORIES=$(az acr repository list \
--name ${SOURCE_REGISTRY_NAME} \
--subscription ${SOURCE_SUBSCRIPTION_ID})
@diegovarussa
diegovarussa / cfn-lint.md
Last active October 21, 2019 05:53
Use docker to run any command without install it on your Linux
#!/bin/bash
(docker build \
	--tag cfn-lint:latest \
	--quiet \
	-<<EOF
FROM python:alpine
RUN pip install cfn-lint
WORKDIR /workdir
ENTRYPOINT ["cfn-lint"]
@diegovarussa
diegovarussa / ubuntu_desktop_entry.md
Created June 29, 2018 07:33
Add new desktop entry to Ubuntu 18.04 dock

Create a new file in:

/home/mobingi/.local/share/applications

Content

[Desktop Entry]
Version=1.0
Type=Application
@diegovarussa
diegovarussa / mac_shortcuts.md
Last active June 20, 2018 02:20
Mac keyboard shortcuts

Full printscreen

command + shift + 3

Area printscreen

command + shift + 4

Full area one screen only

command + shift + 4 after space

All images are saved on your desktop

@diegovarussa
diegovarussa / api_standards.md
Created May 28, 2018 01:38
API Creation Standards

Method GET

Get by ID, Get all, Get all with filter by query parameters

  • If find record return 200 with content.
{
    "my_data": "abcde fghijk",
    "create_time": "2018-04-05T02:47:29+00:00",
    "update_time": "2018-04-06T06:44:43+00:00"
@diegovarussa
diegovarussa / git_commands.md
Last active July 18, 2018 04:48
Git commands

Merge Branches

git checkout development
git pull 
git checkout master
git pull
git merge --no-ff --no-commit development

If conflict is encountered, we can run git status to check details about the conflicts and try to solve

@diegovarussa
diegovarussa / screen_commands.md
Last active May 22, 2018 01:23
Screen Important Comands

Create a new screen session with name.

screen -S session_name

Detach from a current scree session.

ctrl+a d

List all screen sessions.

screen -ls

Restore a session screen.

@diegovarussa
diegovarussa / new_project_phpstorm.md
Last active July 12, 2018 08:00
Configuration for new project in PHPStorm using Docker
@diegovarussa
diegovarussa / docker_run_config_phpstorm.md
Last active July 3, 2018 02:22
Create docker run image config file in PHPStorm

Go to edit configurations

image

Add new docker image

image

Configuration

@diegovarussa
diegovarussa / docker_commands.md
Last active April 3, 2018 03:40
Common docker commands.

List all running containers

docker ps

List all imges

docker images

Build docker image

docker build -t my_docker_hub_namespace/my_image_name:0.0.1 .

Login on docker hub