Listing non-root users with shell

Posted on 2023/08/01 in Linux • Tagged with Linux, Bash, Shell

Listing non-root users

This is a simple Bash script to list all non-root and non-system users in Linux. Those users are determined by two settings, UID_MIN and UID_MAX, found on the /etc/login.defs file.

#!/bin/bash -
#===============================================================================
#
#          FILE: lista-users.sh
#
#   DESCRIPTION:
#
#        AUTHOR: Nerdeiro da Silva <a n a r c h 1 5 7 a  at  n i n j a z u m b i . c o m>
#       CREATED: 01/08/2023 14:14:18
#      REVISION:  0.01
#       LICENSE: GNU GPL 2.X (https://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
#===============================================================================

set -o nounset                                  # Treat unset variables as an error

# Get lowest and highest UID from login.defs …

Continue reading

Syncing game saves with almost any cloud service

Posted on 2023/04/07 in Linux • Tagged with Linux, Cloud, Games, Steam Deck

Sync game saves to nextcloud using this script


Continue reading

Using Home Assist to sleep/resume a Linux PC

Posted on 2022/12/16 in Linux • Tagged with Linux, Power, Automation, Home Assistant

Intro

All right, you automated lots of stuff arround your place with Home Assistant, but what about your PC ?

Wouldn't it be cool if you could turn it on or off from anywhere, just tapping on a button in your phone screen ?

Well, if your PC supports Sleep/Resume, you can do it with a couple of scripts. I'll demonstate here how to do it for a Linux desktop/notebook. You can addapt this to MacOS, maybe even Windows. You you do it, let me know on Mastodon, just Toot me at @nerdeiro@fosstodon.org.

Checking system

First of all, let's check if your system supports Sleep/Resume. On a …


Continue reading

Running Ansible with AWS System Manager

Posted on 2022/12/12 in Cloud • Tagged with Clous, AWS, SSM, Ansible

Introduction

Ansible is a fantastic tool to automate tasks and manage fleets of servers

Amazon SSM, or Systems Manager, also offers tools to manage your fleet of servers. One of the tools they offer is Session Manager, which allows you to run an interactive shell without having to open a TCP port to the world or dealing with SSH keys.

Usualy, ansible uses SSH to connect and send payloads to the managed servers, if you're using only SSM to mange your instances, how can Ansible connect to them? Well, by using SSM itself to communicate and an S3 bucket to store the payload.

Debian/Ubuntu users beware

System Manager uses …


Continue reading

First Post on NinjaZumbi

Posted on 2022/02/12 in Site • Tagged with blog, misc

First Post

Yay! That's it, I'm finaly getting out of my Ass and publishing stuff here.

Maybe, one day, I'll have some actual content.

Until then, here's a pic of my cats.

Marceline e Fiona