Skip to content

Instantly share code, notes, and snippets.

View nolram's full-sized avatar
🏠
Working from home

Marlon Baptista de Quadros nolram

🏠
Working from home
View GitHub Profile
@nolram
nolram / update_route_53.sh
Last active September 14, 2022 00:55
Simple shellscript to update Route 53 record with the current public IP
#!/bin/bash
# Use EC2 Role to allow the EC2 modify Route 53 record, instead of AWS_SECRET_KEYS
AWS_REGION="us-east-1"
HOSTED_ZONE_ID="XXXXXXXXXXXXXXXXXXXX"
DOMAIN_NAME="example.com"
# Get the current IP address
EC2_IP=$(curl http://169.254.169.254/latest/meta-data/public-ipv4)
@nolram
nolram / clone_codecommit_repos.sh
Last active September 1, 2022 22:26
Script to clone all repositories from AWS CodeCommit on a specific AWS Account.
#/bin/bash
# Script to clone all repositories from AWS CodeCommit on a specific AWS Account.
# This script clone ssh repositories, but it can be changed to use https
# Requirements
# aws-cli - https://aws.amazon.com/pt/cli/
# jq - https://stedolan.github.io/jq/
# git
@nolram
nolram / .0readme.md
Last active February 22, 2023 21:23
Personal ZSH and Development Tools (Initial Setup Linux)

Personal ZSH and Development Tools (Initial Setup Linux)

Screenshot from 2022-06-05 10-19-23

Files

  • .zshrc - Settings of .zshrc (put the file in $HOME folder)
cd ~ && wget https://gist.githubusercontent.com/nolram/d9b85fc294480a64fb30cb9b49c74135/raw/4b5fd0a9ebc473cd61f288992a71fae305aceb63/.zshrc
apiVersion: v1
kind: Namespace
metadata:
name: marlon
---
apiVersion: v1
kind: Pod
metadata:
name: testando-busybox
namespace: marlon
@nolram
nolram / jenkins-compose.yaml
Last active December 22, 2017 13:17
Jenkins Compose
version: '3.2'
services:
jenkins:
image: jenkinsci/blueocean
user: root
privileged: true
volumes:
- ~:/home
- jenkins-data:/var/jenkins_home
- /var/run/docker.sock:/var/run/docker.sock
@nolram
nolram / Dockerfile
Created August 13, 2017 01:35
Docker-compose: Django + Postgis + RabbitMQ + Celery + Redis
FROM python:3.5
MAINTAINER Marlon Baptista de Quadros([email protected])
ENV PYTHONUNBUFFERED 1
RUN apt-get update -y
RUN apt-get -y install binutils libproj-dev gdal-bin postgresql-client python3-lxml
RUN apt-get -y install libmemcached-dev
@nolram
nolram / aprendendo_go.go
Last active July 28, 2017 15:03
Apenas algoritmos simples com propósito de aprendizado da linguagem Go
package main
import (
"fmt"
)
const a int = 1
type student struct {
nome string
@nolram
nolram / update_packages_pip.py
Last active December 16, 2015 16:36
Atualização de todos os pacotes pip de Python 3.4
def update_all_pip(exceptions=[]):
'''
Esse método atualiza todos os pacotes instalados através do método call()
@arg: exceptions é uma lista de nomes de pacotes em caixa baixa que não serão atualizados
'''
to_update = pip.get_installed_distributions(skip=["setuptools", "python", "pip",
"distribute"]+exceptions)
for dist in range(0, len(to_update)):
print("Verificando o pacote %s - restando: %s de %s " % (to_update[dist], dist+1, len(to_update)))
call("pip install --upgrade "+ to_update[dist].project_name, shell=True)
@nolram
nolram / rename.py
Last active January 9, 2023 03:07
Script simples de python para renomear os arquivos de um diretório.
import os
# Renomeia os arquivos do diretório em que o script se encontra iniciados com span_ removendo-os do nome do arquivo
# Ex: span_teste.img -> teste.img
REMOVE_WORD = "span_"
for filename in os.listdir("."):
if filename.startswith(REMOVE_WORD):
os.rename(filename, filename[len(REMOVE_WORD):])
@nolram
nolram / update_pip_packages.py
Last active August 29, 2015 14:04
Script em Python 2.7 para atualizar os pacotes PIP
#-.- encoding: utf-8 -.-
# Script retirado de http://stackoverflow.com/a/5839291 com pequenas modificações minhas
import pip
from subprocess import call
def update_all_pip(exceptions=[]):
'''
Esse método atualiza todos os pacotes instalados através do método call()
@arg: exceptions é uma lista de nomes de pacotes em caixa baixa que não serão atualizados
'''