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 / 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 / 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=
#! /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 / 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"
@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 / colors.rasi
Created August 19, 2022 22:04
Fix error $FG not declared Rofi Archcraft
/* vim .config/i3/rofi/themes/colors.rasi */
/* Copyright (C) 2020-2022 Aditya Shakya <[email protected]> */
/* Everyone is permitted to copy and distribute copies of this file under GNU-GPL3 */
* {
background: #1e222a;
background-alt: #262A32;
foreground: #c8ccd4;
FG: #c8ccd4; /* Just add this line */
selected: #61afef;
@nosrednawall
nosrednawall / .bashrc
Created August 23, 2022 00:45
Vim como editor padrão no ranger
# Adicione o export abaixo em seu bashrc ou zshrc
export VISUAL="vim"
@nosrednawall
nosrednawall / resolve.md
Last active September 7, 2022 00:27
noise p2 archlinux

$ sudo pacman -S sox

$ mkdir -p ~/.config/systemd/user/

$ vim ~/.config/systemd/user/usb-audio-keep-alive.service

[Unit]
Description=Keep USB Audio Alive Using sox
@nosrednawall
nosrednawall / install_unifi_debian_11.txt
Created September 15, 2022 00:50 — forked from sinofool/install_unifi_8_debian_12.txt
Install Unifi Controller on Debian 11 (Bullseye)
# Java 8
curl -fsSL "https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public" | sudo gpg --dearmor --yes -o /usr/share/keyrings/adoptopenjdk-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/adoptopenjdk-archive-keyring.gpg] https://adoptopenjdk.jfrog.io/adoptopenjdk/deb bullseye main" | sudo tee /etc/apt/sources.list.d/adoptopenjdk.list
sudo apt-get update && sudo apt-get install -y adoptopenjdk-8-hotspot
# MongoDB 3.6
wget -qO - https://www.mongodb.org/static/pgp/server-3.6.asc | sudo apt-key add -
echo "deb http://repo.mongodb.org/apt/debian stretch/mongodb-org/3.6 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.6.list
# Unifi
@nosrednawall
nosrednawall / mover_arquivos_subpastas.py
Created October 29, 2022 23:01
move todos os arquivps de um tipo, das subpastas para a pasta mae
import os
import re
import shutil
import glob
def mover_arquivo_subpastas():
path = r"/home/anderson/Vídeos/Mob Pyscho 100 (2016)/mob_s3/" # caminho da pasta
files = glob.glob(path + '/**/*.mkv', recursive=True) # gera uma lista dos arquivos no tipo especificado, mkv, recusivamente
for file in files:
padrao = re.compile(r"[^\\/]+?(?=$)") # regex para pegar o nome do arquivo mais a extensão, ignorando todo o path