Skip to content

Instantly share code, notes, and snippets.

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

Ali Muhammad darkwizard242

🏠
Working from home
View GitHub Profile
@darkwizard242
darkwizard242 / vagrant_stop.sh
Last active April 5, 2020 03:44
Shell script to stop all running vagrant instances under current user.
#!/bin/bash -e
### 1. Script globally checks for all vagrant instances running under the user executing the script.
### 2. Assigns the instance ID's of any running instance to the variable "instances".
### 3. Checks for whether the variable "instances" is an empty string.
### 4. If not an empty string, then run a for loop to print vagrant instance information and halts (stops) it.
vagrant_stop () {
@darkwizard242
darkwizard242 / ansible_galaxy_role_id.sh
Last active March 30, 2020 23:47
Shell script that finds the role id for a role from Ansible Galaxy. Interactively asks the user to supply galaxy username and role.
#!/bin/bash -e
############ VARIABLES ############
executable="ansible-galaxy"
############ VARIABLES ############
echo -e "\nThis script fetches role id of an ansible role that exists in Ansible Galaxy (https://galaxy.ansible.com/)\n"
check_executable () {
if command -v ${executable} &> /dev/null;
@darkwizard242
darkwizard242 / letsencrypt_caa_bugcheck.py
Last active April 4, 2020 05:06
Python3 code snipped to check for whether your site has buggy version of LetsEncrypt Certificate as reported in https://community.letsencrypt.org/t/2020-02-29-caa-rechecking-bug/114591
#!/usr/bin/env python3
import requests
## This python3 code snippet checks for the bug reported on:
## https://community.letsencrypt.org/t/2020-02-29-caa-rechecking-bug/114591
## This script can be run as: `python3 letsencrypt_caa_bugcheck.py`
## Replace the value for domains with appropriate domains you want to check against.
domains = ["myfirstdomain.com", "myseconddomain.com"]
@darkwizard242
darkwizard242 / github_public_repos.sh
Created March 25, 2020 21:45
List GitHub User's public repositories
## Assumes `curl` and `jq` are installed/available.
curl --silent "https://api.github.com/users/darkwizard242/repos?per_page=100000&page=1" | jq -r '.[] | .name'