Skip to content

Instantly share code, notes, and snippets.

View nosrednawall's full-sized avatar

Anderson José de Souza Inácio nosrednawall

View GitHub Profile
@nosrednawall
nosrednawall / email_smtp.py
Last active July 14, 2022 16:53
Monta Estrutura MIME email
def monta_estrutura_email(subject, email_from, email_to, msg_html, msg_plain, lista_anexos):
message = MIMEMultipart("mixed")
message["Subject"] = subject
message["From"] = email_from
message["To"] = email_to
related_body = MIMEMultipart("related")
if len(lista_anexos) > abs(0):
for part in lista_anexos:
related_body.attach(part)
@nosrednawall
nosrednawall / convert.py
Created January 6, 2021 15:19
convert dav to mp4 python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from os import system
from os import walk
import ffmpeg # pip isntall ffmpeg ffmpeg-python
import os
def convertVideo(filenameVideo):
name, ext = os.path.splitext(filenameVideo)
out_name = name + ".mp4"
#! /bin/bash
wget http://www.musicpd.org/download/mpd/0.22/mpd-0.22.3.tar.xz
tar xf mpd-0.22.3.tar.xz
cd mpd-0.22.3
sudo apt install meson g++ \
libpcre3-dev \
@nosrednawall
nosrednawall / sddm.conf
Created July 14, 2020 23:00
sddm.conf for voidlinux
[Autologin]
# Whether sddm should automatically log back into sessions when they exit
Relogin=false
# Name of session file for autologin session (if empty try last logged in)
Session=
# Username for autologin session
User=
@nosrednawall
nosrednawall / listar-usuarios-logados.sh
Created May 27, 2020 23:38
listar usuários logados no linux
#!/bin/bash
awk -F";" '{for(i=1;i<=NF;i++){if ($i !~ /nologin/){print $1}}}' /etc/passwd
@nosrednawall
nosrednawall / listar-usuarios-ativos.sh
Created May 27, 2020 23:37
listar usuários ativos linux
#!/bin/bash
awk -F";" '{for(i=1;i<=NF;i++){if ($i !~ /false/){print $1}}}' /etc/passwd
@nosrednawall
nosrednawall / install-stckrom-motoz2-play.sh
Created September 15, 2019 13:59
comandos para efetuar a instalação de uma stochrom no moto z2 play
sudo apt install android-tools-adb android-tools-fastboot
fastboot flash partition gpt.bin
fastboot flash bootloader bootloader.img
fastboot flash logo logo.bin
fastboot flash boot boot.img
fastboot flash recovery recovery.img
fastboot flash dsp adspso.bin
fastboot flash oem oem.img
fastboot flash system system.img_sparsechunk.0
@nosrednawall
nosrednawall / config
Created July 23, 2019 22:09
manage sound with keyboard in i3wm
bindsym XF86AudioRaiseVolume exec "amixer sset 'Master',0 5%+ unmute"
bindsym XF86AudioLowerVolume exec "amixer sset 'Master',0 5%- unmute"
bindsym XF86AudioMute exec "amixer sset Master,0 toggle"
@nosrednawall
nosrednawall / update_phoda.sql
Created June 10, 2019 23:51
update que utiliza o case when
update movfinanceiro set dtPagto = case
when movfinanceiro.idfinanceiro >201 and movfinanceiro.idfinanceiro < 259 then '2019-01-10 00:00:00'
when movfinanceiro.idfinanceiro >258 and movfinanceiro.idfinanceiro <319 then '2019-02-10 00:00:00'
when movfinanceiro.idfinanceiro >319 and movfinanceiro.idfinanceiro <378 then '2019-03-10 00:00:00'
when movfinanceiro.idfinanceiro >377 and movfinanceiro.idfinanceiro <437 then '2019-04-10 00:00:00'
when movfinanceiro.idfinanceiro >436 and movfinanceiro.idfinanceiro <496 then '2019-05-10 00:00:00'
when movfinanceiro.idfinanceiro >495 and movfinanceiro.idfinanceiro <555 then '2019-06-10 00:00:00'
when movfinanceiro.idfinanceiro >554 and movfinanceiro.idfinanceiro <614 then '2019-07-10 00:00:00'
when movfinanceiro.idfinanceiro >613 and movfinanceiro.idfinanceiro <673 then '2019-08-10 00:00:00'
when movfinanceiro.idfinanceiro >772 and movfinanceiro.idfinanceiro <732 then '2019-09-10 00:00:00'
@nosrednawall
nosrednawall / consultorias-list.json
Created June 7, 2019 18:15
lista de consultorias em json
[{"id":1,"cnpj":"37.939.007/0001-83","nomeFantasia":"Gato Ajato Consultoria Ltda","razaoSocial":"Marcela e Antonella Ferragens ME","email":"[email protected]","nomeContato":"Marcela","telefone":"(41) 2531-4950","endereco":{"id":1,"cep":"83221-332","nomeRua":"Acesso Diva Nunes dos Santos","municipio":"Paranaguá","estado":"PR","pais":"Brasil"},"areaFoco":"Ferragens"},{"id":2,"cnpj":"58.412.090/0001-08","nomeFantasia":"Sabrina e Roberto Financeira ME","razaoSocial":"Sabrina e Roberto Financeira ME","email":"[email protected]","nomeContato":"Sabrina","telefone":"(43) 3658-2837","endereco":{"id":2,"cep":"86073-480","nomeRua":"Rua Sidrak Silva Filho","municipio":"Londrina","estado":"PR","pais":"Brasil"},"areaFoco":"Segurança"},{"id":3,"cnpj":"29.475.037/0001-58","nomeFantasia":"Martin e Isabella Pães e Doces ME","razaoSocial":"Martin e Isabella Pães e Doces ME","email":"[email protected]","nomeContato":"Martin","telefone":"(41) 2638-431