Skip to content

Instantly share code, notes, and snippets.

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

Angelo Andelnyr Sampaio Alves Andelnyr

🏠
Working from home
View GitHub Profile
@Andelnyr
Andelnyr / python-guide.sh
Created July 28, 2025 00:05
Outra versão de python-guide.sh
#!/bin/bash
# The definitive guide to setup my Python workspace
# Author: Henrique Bastos <[email protected]>
set -euo pipefail
clear
if [ $USER == 'root' ]; then
@Andelnyr
Andelnyr / prepara_vm_rl9.sh
Created October 15, 2023 12:16
A partir de uma instalação RockyLinux mínima, prepara uma VM com XFCE e VBoxaddons
#!/bin/bash
# Função para verificar o status de um comando e sair em caso de erro
check_command_status() {
if [ $? -ne 0 ]; then
echo -e "\nERRO: O COMANDO FALHOU. A INSTALAÇÃO SERÁ INTERROMPIDA."
echo "======================================================="
exit 1
fi
}
@Andelnyr
Andelnyr / prepara_to.sh
Last active September 7, 2022 06:49
Personalizando RockLinux9 para funcionar como "Terminal de Operação"
#!/bin/bash
clear
# Este script deve ser executado como root
if [ "$USER" != "root" ]; then
echo "================================================="
echo "+ ERRO: Este script deve ser executado como root."
echo "================================================="
exit
fi
@Andelnyr
Andelnyr / rename_nic.sh
Last active August 23, 2022 22:15
Renomear interface de rede do CentOS 7&8
#!/bin/bash
# O script só pode ser executado como root
# Se não for o caso - informar e sair
# Verificar se foram informados o nome inicial e final da interface
# Se não houver - informar e sair
# Verificar se foi informada um nome incial válida da interface
# Se não houver - informar e sair
https://happycodeschool.com/blog/por-que-todo-mundo-deveria-aprender-a-programar/#:~:text=Pessoas%20que%20aprendem%20a%20programar,pilares%20para%20o%20bom%20funcionamento.
Programar em grupo é melhor do que programar sozinho
Aprender a programar é bom porque:
1 - Te auda a utilizar as Tecnologias existentes a disponíveis ao seu favor
@Andelnyr
Andelnyr / install_gitea_centos7.sh
Created April 27, 2022 00:33
Script para instalação do Gitea no Centos7
#!/usr/bin/env bash
# Script elaborado a partir das informações encontradas em:
# https://docs.gitea.io/en-us/install-from-binary/
# https://computingforgeeks.com/install-gitea-git-service-on-centos-with-nginx/
if [ "$USER" != "root" ]; then
echo "========================================="
echo "Este script deve ser executado como root."
echo "========================================="
exit
@Andelnyr
Andelnyr / py_thread_pinger.py
Created October 29, 2021 01:39
Pingador implementado em Python com threads
#!/usr/bin/python2
# encoding: utf-8
import multiprocessing
import subprocess
import os
def pinger( job_q, results_q ):
DEVNULL = open(os.devnull,'w')
while True:
@Andelnyr
Andelnyr / install_webappmanager.sh
Last active May 25, 2021 23:06
Instalar o WebAppManager do Mint no PopOS!
# Instalar o pacote gir1.2-xapp-1.0 e suas dependências
sudo apt install gir1.2-xapp-1.0
# Instalar o pacote python3-bs4 e suas dependências
sudo apt-get install python3-bs4
# Instalar o pacote Pillow
sudo pip install Pillow
@Andelnyr
Andelnyr / 00-detect-virtualenv-sitepackages.py
Created March 4, 2021 15:25 — forked from viniciusban/00-detect-current-venv.py
IPython startup script to detect and inject VIRTUAL_ENV's site-packages dirs.
"""IPython startup script to detect and inject VIRTUAL_ENV's site-packages dirs.
IPython can detect virtualenv's path and injects it's site-packages dirs into sys.path.
But it can go wrong if IPython's python version differs from VIRTUAL_ENV's.
This module fixes it looking for the actual directories. We use only old stdlib
resources so it can work with as many Python versions as possible.
References:
http://stackoverflow.com/a/30650831/443564
@Andelnyr
Andelnyr / dicas_pyenv.md
Created March 3, 2021 13:04
Dicas para utilização do pyenv

Criando um projeto em ~/workspace (nem precisa ir para o diretório antes pois você será redirecionado após a execução da linha abaixo):

mkproject nome_do_projeto

Clonando um repositório git:

cd ~/workspace
git clone https://github.com/User_Git/foo.git

Configurando Virtualenv no repositório git clonado:

mkvirtualenv -a ~/workspace/foo -p python foo