Skip to content

Instantly share code, notes, and snippets.

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

Dennis McCarthy dmccuk

🏠
Working from home
View GitHub Profile

Generated via ChatGPT:

Hopefully this is what you need...

Python version:

To use this script, you'll need to replace your_company_name with the name of the company you're searching for, and your_github_api_token with a valid GitHub API token that has the necessary permissions to access user data. You can run the script from the command line or in a Python development environment, and it will print a list of usernames associated with the specified company on GitHub.

To use this script with the company_name argument, you can run the command like this:

python github_users.py -c teslamotors

Project Name

The project [insert project name] is a [insert brief description of what the project does]. The project is [insert why it's useful or entertaining].

Prerequisites

Before using the project, please ensure that your system meets the following requirements:

  • Operating System: [insert supported OS]
  • Software: [insert any software or dependencies required]
  • Additional Information: [insert any other important information required to run the project]

Quick Start

@dmccuk
dmccuk / ansible_failed_hosts.md
Last active June 6, 2025 17:18
For when you need Ansible to give you a list of unreachable or failed hosts

How to get a list of failed or unreachable hosts

This is in response to this stackoverflow question The solution was posted by Vladimir Botka.

  • YouTube walkthough here

When Ansible runs, it's great for setting up and configuring servers as per your playbooks and roles. But have you ever needed to collect a list of failed hosts where Ansible wasn't able to connect to them? In this demo I'm going to show you how to collect a list of failed and unreachable hosts.

My setup:

I'm simply using a list of servers that don't exist, along with one remote server that I can get to.

Get facts from Windows servers

In this vide I want to show you, as aLinux admin, how to get facts from a windows wserver.

To set the scene, you're a Linux admin who works with Ansible. You already collect facts, including custom facts from Linux servers, but you've been asked to extent this to a small number of Windows servers. Apart from the usual facts collected by the setup module, we also need to know the versions of installed software so we can get a picture of our estate. You don't know how to write powershell but you know it can;t be that hard.

This is what I'm going to show you today:

  • I already have Ansible able to manage a windows server. IF you don't, check out my other video on gtting that setup: https://youtu.be/aPN18jLRkJI
  • I'm goint to show you how to collect facts from a windows server using the setup module.
  • Next I'll add a custom facts to collect all installed applications and their versions.

Meetup 18

Welcome to the meetup. This page is to help you take part in the Ansible-lockdown talk. Request access to one of the Ansible control nodes and run ansible-lockdown against a Rocky Linux 8 server. He're the setup:

The ubuntu Ansible control Node has all the requisite software installed already.

These were the updates made for this demo:

  • Making sure port 80 was allowed and not removed - This didn't work yet...

Ansible: Nested and Dynamic Variables

This is a quick demo to show you how to use nested variables, then override them to make them useful in your playbooks.

Subscribe To Me On YouTube: https://bit.ly/lon_sub

Create a role

The first thing we do is create a new role to put our ansible code:

mkdir roles

Cloud shell

Free VM playgroud

Subscribe To Me On YouTube: https://bit.ly/lon_sub

If you're looking for a FREE environment for testing your code against, Have you heard about Google cloud shell??

If you have a gmail account, you get FREE access to you're own VM.

Please click the **Subscribe** button. I really appreciate it!

In this demo, I'll cover the following tasks:

Subscribe To Me On YouTube: https://bit.ly/lon_sub

  • Start with a newly built Ubuntu 20.04 server
  • Install pre-requisite packages
  • Install Jenkins
  • Install some other helpful packages like ansible, wget, git, etc
  • Install the default plugins
  • Login and setup the Admin user
{
"support": "github.com/dmccuk/SponsorMe",
"YouTubeChannel": "youtube.com/c/LondonIAC",
"linkedIn": "linkedin.com/in/dennismccarthyuk/",
"meetup": "meetup.com/londoniac",
"website": "londoniac.co.uk/",
}