graph BT
fisica[Física]
enlace[Enlace]
redes[Redes<br>ou Inter-redes]
transporte[Transporte]
sessao[Sessão]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env pwsh | |
| $URL_CSV = 'https://raw.githubusercontent.com/jurandysoares/eleitores-ifrn-2019/master/csv/alunos.csv' | |
| $ARQ_CSV = 'alunos.csv' | |
| $info_texto = (Get-Culture).TextInfo | |
| Invoke-WebRequest -Uri $URL_CSV -OutFile $ARQ_CSV | |
| $nomes = (Import-Csv -Path $ARQ_CSV).Nome | |
| $usuarios = @{} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| str=part1/part2/part3 | |
| # part1 | |
| echo ${str%%/*} | |
| # part1/part2 | |
| echo ${str%/*} | |
| # part2 | |
| echo ${${str%/*}#*/} | |
| # part2/part3 | |
| echo ${str#*/} | |
| # part3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import yaml | |
| from pprint import pprint | |
| dados = yaml.load(open('ex-redhat-01.yaml'), Loader=yaml.Loader) | |
| pprint(dados, width=1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| # String | |
| nome = 'Fulano de Tal Pereira da Silva' | |
| nome_min = nome.lower().replace(' ', '') | |
| print(nome_min) | |
| # List | |
| lista_letras = list(nome_min) | |
| print(lista_letras) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ''' | |
| Code written for a Brazilian Portuguese audiance. | |
| Please adjust the variables' names to your language. | |
| ''' | |
| # I've written this Python code inspired by the following post: | |
| # https://mathematica.stackexchange.com/questions/183624/how-to-construct-rectangular-figures-from-the-fibonacci-numbers | |
| from collections import defaultdict | |
| import turtle |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| import markdown | |
| remetente = "estudante@jurandy.lab" | |
| destinatario = "estudante@jurandy.lab" | |
| mensagem = MIMEMultipart("Abracadabra") | |
| mensagem["Subject"] = "Abracadabra" | |
| mensagem["From"] = remetente |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # https://community.spiceworks.com/t/powershell-convert-multi-line-string-variable-into-array/765578 | |
| $pacotesTxt = "GitHub.GitHubDesktop | |
| Git.Git | |
| Microsoft.VisualStudioCode | |
| Python.Python.3.12" | |
| $pacotesVetor = $pacotesTxt -split "`r`n" | |
| foreach ($pacote in $pacotesVetor) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # sudo meu-vps | |
| # Conteúdo de: /etc/sudoers.d/asa | |
| # %asa ALL=(ALL) NOPASSWD: /usr/local/bin/meu-vps | |
| if [[ -v SUDO_USER ]]; then | |
| CONT_NAME="vps-${SUDO_USER}" | |
| status_cont=$(lxc info "${CONT_NAME}" | /bin/grep -E ^Status: | awk '{print $2}') | |
| if [ "${status_cont}" != "RUNNING" ]; then |